IPV6综合大实验

R1中既有IPV4也有IPV6。要求
1、两个黑框中局域网通过6to4tunnel可达
2、R1可访问R3环回
1、配ip及环回2、R1为isp,在r2上写一条缺省指向r1,且下放缺省ip route-static 0.0.0.0  0.0.0.0  192.168.1.1[R2]rip 1[R2-rip-1]def

一、先配IPV4部分

1、R2\3\4 IP 配完后 R2\4写一条缺省指向R3 使IPV4公网通

[r2]int g0/0/1
[r2-GigabitEthernet0/0/1]ip address 23.1.1.1 24
[r2]ip route-static 0.0.0.0 0 23.1.1.2

 [r3]interface g0/0/0
[r3-GigabitEthernet0/0/0]ip add 23.1.1.2 24
[r3-GigabitEthernet0/0/0]int g0/0/1
[r3-GigabitEthernet0/0/1]ip address 34.1.1.1 24
[r3]int lo 0
[r3-LoopBack0]ip add 3.3.3.3 2
 
 [r4]int g0/0/0
[r4-GigabitEthernet0/0/0]ip add 34.1.1.2 24 
[r4]ip route-static 0.0.0.0 0 34.1.1.1

1、配ip及环回2、R1为isp,在r2上写一条缺省指向r1,且下放缺省ip route-static 0.0.0.0  0.0.0.0  192.168.1.1[R2]rip 1[R2-rip-1]def
1、配ip及环回2、R1为isp,在r2上写一条缺省指向r1,且下放缺省ip route-static 0.0.0.0  0.0.0.0  192.168.1.1[R2]rip 1[R2-rip-1]def
2、私网访公网

