So I don't know much about the bridges and all, but I looked around and tried to get it still working. I've got one IP for the server itself and I thought to use second IP on the VMs. I thought I did all correctly but it seems that there is no internet connection and can't ping to anywhere it seems so I am looking for help, maybe someone who knows more about networking can tell me where I got it all wrong.
On proxmox webgui the bridge selected for VM is vmbr2
Main machine (which has proxmox installed):
/etc/network/interfaces
VM (OS is CentOS 7):
Thank you, all help is appreciated.
On proxmox webgui the bridge selected for VM is vmbr2
Main machine (which has proxmox installed):
/etc/network/interfaces
Code:
auto lo
iface lo inet loopback
auto vmbr0
iface vmbr0 inet static
address xx.xx.xx.67
netmask 255.255.255.224
gateway xx.xx.xx.65
bridge_ports eth0
bridge_stp off
bridge_fd 0
auto vmbr1
iface vmbr1 inet static
address xx.xx.xx.68
netmask 255.255.255.224
gateway xx.xx.xx.65
dns-nameservers 8.8.8.8 8.8.4.4
bridge_ports eth0
bridge_stp off
bridge_fd 0
auto vmbr2
iface vmbr2 inet static
address 192.168.0.1
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
bridge_ports none
bridge_stp off
bridge_fd 0
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s '192.168.0.0/24' -o vmbr1 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '192.168.0.0/24' -o vmbr1 -j MASQUERADE
# VM-01
post-up iptables -t nat -A PREROUTING -i vmbr1 -p tcp --dport 9987 -j DNAT --to 192.168.0.2:9987
post-down iptables -t nat -D PREROUTING -i vmbr1 -p tcp --dport 9987 -j DNAT --to 192.168.0.2:9987
VM (OS is CentOS 7):
Thank you, all help is appreciated.