OpenVZ Forum


Home » Mailing lists » Users » IPv6 on veth interface (almost)SOLVED
IPv6 on veth interface (almost)SOLVED [message #14622] Tue, 03 July 2007 14:12
Jan Tomasek is currently offline  Jan Tomasek
Messages: 44
Registered: December 2006
Member
From: openvz.org
Hi,

with help Vitaliy and Kirill I managed to get my setup working. In final
it works, but it is very tricky to me. I'm not going to use this. To
save time of anyone who will decide to play this I will try to sumarize
my experiences. I'm using Debian etch systems.

HW node have addresses
195.113.233.4
2001:718:1:e::23:3004

VE should have
195.113.233.12
2001:718:1:e::23:3012

I created VE 233012 without IP addres after that issued command:

vzctl set 233012 \
--netif_add eth0,00:0C:29:63:A6:73,veth012.0,00:0C:29:63:A6:74

MAC adreses are created by easymac.sh [1] program. After that I had to
edit /etc/network/interfaces for VE:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 195.113.233.12
netmask 255.255.255.0
network 195.113.233.0
broadcast 195.113.233.255
gateway 195.113.233.4
dns-nameservers 195.113.144.233 195.113.144.194
dns-search cesnet.cz


eth0 inet6 static
iface eth0 inet6 static
address 2001:718:1:e::23:3012
post-up /sbin/sysctl -w "net.ipv6.conf.eth0.autoconf=0"
gateway 2001:718:1:e::23:3004
netmask 64

Note: sysctl is not going to work it says "Operation not permitted", I
was not trying to solve that. So VE have autoconfigured IP
2001:718:1:e:20c:29ff:fe63:a673 and static 2001:718:1:e::23:3004.

On HW node is situation bit more complicated. I had to comment out all
/etc/network/interfaces and configure it manualy. I created script
/etc/init.d/bridged-networking which is started when machine starts. It
is doing this:

brctl addbr br0
ifconfig eth0 0.0.0.0
ifconfig eth0 add 2001:718:1:e::23:3004/64
brctl addif br0 eth0

ifconfig br0 195.113.233.4
ifconfig br0 broadcast 195.113.233.255
ifconfig br0 netmask 255.255.255.0

/sbin/sysctl -w "net.ipv6.conf.br0.autoconf=0"
/sbin/sysctl -w "net.ipv6.conf.eth0.autoconf=0"

route add default gw 195.113.233.1

The reason why IPv4 address is assigned to bridge br0 is that when I
leave it on eth0 then system quickly lost IPv4 connectivity because ARP
stops working. Network specialist here says me that no IP should be on
bridge Vitaliy and my experiences from home bridge networking show that
at least for IPv4 IP address is needed on bridge.

IPv6 address on eth0 work just fine. It works as sort of backup when
IPv4 failure. ;) Actually it have problems when in br0 is only eth0
interface, it simply doesn't work.

After starting VE I have to execute `brctl addif br0 veth012.0` I didn't
figured how to do it automatically. <VEID>.start script is started in
context of VE and <VEID>.mount script is started before veth012.0 is
created. Document [2] seams to provide guide.

It is posible to create another VE with similar setup, with just another
IP addresses. Bit problematic is when last VE using veth is stopped, at
that moment IPv4 hangs approximately for 1 minute. After that period
system start to be responsible again. IPv6 is not affected by this.

Problems come when I try to mix veth and venet VE. When last VE using
veth is stoped than venet enabled VE stops responding on IPv4 (no IPv6
there). I didn't figure how to workaround this. Maybe some ARP ping to
right place?

[1]http://www.easyvmx.com/software/easymac.sh
[2] http://wiki.openvz.org/Virtual_Ethernet_device#Making_a_veth -device_persistent


Uff... that is all I managed to discover. As I said on beginning I'm
writing this just for record. I'm not going to use this setup, it is
complicated and mistakes can simply take down all VE including HW node.

Best regards
--
-----------------------
Jan Tomasek aka Semik
http://www.tomasek.cz/
Previous Topic: Network slowness
Next Topic: kernel errors in syslog
Goto Forum:
  


Current Time: Thu Dec 13 22:20:51 GMT 2018