[PVE-User] Newbie can't connect VMs with the Internet

Rick WIdmer proxmox at rickwidmer.com
Thu Oct 15 11:17:52 CEST 2015


Hopefully this is just something I am overlooking, and another set of 
eyes will find it quickly.  My host machine is running proxmox 
2.4-11/6502936f, and I have two VMs both running ubuntu 14.04.3.

The VMs can see (ping and ssh) each other, and the host machine, but 
they cannot connect to the Internet.


(What is the proper term for the host machine?)



I have attempted to use the following to setup networking:

https://pve.proxmox.com/wiki/Network_Model   Masquerading (NAT)

http://forum.proxmox.com/threads/16710-Proxmox-VE-NAT-AND-BRIDGE-with-1-Physical-Interface

https://raymii.org/s/tutorials/Proxmox_VE_One_Public_IP.html



On the Network tab for the container machine I see

Name	Type		Active	Auto...	ports 	IP addr
eth0	Network Device	No	No	
eth1	Network Device	No	No
vmbr0	Linux Bridge	No	Yes	eth0	62.210.188.129	
vmbr1	Linux Bridge	No	Yes		10.0.0.1


Name	subnet		gateway
eth0
eth1	
vmbr0	255.255.255.0	62.210.188.1
vmbr1	255.255.255.0

I find it interesting that nothing is Active even though Autostart is on 
for both of the bridges, but since the machine is connected to the 
Internet, and has access to the VMs, it probably isn't the problem...


On the Hardware tab of both VMs the Network Device is set to Bridged 
Mode, with the bridge set to vmbr1.  The model and MAC address are left 
at their default values.


The main host /etc/network/interfaces contains:
=====================================================================
# network interface settings

auto lo
iface lo inet loopback


                       iface eth0 inet manual


                       iface eth1 inet manual


                       auto vmbr0

             iface vmbr0 inet static
     address 62.210.188.129
     netmask 255.255.255.0
     gateway  62.210.188.1
     bridge_ports eth0
     bridge_stp off
     bridge_fd 0

auto vmbr1
iface vmbr1 inet static
     address  10.0.0.1
     netmask  255.255.255.0
     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 '10.0.0.0.0/24' -o vmbr0 -j 
MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '10.0.0.0.0/24' -o vmbr0 -j 
MASQUERADE


#  VM 1
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 2201 -j 
DNAT --to 10.0.0.101:22
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp --dport 2201 -j 
DNAT --to 10.0.0.101:22

# VM 2
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 2202 -j 
DNAT --to 10.0.0.102:22
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp --dport 2202 -j 
DNAT --to 10.0.0.102:22

=====================================================================

VM-101 /etc/network/interfaces:

=====================================================================
auto lo
iface lo inet loopback

auto eth0
     iface eth0 inet static
     address 10.0.0.101
     netmask 255.255.255.0
     network 10.0.0.0
     broadcast 10.0.0.255
     gateway 10.0.0.1
     dns-nameservers 10.0.0.1
=====================================================================


VM-102 /etc/network/interfaces:

=====================================================================
auto lo
iface lo inet loopback

auto eth0
     iface eth0 inet static
     address 10.0.0.102
     netmask 255.255.255.0
     network 10.0.0.0
     broadcast 10.0.0.255
     gateway 10.0.0.1
     dns-nameservers 10.0.0.1
=====================================================================


Is there anything else I should have reported?

Any ideas on what to try next?

Thanks,
Rick



More information about the pve-user mailing list