6to4隧道
6to4隧道
6rd隧道測(cè)試:https://blog.csdn.net/zdl244/article/details/103280256
6to4隧道定義了一個(gè)網(wǎng)絡(luò)前綴2002::/16用于表達(dá)這是一個(gè)6to4網(wǎng)絡(luò)整體,
地址格式2002:a.b.c.d:xxxx:xxxx:xxxx:xxxx:xxxx,(a.b.c.d是IPv4地址)
???????任何一個(gè)公共IPv4地址將地址的十六進(jìn)制值加在6to4網(wǎng)絡(luò)前綴之后,從而產(chǎn)生一個(gè)前綴數(shù)為48的相應(yīng)IPv4的6to4子網(wǎng)的網(wǎng)絡(luò)前綴,而且其仍然可以繼續(xù)分割至最小前綴數(shù)為64的子網(wǎng)段用于區(qū)分出這個(gè)6to4子網(wǎng)的子網(wǎng)。
測(cè)試環(huán)境
使用兩臺(tái)Centos主機(jī)ipv4地址是192.168.1.107和192.168.2.108充當(dāng)路由器,實(shí)現(xiàn)6to4隧道,前綴是2002::/16
拓?fù)鋱D:
主機(jī)A(192.168.1.107)--------路由器---------主機(jī)B(192.168.2.108)
192.168.1.107配置:
[root@RA ~]# ip tunnel add 6to4 mode sit remote any local 192.168.1.107 [root@RA ~]# ip -6 addr add 2002:c0a8:016b:2019::1/64 dev 6to4 #配置隧道接口地址,192.168.1.107轉(zhuǎn)換成16進(jìn)制是"c0a8:016b" [root@RA ~]# ip link set 6to4 up [root@RA ~]# route -6 add 2002:c0a8:026c::/48 dev 6to4 #將對(duì)端2002:c0a8:026c::/48的路由指向隧道接口192.168.2.108配置:
[root@RB ~]# ip tunnel add 6to4 mode sit remote any local 192.168.2.108 [root@RB ~]# ip -6 addr add 2002:c0a8:026c:2019::1/64 dev 6to4 [root@RB ~]# ip link set 6to4 up [root@RB ~]# route -6 add 2002:c0a8:016b::/48 dev 6to4在主機(jī)A測(cè)試ping6主機(jī)B可達(dá)。
[root@RA ~]# ping6 2002:c0a8:026c:2019::1 PING 2002:c0a8:026c:2019::1(2002:c0a8:26c:2019::1) 56 data bytes 64 bytes from 2002:c0a8:26c:2019::1: icmp_seq=1 ttl=64 time=0.551 ms 64 bytes from 2002:c0a8:26c:2019::1: icmp_seq=2 ttl=64 time=0.669 ms 64 bytes from 2002:c0a8:26c:2019::1: icmp_seq=3 ttl=64 time=0.563 ms 64 bytes from 2002:c0a8:26c:2019::1: icmp_seq=4 ttl=64 time=0.590 ms ^C --- 2002:c0a8:026c:2019::1 ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 3000ms rtt min/avg/max/mdev = 0.551/0.593/0.669/0.049 ms增加lo接口地址測(cè)試:
[root@RA ~]# ip -6 addr add 2002:c0a8:016b:2018::1/64 dev lo [root@RA ~]# ping6 -I 2002:c0a8:016b:2018::1 2002:c0a8:026c:2019::1 PING 2002:c0a8:026c:2019::1(2002:c0a8:26c:2019::1) from 2002:c0a8:16b:2018::1 : 56 data bytes 64 bytes from 2002:c0a8:26c:2019::1: icmp_seq=1 ttl=64 time=0.644 ms 64 bytes from 2002:c0a8:26c:2019::1: icmp_seq=2 ttl=64 time=0.600 ms 64 bytes from 2002:c0a8:26c:2019::1: icmp_seq=3 ttl=64 time=0.638 ms 64 bytes from 2002:c0a8:26c:2019::1: icmp_seq=4 ttl=64 time=0.560 ms ^C --- 2002:c0a8:026c:2019::1 ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 3002ms rtt min/avg/max/mdev = 0.560/0.610/0.644/0.041 ms總結(jié)
- 上一篇: windows10应用商店下安装kali
- 下一篇: 视觉在无人驾驶中的应用及分类_机器视觉在