使用ifconfig:
eth0 link encap:Ethernet HWaddr 00:16:3E:12:77:54 inet addr:208.111.39.160 Bcast:208.111.39.255 Mask:255.255.255.0 inet6 addr: 2607:f740:0:3f::eda/64 Scope:Global inet6 addr: fe80::216:3eff:fe12:7754/64 Scope:link UP broADCAST RUNNING MulTICAST MTU:1500 Metric:1 RX packets:65590 errors:0 dropped:499 overruns:0 frame:0 TX packets:40111 errors:0 dropped:0 overruns:0 carrIEr:0 collisions:0 txqueuelen:1000 RX bytes:13246038 (12.6 MiB) TX bytes:28807669 (27.4 MiB) Interrupt:29 lo link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrIEr:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)tun0 link encap:Unspec HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 inet addr:10.8.0.1 P-t-P:10.8.0.2 Mask:255.255.255.255 inet6 addr: 2607:f740:44:22::8/64 Scope:Global UP POINtopOINT RUNNING NOARP MulTICAST MTU:1500 Metric:1 RX packets:16876 errors:0 dropped:0 overruns:0 frame:0 TX packets:16504 errors:0 dropped:0 overruns:0 carrIEr:0 collisions:0 txqueuelen:100 RX bytes:2235766 (2.1 MiB) TX bytes:7680377 (7.3 MiB)
我已启用转发:
[root@baobei ~]# sysctl net.ipv6.conf.all.forwardingnet.ipv6.conf.all.forwarding = 1
防火墙:
ip6tables -F inputip6tables -F FORWARDip6tables -F OUTPUTip6tables -F ip6tables -P input ACCEPTip6tables -P FORWARD ACCEPTip6tables -P OUTPUT ACCEPTecho -n "1" >/proc/sys/net/ipv6/conf/all/forwardingecho -n "1" >/proc/sys/net/ipv6/conf/all/proxy_ndpecho -n "0" >/proc/sys/net/ipv6/conf/all/autoconfecho -n "0" >/proc/sys/net/ipv6/conf/all/accept_raip6tables -A input -p icmpv6 -j ACCEPTip6tables -A FORWARD -m state --state NEW -i tun0 -o eth0 -s 2607:f740:44:22::/64 -j ACCEPTip6tables -A FORWARD -m state --state ESTABliSHED,RELATED -j ACCEPT
路线:
unreachable ::/96 dev lo metric 1024 error -101unreachable ::ffff:0.0.0.0/96 dev lo metric 1024 error -101unreachable 2002:a00::/24 dev lo metric 1024 error -101unreachable 2002:7f00::/24 dev lo metric 1024 error -101unreachable 2002:a9fe::/32 dev lo metric 1024 error -101unreachable 2002:ac10::/28 dev lo metric 1024 error -101unreachable 2002:c0a8::/32 dev lo metric 1024 error -101unreachable 2002:e000::/19 dev lo metric 1024 error -1012607:f740:0:3f::/64 dev eth0 proto kernel metric 256 2607:f740:44:22::/64 dev tun0 proto kernel metric 256 unreachable 3ffe:ffff::/32 dev lo metric 1024 error -101fe80::/64 dev eth0 proto kernel metric 256 fe80::/64 dev tun0 proto kernel metric 256 default via 2607:f740:0:3f::1 dev eth0 metric 1
但是,到达tun0接口的ipv6数据包不会路由到eth0接口.感谢您的帮助,建议.
解决方法 这是一个简单的路由问题.您的路由表没有任何通过tun0接口引导流量的路由,因此不会以任何方式转发.我知道你正在使用OpenVPN.据我所知,对OpenVPN的IPv6支持不包括与redirect-gateway选项相当的IPv6.您可能需要使用从服务器推送的route-ipv6语句添加自己的路由.
总结以上是内存溢出为你收集整理的linux – 转发IPv6流量全部内容,希望文章能够帮你解决linux – 转发IPv6流量所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)