[r1]ip route-static 0.0.0.0 0 192.168.1.2----静态缺省让路由出
[r1]int g0/0/1
[r1-GigabitEthernet0/0/1]ip add 192.168.1.1 24 
[r2]interface g0/0/0
[r2-GigabitEthernet0/0/0]ip add 192.168.1.2 24 
[r2-GigabitEthernet0/0/0]q
[r2]acl 2000
[r2-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[r2-acl-basic-2000]q
[r2]int g0/0/1 ------进接口
[r2-GigabitEthernet0/0/1]nat outbound 2000----NAT让局域网可访广域网

1、配ip及环回2、R1为isp,在r2上写一条缺省指向r1,且下放缺省ip route-static 0.0.0.0  0.0.0.0  192.168.1.1[R2]rip 1[R2-rip-1]def

二、IPV6部分

1、由V4地址23.1.1.1 换算成IPV6地址2002:1701:0101::/48
化为两个环回
1、配ip及环回2、R1为isp,在r2上写一条缺省指向r1,且下放缺省ip route-static 0.0.0.0  0.0.0.0  192.168.1.1[R2]rip 1[R2-rip-1]def

[r1]ipv6----**首先在设备上开启协议**
[r1]int lo 0 
[r1-LoopBack0]ipv6 enable ---**再在接口上激活IPV6服务,才能配置ipv6地址** 
[r1-LoopBack0]ipv6 address 2002:1701:0101::1/65
[r1-LoopBack0]int lo 1 
[r1-LoopBack1]ipv6 enable 
[r1-LoopBack1]ipv6 address 2002:1701:0101:0:8000::1/65
接口
[r1]int g0/0/1 
[r1-GigabitEthernet0/0/1]ipv6 enable 
[r1-GigabitEthernet0/0/1]ipv6 address 2002:1701:0101:1::1/64    同一网段的两个地址
[r2]ipv6
[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]ipv6 enable 
[r2-GigabitEthernet0/0/0]ipv6 address 2002:1701:0101:1::2/64
R2环回
[r2-GigabitEthernet0/0/0]int lo 0 
[r2-LoopBack0]ipv6 enable 
[r2-LoopBack0]ipv6 address 2002:1701:0101:2::1/64

2、RIPNG

[r1]ripng 1
[r1]int lo 0 
[r1-LoopBack0]ripng 1 enable 
[r1]int lo 1 
[r1-LoopBack1]ripng 1 enable 
[r1]int g0/0/1 
[r1-GigabitEthernet0/0/1]ripng 1 enable
[r2]ripng 1
[r2]int lo 0 
[r2-LoopBack0]ripng 1 enable 
[r2-LoopBack0]int g0/0/0 
[r2-GigabitEthernet0/0/0]ripng 1 enable 
查询是否学到各自环回
[r1]display ipv6 routing-table protocol ripng

1、配ip及环回2、R1为isp,在r2上写一条缺省指向r1,且下放缺省ip route-static 0.0.0.0  0.0.0.0  192.168.1.1[R2]rip 1[R2-rip-1]def
1、配ip及环回2、R1为isp,在r2上写一条缺省指向r1,且下放缺省ip route-static 0.0.0.0  0.0.0.0  192.168.1.1[R2]rip 1[R2-rip-1]def
将R1上的两个环回汇总
Rip的汇总是在更新源发出的设备的接口上进行

[r1]int g0/0/1
[r1-GigabitEthernet0/0/1]ripng summary-address 2002:1701:0101:: 64

1、配ip及环回2、R1为isp,在r2上写一条缺省指向r1,且下放缺省ip route-static 0.0.0.0  0.0.0.0  192.168.1.1[R2]rip 1[R2-rip-1]def
至此R1\2可通

三、6to4tunnel

左边:

[r2]int Tunnel 0/0/0
[r2-Tunnel0/0/0]tunnel-protocol ipv6-ipv4 6to4
[r2-Tunnel0/0/0]ipv6 enable 
[r2-Tunnel0/0/0]ipv6 add 2002:1701:101:3::1/64
[r2-Tunnel0/0/0]source 23.1.1.1
[r2]ipv6 route-static 2002:: 16 Tunnel 0/0/0-----只要是2002::/16的路由条目均走tunnel0/0/0
注:2002::/16-----------6to4  tunnel 专用地址
[r2]ripng 1------将R2上的tunnel地址重发布到ripng中 
[r2-ripng-1]import-route static

1、配ip及环回2、R1为isp,在r2上写一条缺省指向r1,且下放缺省ip route-static 0.0.0.0  0.0.0.0  192.168.1.1[R2]rip 1[R2-rip-1]def
右边:
1、IPV6地址由IPV4地址34.1.1.2换算得来
1、配ip及环回2、R1为isp,在r2上写一条缺省指向r1,且下放缺省ip route-static 0.0.0.0  0.0.0.0  192.168.1.1[R2]rip 1[R2-rip-1]def

[r4]ipv6
[r4]int lo 0
[r4-LoopBack0]ipv6 enable 
[r4-LoopBack0]ipv6 add 2002:2201:0102::1/64
[r4-LoopBack0]int g0/0/1
[r4-GigabitEthernet0/0/1]ipv6 enable 
[r4-GigabitEthernet0/0/1]ipv6 address 2002:2201:0102:1::1/64

[r5-GigabitEthernet0/0/0]ipv6 address 2002:2201:0102:1::2/64 
[r5-LoopBack0]ipv6 address 2002:2201:0102:8000::1/64
[r5-GigabitEthernet0/0/1]ipv6 address 2002:2201:0102:8001::1/64

[r6-GigabitEthernet0/0/0] ipv6 address 2002:2201:0102:8001::2/64
[r6-LoopBack0]ipv6 address 2002:2201:0102:8002::1/64
[r6-GigabitEthernet0/0/1]ipv6 address 2002:2201:0102:8003::1/64

[r7-GigabitEthernet0/0/0]ipv6 address 2002:2201:0102:8003::2/64
[r7-LoopBack0]ipv6 address 2002:2201:0102:8004::1/64
[r7-GigabitEthernet0/0/1]ipv6 address 2002:2201:0102:8005::1/64

[r8-GigabitEthernet0/0/0]ipv6 address 2002:2201:0102:8005::2/64
[r8-LoopBack0]ipv6 address  2002:2201:0102:8006::1/64

2、AS2起ospfv3

[r5]osp
fv3 1-------在原有OSPFV2的基础上,使用新的LSA来专门携带V6的信息 
[r5-ospfv3-1]router-id 5.5.5.5 
[r5-ospfv3-1]int lo 0 
[r5-LoopBack0]ospfv3 1 area 0
[r5-LoopBack0]int g0/0/1
[r5-GigabitEthernet0/0/1]ospfv3 1 area 0
R6\7\8同理------域内每个路由的环回接口均需配置
查看ospfv3邻居 R5\6\7\8\

1、配ip及环回2、R1为isp,在r2上写一条缺省指向r1,且下放缺省ip route-static 0.0.0.0  0.0.0.0  192.168.1.1[R2]rip 1[R2-rip-1]def
1、配ip及环回2、R1为isp,在r2上写一条缺省指向r1,且下放缺省ip route-static 0.0.0.0  0.0.0.0  192.168.1.1[R2]rip 1[R2-rip-1]def
至此R5\6\7\8ospf可通
3、起BGP------使R4的路由可以往右边去

[r4]bgp 1 
[r4-bgp]router-id 4.4.4.4 --------IPV4关系
[r4-bgp]peer 2002:2201:102:1::2 as-number 2- 
[r4-bgp]ipv6-family ---------IPV6关系
[r4-bgp-af-ipv6]peer 2002:2201:102:1::2 enable
[r5]bgp 64512 
[r5-bgp]router-id 5.5.5.5
[r5-bgp]confederation id 2
[r5-bgp]peer 2002:2201:102:1::1 as-number 1 
[r5-bgp]ipv6-family 
[r5-bgp-af-ipv6]peer 2002:2201:102:1::1 enable

由于IPV6地址较长,比较繁琐,可以利用IPV6多宿主特点进行配置
在R5\6\7\8原有基础上再在环回上加一个ip地址,以便后面BGP建邻方便

[r5]int lo 0
[r5-LoopBack0]ipv6 address 5::5/64----R6\7\8同理

同时通过[r5]dis ipv6 routing-table protocol ospfv3可查到通过ospfv3学到这些ip地址
此处以R5、R7(EBGP)举例

[r5]bgp 64512 
[r5-bgp]router-id 5.5.5.5
[r5-bgp]confederation id 2
[r5-bgp]peer 6::6 as-number 64512 
[r5-bgp]peer 6::6 connect-interface lo 0  5::5
[r5-bgp]ipv6-family  
[r5-bgp-af-ipv6]peer 6::6 enable

1、配ip及环回2、R1为isp,在r2上写一条缺省指向r1,且下放缺省ip route-static 0.0.0.0  0.0.0.0  192.168.1.1[R2]rip 1[R2-rip-1]def

[r7]bgp 64512 
[r7-bgp]router-id 7.7.7.7
[r7-bgp]confederation id 2----前面正常起联邦
[r7-bgp]peer 6::6 as-number 64512 
[r7-bgp]peer 6::6 connect-interface lo 0  7::7
[r7-bgp]peer 8::8 as-number 64513 
[r7-bgp]peer 8::8 connect-interface lo 0  7::7
[r7-bgp]peer 8::8 ebgp-max-hop 2
[r7-bgp]ipv6-family 
[r7-bgp-af-ipv6]peer 6::6 enable  
[r7-bgp-af-ipv6]pee 8::8 enable 

1、配ip及环回2、R1为isp,在r2上写一条缺省指向r1,且下放缺省ip route-static 0.0.0.0  0.0.0.0  192.168.1.1[R2]rip 1[R2-rip-1]def
4、右边起tunnel

[r4]int Tunnel 0/0/0
[r4-Tunnel0/0/0]tunnel-protocol ipv6 6to4 
[r4-Tunnel0/0/0]ipv6 enable 
[r4-Tunnel0/0/0]ipv6 address  2002:2201:0102:2::1/64 
[r4-Tunnel0/0/0]source 34.1.1.2
[r4]ipv6 route-static 2002:: 16 Tunnel 0/0/0
[r4]bgp 1
[r4-bgp]ipv6-family .
[r4-bgp-af-ipv6]network 2002:: 16----将tunnel宣告到右边区域传给R5\6\7\8

由于R4\R5为EBGP关系,因此R4传给R5时R5学到的此条目为优,但R5\R6为IBGP,只能传一跳,此时需要在EBGPR5上改下一跳属性,使R6学到此路由条目为优

[r5]bgp 64512
[r5-bgp]ipv6-family 
[r5-bgp-af-ipv6]peer 6::6 next-hop-local

1、配ip及环回2、R1为isp,在r2上写一条缺省指向r1,且下放缺省ip route-static 0.0.0.0  0.0.0.0  192.168.1.1[R2]rip 1[R2-rip-1]def
同时由于IBGP之间存在水平分割导致R6传给R7的路由条目不优,因此需要在R6做路由反射器使R7学到路由条目也为优
[r6]bgp 64512
[r6-bgp]ipv6-family
[r6-bgp-af-ipv6]peer 7::7 reflect-client----R6为RR,R7为客户
1、配ip及环回2、R1为isp,在r2上写一条缺省指向r1,且下放缺省ip route-static 0.0.0.0  0.0.0.0  192.168.1.1[R2]rip 1[R2-rip-1]def
1、配ip及环回2、R1为isp,在r2上写一条缺省指向r1,且下放缺省ip route-static 0.0.0.0  0.0.0.0  192.168.1.1[R2]rip 1[R2-rip-1]def
5、在R5上汇总AS2

[r5]ipv6 route-static 2002:2201:0102:8000:: 49 null 0
[r5]bgp 64512
[r5-bgp]ipv6-family  
[r5-bgp-af-ipv6]network 2002:2201:0102:8000:: 49---将汇总宣告,则右边区域都会学到,此时

1、配ip及环回2、R1为isp,在r2上写一条缺省指向r1,且下放缺省ip route-static 0.0.0.0  0.0.0.0  192.168.1.1[R2]rip 1[R2-rip-1]def
IPV6层面- 举两例
j-ping R8环回
1、配ip及环回2、R1为isp,在r2上写一条缺省指向r1,且下放缺省ip route-static 0.0.0.0  0.0.0.0  192.168.1.1[R2]rip 1[R2-rip-1]def
Ping R6环回
1、配ip及环回2、R1为isp,在r2上写一条缺省指向r1,且下放缺省ip route-static 0.0.0.0  0.0.0.0  192.168.1.1[R2]rip 1[R2-rip-1]def

版权声明:本文为Alkaid__3原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/Alkaid__3/article/details/104050036