Unclear how to set network to VM

daniixxl

New Member
Jan 24, 2021
2
0
1
31
Hello, I've been struggling with this problem for a few days, I can't figure it out. I forgot how to configure it. I didn't ping the VM I created. I don't have internet. I want to mention that I have 1 public ip, but I want to create 2 virtual machines. 1 for mysql and 1 for files


auto lo
iface lo inet loopback

iface eno1 inet manual

iface eno2 inet manual

auto eth0
iface eth0 inet manual

auto vmbr0
iface vmbr0 inet static

iface vmbr0 inet static
address 195.154.133.146/24
gateway 195.154.133.1
bridge-ports eno1
bridge-stp off
bridge-fd 0

auto vmbr1
iface vmbr1 inet static
address 10.10.10.1/24
bridge-ports eth0
bridge-stp off
bridge-fd 0

post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s '10.10.10.0/24' -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '10.10.10.0/24' -o vmbr0 -j MASQUERADE
 
Just like tge page says: "Depending on your current network organization and your resources you can choose either a bridged, routed, or masquerading networking setup."
If the two VMs should be reachable from the internet without a firewall VM, you could probably go with the masquerading setup.