如何将本地ipv6与6to4一起使用? 我丢了包

我发现我不能在6to4隧道(在tun6to4)上运行本地IPV6接口(在eth0上)。

这是我的设置(/ 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 

当我ping6 -I eth0 google.com – 我得到:

 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 

我运行这个之后:

 /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 

我在IPV6接口上ping了100%的数据包丢失(虽然有时只有很less数据包到达谷歌的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 

我在/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 

似乎各种不同的路线使这种情况发生,没有一个工作正确。 我该如何解决? 请帮忙。 运行Debian 7 Wheezy。

编辑:我find了一个简单的解决scheme6to4:/ etc / network / interfaces /

 auto 6to4 iface 6to4 inet6 6to4 local 57.164.25.173 ifup 6to4 

在ifup 6to4在控制台后,我运行这个:

 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 

之后,本机和6to4 ipv6接口终于可以ping6 google.com …

但是..看起来不是结束。 我在任何一个ipv6接口上都有一点点的丢包率(从一些尝试中的0到3-5甚至10-12%)。 在一些ping6的testing中,运行起来非常顺利,没有任何错误,但是有时我从10-11个丢包中得到了1个。 我知道我的6to4性能很大程度上依赖于Internet上的多个公共6to4中继,用于任播地址,所以几乎不可能找出哪个中继可能会导致丢包。而且,这可能是更好的方式来切换隧道代理。 但是我也知道,有人同时使用ipv6隧道代理和6to4接口,甚至有更多的COMPLEX设置与各种附加设备。

似乎linuxnetworking路由是非常重要的这样的设置,我有点儿新手。

顺便说一句:我也发现了

 Interrupt:20 Memory:fe500000-fe520000 

在eth0中,当我在控制台中运行ifconfig。

我只是希望能够解决这个问题还有很多事情要做,比如:

  • 改变TTL;
  • 为eth0 ipv6接口添加路由表
  • 运行ndppd;

和/或“小”更多?

我真的很感激任何帮助。

PART2结束。 未完待续

尝试使用6in4隧道代理来获得IPv6连接。 这是更可靠的,将在这种情况下工作。 我知道的经纪人提供免费的隧道。

升级是快速和相对无痛的。 多年来,我一直在eth0上使用6in4和IPv6。