[PVE-User] venet and routing... again ;)

Dietmar Maurer dietmar at proxmox.com
Thu Dec 10 08:33:30 CET 2009

> It is OK, but next one fails:
> glpi:~# ping
> PING ( 56(84) bytes of data.
> --- ping statistics ---
> 9 packets transmitted, 0 received, 100% packet loss, time 8010ms

Maybe tcpdump gives you any hints?
> After adding modifying routing table:
> glpi:~# route add -net netmask dev venet0:2
> (Note: despite that i showed routing for venet0:2, it shows venet0)
> glpi:~# route -n
> Kernel IP routing table
> Destination  Gateway   Genmask         Flags Metric Ref    Use Iface
> UH    0      0        0 venet0
>   U     0      0        0 venet0
>         UG    0      0        0 venet0
> anyway, now i can reach this network:
> glpi:~# ping
> PING ( 56(84) bytes of data.
> 64 bytes from icmp_seq=1 ttl=63 time=0.103 ms
> 64 bytes from icmp_seq=2 ttl=63 time=0.094 ms
> 64 bytes from icmp_seq=3 ttl=63 time=0.089 ms
> Only problem is that after reboot of guest, i loose this table. I tried
> to modify /var/lib/vz/private(or root)/101/etc/network/interfaces file
> to add post-up routing tasks, but i loose it after guest reboot.
> So, my questions are:
> 1)Why is routing on guest side set up in this manner, that all traffic
> goes through venet0, and not venet0:1...

That is how venet works.

> 2) how to modify routing on venet ifaces for guest to keep it
> permanent?

On Debian Guests, just read the file /etc/network/interfaces - I will 
post the text here:

# WARNING: Do not edit this file, your changes will be lost.
# Please create/edit /etc/network/interfaces.head and /etc/network/interfaces.tail instead,
# their contents will be inserted at the beginning and at the end
# of this file, respectively.

Or what guest OS do you use?

> 3)After reading
> http://www.mokonamodoki.com/proxmox-openvz-server-2-nics-2-gateways ,
> especially this fragment: "...however veth does give your guest
> container OS direct access to the network, in a smiliar fashion to the
> way VMware server can give a guest OS direct access to a physical
> network using Bridged Ethernet." I tend to move my guests from venetv
> to
> veth structure. Is there any easy way to do it?

Use the web interface - just remove all IPs, press save, then change to veth mode.

- Dietmar

More information about the pve-user mailing list