IPv6 6to4 基本实验
 Ipv6ip 6to4 GRE他实现了动态的隧道绑定,不用像点到点那样,每条路径都需要去手工绑定,它只要做好tunnel source的端口就好,目的端口不需要指定,他根据ipv6地址中第2、3段组成(每段16位 2段32位正好能表示IPv4地址),而第一段要以2002开始,所以6to4的隧道地址的格式必需是2002:xxxx:xxxx::0/48,虽然有一定的限制,但是它能够满足的地址数量还是非常庞大的。各个小的IPv6域通过tunnel接口虚拟的链接,就像是拉了专线一样,具体的我做了个小实验,下面我把这次的小实验分享一下。
 

 
1)R1、R2、R3相当于3台与外网连接的路由器,他们内部都是IPv6域,所以要实现内部地址之间的通信就要用一些技术,我选择了6to4的隧道技术
2)Ipv4域中,通过ospf保证之间的连通性,由于我是通过lookback口建立的隧道,因为该接口不会down掉,能够保持tunnel的稳定性,(大家也可以参考下BGP中IBGP邻居建立的原理)
3)路由器要保证开启了ipv6的转发功能。
4) 一定要跟 ipv6 地址做好映射,形成该 ipv6 网络的 /48 的前缀,这是 6to4 能否成功的关键!
 
配置过程:
先说下配置顺序思路:
1)配置好地址,测试其连通性(各个接口包括lookback的ip 地址)
2)配置好tunnel口。
3)在R1、R2、R3上配置IPv6的默认路由,好给自己旗下的那几个孩子通告前进的方向(R4、R5、R6)
4)先配置v4的ospf,在配置v6的ospf 在v6中重分布下静态,以告知默认路由。
配置命令:
R1
interface Loopback0
 ip address 14.1.1.1 255.255.255.255
!
interface Tunnel0
 no ip address
 no ip redirects(关闭ICMP重定向)
 ipv6 unnumbered FastEthernet0/0 (借f0/0口地址)
 tunnel source Loopback0
 tunnel mode ipv6ip 6to4
!
interface FastEthernet0/0
 no ip address
 ipv6 address 2002:E01:101:1::2/64 (隐含ipv4地址 14.1.1.1)
 ipv6 ospf 10 area 0
!
interface FastEthernet0/1
 ip address 12.12.12.1 255.255.255.0
!
interface FastEthernet1/0
 ip address 13.13.13.1 255.255.255.0
 !
router ospf 10
 router-id 1.1.1.1
 network 12.12.12.1 0.0.0.0 area 0
 network 13.13.13.1 0.0.0.0 area 0
 network 14.1.1.1 0.0.0.0 area 0
!
ipv6 route 2002::/16 Tunnel0
ipv6 router ospf 10
 router-id 1.1.1.1
 log-adjacency-changes (ospf系统日志反馈)
 redistribute static
R2
interface Loopback0
 ip address 25.1.1.1 255.255.255.255
!
interface Tunnel0
 no ip address
 no ip redirects
 ipv6 unnumbered FastEthernet0/0
 no ipv6 redirects
 tunnel source Loopback0
 tunnel mode ipv6ip 6to4
!         
interface FastEthernet0/0
 no ip address
 ipv6 address 2002:1901:101:1::2/64
 ipv6 ospf 10 area 0
!
interface FastEthernet0/1
 ip address 12.12.12.2 255.255.255.0
!
interface FastEthernet1/0
 ip address 23.23.23.2 255.255.255.0
!
router ospf 10
 router-id 2.2.2.2
 log-adjacency-changes
 network 12.12.12.2 0.0.0.0 area 0
 network 23.23.23.2 0.0.0.0 area 0
 network 25.1.1.1 0.0.0.0 area 0
!          
ipv6 route 2002::/16 Tunnel0
ipv6 router ospf 10
 router-id 2.2.2.2
 log-adjacency-changes
 redistribute static
R3
interface Loopback0
 ip address 36.1.1.1 255.255.255.255
!
interface Tunnel0
 no ip address
 no ip redirects
 ipv6 unnumbered FastEthernet0/0
 tunnel source Loopback0
 tunnel mode ipv6ip 6to4
!
interface FastEthernet0/0
 no ip address
 ipv6 address 2002:2401:101:1::2/64
 ipv6 ospf 10 area 0
!
interface FastEthernet0/1
 ip address 13.13.13.3 255.255.255.0
!
interface FastEthernet1/0
 ip address 23.23.23.3 255.255.255.0
 !
router ospf 10
 router-id 3.3.3.3
 log-adjacency-changes
 network 13.13.13.3 0.0.0.0 area 0
 network 23.23.23.3 0.0.0.0 area 0
 network 36.1.1.1 0.0.0.0 area 0
!
ipv6 route 2002::/16 Tunnel0
ipv6 router ospf 10
 router-id 3.3.3.3
 log-adjacency-changes
 redistribute static
R4
interface FastEthernet0/0
 no ip address
 ipv6 address 2002:E01:101:1::1/64
 ipv6 ospf 10 area 0
!
ipv6 router ospf 10
 router-id 4.4.4.4
 log-adjacency-changes
R5
interface FastEthernet0/0
 no ip address
 ipv6 address 2002:1901:101:1::1/64
 ipv6 ospf 10 area 0
!
ipv6 router ospf 10
 router-id 5.5.5.5
 log-adjacency-changes
 
R6
interface FastEthernet0/0
 no ip address
 ipv6 address 2002:2401:101:1::1/64
 ipv6 ospf 10 area 0
!
ipv6 router ospf 10
 router-id 6.6.6.6
 log-adjacency-changes
 
测试结果
 

 
抓包截图:
 

 

 希望这个实验能够给同学一些的帮助,那我就满足了!这是我第一次这这种东西,可能写的不是很好!希望大家多多见谅!