0

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 so I am looking for help, maybe someone who knows more about networking can tell me where I got it all wrong.

Main machine (which has proxmox installed):

/etc/network/interfaces

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): Image of settings used And ofcourse, on proxmox the bridge is vmbr2

3
  • Why do NAT on the host? Perhaps try something simpler first, like bridging to vmbr0 and assigning the .68 IP in a guest. Feb 28, 2016 at 0:20
  • That can be done, I got VMs running like that already with .69 .70 .71 and so on. I just would like to have some machines on same IP, and when assigning .68 on 2 same machines then the network will be utterly slow or one will not have connection and the other one will have.
    – Geit
    Feb 28, 2016 at 5:37
  • Or you could put load balancers or proxies on the external IP guests, pointing to other internal IP guests. I'll admit I have not set up NAT like you are attempting before, my host is behind a gateway that does NAT. Feb 28, 2016 at 13:11

0

You must log in to answer this question.

Browse other questions tagged .