I've found that I can't run native IPV6 interface (at eth0) with 6to4 tunnel (at tun6to4) together.
Here's my setup (/etc/network/interfaces/):
auto eth0
auto bond0
iface eth0 inet static
address 57.164.26.201
netmask 255.255.255.0
network 57.164.26.0
broadcast 57.164.26.255
gateway 57.164.26.254
iface eth0 inet6 static
address 2001:5f45:2:1973::2
netmask 64
post-up /sbin/ip -6 r add default via 2001:5f45:2:19ff:ff:ff:ff:ff dev eth0
iface bond0 inet static
address 57.164.25.173
netmask 255.255.255.0
when I ping6 -I eth0 google.com - I got:
PING google.com(iad23s40-in-x0e.1e100.net) from 2001:5f45:2:1973::3 eth0: 56 data bytes
64 bytes from iad23s40-in-x0e.1e100.net: icmp_seq=1 ttl=55 time=81.1 ms
64 bytes from iad23s40-in-x0e.1e100.net: icmp_seq=2 ttl=55 time=81.1 ms
64 bytes from iad23s40-in-x0e.1e100.net: icmp_seq=3 ttl=55 time=81.0 ms
64 bytes from iad23s40-in-x0e.1e100.net: icmp_seq=4 ttl=55 time=81.0 ms
64 bytes from iad23s40-in-x0e.1e100.net: icmp_seq=5 ttl=55 time=81.0 ms
^C
--- google.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4005ms
rtt min/avg/max/mdev = 81.082/81.099/81.123/0.312 ms
After I run this:
/sbin/ip tunnel add tun6to4 mode sit ttl 62 remote any local 57.164.25.173
/sbin/ip link set dev tun6to4 up
/sbin/ip -6 addr add 2002:39a4:19ad::1/16 dev tun6to4
/sbin/ip -6 route add 2000::/3 via ::192.88.99.1 dev tun6to4 metric 1
I got 100% packet loss on both IPV6 interface's pings (though sometimes few packets reach google's ipv6..).
/etc/sysctl.conf
net.ipv6.conf.eth0.disable_ipv6=0
net.ipv6.conf.eth0.autoconf=1
net.ipv6.conf.eth0.accept_ra=1
net.ipv6.conf.eth0.accept_ra_defrtr=1
I've found this script in /etc/network/if-up.d/ipv6-routes
#!/bin/sh
# This script sets up the IPv6 connectivity by setting the default route.
# Matching entries in /etc/network/interfaces might not work when the boot
# process is parallelized, because eth0 is not up
# quickly enough.
[ -n "${ADDRFAM}" -a "${ADDRFAM}" != 'inet6' ] && exit 0
[ -n "${IFACE}" -a "${IFACE}" != "eth0" ] && exit 0
sleep 5
/sbin/ip -family inet6 route add 2001:5f45:2:19ff:ff:ff:ff:ff dev eth0
/sbin/ip -family inet6 route add default via 2001:5f45:2:19ff:ff:ff:ff:ff
exit 0
Seems that various different routes make such situation happen that none work correct. How can I solve it? Please, help. Running Debian 7 Wheezy.
EDIT: I've found a simple solution for 6to4: /etc/network/interfaces/
auto 6to4
iface 6to4 inet6 6to4
local 57.164.25.173
ifup 6to4
And after ifup 6to4 in console I run this:
echo "200 sixtofour" >> /etc/iproute2/rt_tables
ip -6 rule add from 2002::/16 table sixtofour
ip -6 route add 2002::/16 dev 6to4 table sixtofour
ip -6 route add default via ::192.88.99.1 dev 6to4 table sixtofour
After that both Native and 6to4 ipv6 interfaces can finally ping6 google.com ...
But.. it looks like not the end. I've got a little % (from 0 to 3-5 or even 10-12 % in some attempts) of packet loss on any of ipv6 interface. In some ping6 tests it runs really smooth and without any error, but sometimes I got 1 from 10-11 packets lost. I know that my 6to4 performance very much depends on multiple public 6to4 relays on the internet for anycast address, so it's almost impossible to find out which relay might be causing packet loss.. And it may be really better way to switch for tunnel broker. But I also know that there are people who use both ipv6 tunnel brokers and 6to4 interfaces at the same time AND there are even a lot more COMPLEX setups with various additional devices.
Seems that network routing in linux is very important for such setups and I'm kinda newbie in it.
BTW: what I've also found
Interrupt:20 Memory:fe500000-fe520000
line in eth0, when I run ifconfig in console.
I just hope that there could be few things left to fix it like:
- changing TTL;
- adding routing table for eth0 ipv6 interface
- running ndppd;
and/or a "little" more?
I really appreciate any help.
END OF PART2. To be continued