OpenVZ Forum


Home » General » Support » Trying to understand why 127.0.0.1 is assigned to venet0 (Problems discovered trying to run IPv6 only containers)
Trying to understand why 127.0.0.1 is assigned to venet0 [message #47137] Tue, 10 July 2012 21:16
dlundquist is currently offline  dlundquist
Messages: 1
Registered: July 2012
Junior Member
I'm working out the details of running IPv6 only containers, and in the course of this starting of have my doubts about my understanding of venet interfaces.

My current understanding is: the venet interface function as a point to point interface between the host node and each container. When an IP address is assigned or a container started the host is configured to respond to ARP requests for that containers IP addresses, in much the same manner as proxy ARP routing. For IPv6 proxy NDP is used instead. OpenVZ handles routing each packet transmitted on the hosts venet0 interface based on the IP addresses configured on each container, routing the packet to the appropriate container. This is similar to a Cisco router running no ip address on several serial interfaces, and proxy ARP on an Ethernet interface.

For testing IPv6 only containers, I've configured a container with just an IPv6 address and appended an IPv6 DNS resolver to NAMESERVER. This adds three name servers to /etc/resolv.conf inside the container, the first two our IPv4 and the last is an IPv6 address. When I try to resolve a hostname, the container first attempts to contact the IPv4 nameserver since an IPv4 default route is present.

A similar but related problem occurs when adding an IPv6 address to an IPv4 only container, the IPv6 default route is not added.



So my question is: why is 127.0.0.1 assigned by default on venet0 inside the container? Why is ::1 not assigned?

By assigning an IPv4 address it enabled the IPv4 route created pointing out the venet0 interface even though the container does not have an IPv4 address. Similarly since an IPv6 address is not added to venet0 the IPv6 default route does not stick when added at container start, and when adding the first IPv6 address later the default route is not present. This seems related to the 127.0.0.2 hack on Debian containers.

I've tested deleting 127.0.0.1 and the default IPv4 route from venet0 inside the container and IPv6 works as expected.

As a solution I propose modifying the /etc/vz/dists/scripts/*-{add,del}_ip.sh scripts to add or remove IPv6 and IPv4 default routes based on the presence or absence of addresses in the corresponding family in /proc/vz/veinfo inside the container.


Kernel: 2.6.32-042stab055.16
OSTEMPLATE: scientific

Previous Topic: Direct access to PCI card & drives?
Next Topic: Centos 5.8 Very resolve speeds
Goto Forum:
  


Current Time: Thu Aug 01 18:27:34 GMT 2024

Total time taken to generate the page: 0.03049 seconds