目录
一、IP规划
二、 连通公网部分(IPv4)
三、R1、R2上IPv4+v6配置
四、IPV6部分ip配置
五、IPV6部分OSPF&BGP协议配置
Ⅰ、 ospf
Ⅱ、bgp
六、联通网络
需求:
1、AR1处于IPV4,也有IPV6的地址,有两个环回
2、AR45678处于IPV6,用到BGP联邦,OSPFV3,最后在公网6to4全通
IPV4部分
AR12 192.168.0.0 24
AR1环回 192.168.1.0 24
AR2环回 192.168.2.0 24
AR23 23.1.1.0 24
AR34 34.1.1.0 24
AR3环回 3.3.3.0 24
IPV6部分
由于6to4
所以2后边的ip由23.1.1.1算出来
2002:1701:0101:: /48
4后边的ip由34.1.1.2算出来
2002:2201:0102:: /48
AS1
2002:2201:0102::
AS2
2002:2201:0102:8000::49
骨干
2002:2201:0102:0045:: /64
2002:2201:0102:8056:: /64
2002:2201:0102:8067:: /64
2002:2201:0102:8078:: /64
环回
AR4 4::4 2002:2201:0102:8004:: /64
AR5 5::5 2002:2201:0102:8005:: /64
AR6 6::6 2002:2201:0102:8006:: /64
AR7 7::7 2002:2201:0102:8007:: /64
AR8 8::8 2002:2201:0102:8008:: /64
[Huawei]sysname r2
[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]ip address 23.1.1.1 24
[r2-GigabitEthernet0/0/0]q
[r2]ip route-static 0.0.0.0 0 23.1.1.2
[Huawei]sysname isp
[isp]int g0/0/1
[isp-GigabitEthernet0/0/1]ip address 23.1.1.2 24
[isp-GigabitEthernet0/0/1]int g0/0/0
[isp-GigabitEthernet0/0/0]ip address 34.1.1.1 24
[Huawei]sysname r4
[r4]int g0/0/1
[r4-GigabitEthernet0/0/1]ip address 34.1.1.2 24
[r4-GigabitEthernet0/0/1]q
[r4]ip route-static 0.0.0.0 0 34.1.1.1
#
rip 1
version 2
network 192.168.0.0
network 192.168.1.0
#
[r1]ipv6
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ipv6 enable
[r1-GigabitEthernet0/0/0]ipv6 address 2002:1701:0101:0012::1 64
[r1-LoopBack0]ipv6 enable
[r1-LoopBack0]ipv6 address 2002:1701:0101:8001::1 64
[r1-LoopBack0]ripng 1
[r1-ripng-1]q
[r1]int lo0
[r1-LoopBack0]ripng 1 enable
[r1-LoopBack0]int g0/0/0
[r1-GigabitEthernet0/0/0]ripng 1 enable
#
rip 1
default-route originate
version 2
network 192.168.2.0
network 192.168.0.0
#
[r2]ipv6
[r2]int g0/0/1
[r2-GigabitEthernet0/0/1]ipv6 enable
[r2-GigabitEthernet0/0/1]ipv6 address 2002:1701:0101:0012::2 64
[r2-GigabitEthernet0/0/1]ripng 1
[r2-ripng-1]q
[r2]int lo0
[r2-LoopBack0]ripng 1 enable
[r2-LoopBack0]int g0/0/1
[r2-GigabitEthernet0/0/1]ripng 1 enable
[r2-GigabitEthernet0/0/1]ripng default-route only
#
[r4]ipv6
[r4]int g0/0/0
[r4-GigabitEthernet0/0/0]ipv6 enable
[r4-GigabitEthernet0/0/0]ipv6 address 2002:2201:0102:0045::1 64
[r4-GigabitEthernet0/0/0]int lo0
[r4-LoopBack0]ipv6 enable
[r4-LoopBack0]ipv6 address 2002:2201:0102:4::1 64
#
#
[r5]ipv6
[r5]int g0/0/1
[r5-GigabitEthernet0/0/1]ipv6 enable
[r5-GigabitEthernet0/0/1]ipv6 address 2002:2201:0102:0045::2 64
[r5-GigabitEthernet0/0/1]int g0/0/0
[r5-GigabitEthernet0/0/0]ipv6 enable
[r5-GigabitEthernet0/0/0]ipv6 address 2002:2201:0102:8056::1 64
[r5-GigabitEthernet0/0/0]int lo0
[r5-LoopBack0]ipv6 enable
[r5-LoopBack0]ipv6 address 2002:2201:0102:8005::1 64
[r5-LoopBack0]ipv6 address 5::5 64
#
#
[r6]ipv6
[r6]int g0/0/1
[r6-GigabitEthernet0/0/1]ipv6 enable
[r6-GigabitEthernet0/0/1]ipv6 address 2002:2201:0102:8056::2 64
[r6-GigabitEthernet0/0/1]int g0/0/0
[r6-GigabitEthernet0/0/0]ipv6 enable
[r6-GigabitEthernet0/0/0]ipv6 address 2002:2201:0102:8067::1 64
[r6-GigabitEthernet0/0/0]int lo0
[r6-LoopBack0]ipv6 enable
[r6-LoopBack0]ipv6 address 2002:2201:0102:8006::1 64
[r6-LoopBack0]ipv6 address 6::6 64
#
#
[r7]ipv6
[r7]int g0/0/1
[r7-GigabitEthernet0/0/1]ipv6 enable
[r7-GigabitEthernet0/0/1]ipv6 address 2002:2201:0102:8067::2 64
[r7-GigabitEthernet0/0/1]int g0/0/0
[r7-GigabitEthernet0/0/0]ipv6 enable
[r7-GigabitEthernet0/0/0]ipv6 address 2002:2201:0102:8078::1 64
[r7-GigabitEthernet0/0/0]int lo0
[r7-LoopBack0]ipv6 enable
[r7-LoopBack0]ipv6 address 2002:2201:0102:8007::1 64
[r7-LoopBack0]ipv6 address 7::7 64
#
#
[r8]ipv6
[r8]int g0/0/1
[r8-GigabitEthernet0/0/1]ipv6 enable
[r8-GigabitEthernet0/0/1]ipv6 address 2002:2201:0102:8078::2 64
[r8-GigabitEthernet0/0/1]int lo0
[r8-LoopBack0]ipv6 enable
[r8-LoopBack0]ipv6 address 2002:2201:0102:8008::1 64
[r8-LoopBack0]ipv6 address 8::8 64
#
//AS2区域用OSPFV3实现通讯
#
[r5]ospfv3
[r5-ospfv3-1]router-id 5.5.5.5
[r5-ospfv3-1]int g0/0/0
[r5-GigabitEthernet0/0/0]ospfv3 1 area 0
[r5-GigabitEthernet0/0/0]int lo0
[r5-LoopBack0]ospfv3 1 area 0
#
[r6]ospfv3
[r6-ospfv3-1]router-id 6.6.6.6
[r6-ospfv3-1]int g0/0/1
[r6-GigabitEthernet0/0/1]ospfv3 1 area 0
[r6-GigabitEthernet0/0/1]int g0/0/0
[r6-GigabitEthernet0/0/1]ospfv3 1 area 0
[r6-GigabitEthernet0/0/1]int lo0
[r6-LoopBack0]ospfv3 1 area 0
#
[r7]ospfv3
[r7-ospfv3-1]router-id 7.7.7.7
[r7-ospfv3-1]int g0/0/1
[r7-GigabitEthernet0/0/1]ospfv3 1 area 0
[r7-GigabitEthernet0/0/1]int g0/0/0
[r7-GigabitEthernet0/0/0]ospfv3 1 area 0
[r7-GigabitEthernet0/0/0]int lo0
[r7-LoopBack0]ospfv3 1 area 0
#
[r8]ospfv3
[r8-ospfv3-1]router-id 8.8.8.8
[r8-ospfv3-1]int g0/0/1
[r8-GigabitEthernet0/0/1]ospfv3 1 area 0
[r8-GigabitEthernet0/0/1]int lo0
[r8-LoopBack0]ospfv3 1 area 0
#
【验证】
【display ospfv3 peer】
【display ipv6 routing-table protocol ospfv3】
看看R8是否能ping通R5的一个环回
[r4]bgp 1
[r4-bgp]router-id 4.4.4.4
[r4-bgp]peer 2002:2201:0102:0045::2 as-number 2
[r4-bgp]ipv6-family
[r4-bgp-af-ipv6]peer 2002:2201:0102:0045::2 enable
[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 LoopBack0 5::5
[r5-bgp]peer 2002:2201:102:45::1 as-number 1
[r5-bgp]ipv6-family
[r5-bgp-af-ipv6]peer 6::6 enable
[r5-bgp-af-ipv6]peer 2002:2201:102:45::1 enable
[r6]bgp 64512
[r6-bgp]router-id 6.6.6.6
[r6-bgp]confederation id 2
[r6-bgp]peer 5::5 as-number 64512
[r6-bgp]peer 5::5 connect-interface LoopBack 0 6::6
[r6-bgp]peer 7::7 as-number 64512
[r6-bgp]peer 7::7 connect-interface LoopBack 0 6::6
[r6-bgp]ipv6-family
[r6-bgp-af-ipv6]peer 5::5 enable
[r6-bgp-af-ipv6]peer 7::7 enable
[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 LoopBack 0 7::7
[r7-bgp]confederation peer-as 64513
[r7-bgp]peer 8::8 as-number 64513
[r7-bgp]peer 8::8 connect-interface LoopBack 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]peer 8::8 enable
[r8]bgp 64513
[r8-bgp]confederation id 2
[r8-bgp]confederation peer-as 64512
[r8-bgp]peer 7::7 as-number 64512
[r8-bgp]peer 7::7 connect-interface LoopBack 0 8::8
[r8-bgp]peer 7::7 ebgp-max-hop 2
[r8-bgp]ipv6-family
[r8-bgp-af-ipv6]peer 7::7 enable
【验证:都看看bgp邻居建好了没】
【display bgp ipv6 peer】
//针对邻居修改下一跳和路由反射器让bgp里边的路由能到
[r5-bgp]ipv6
[r5-bgp-af-ipv6]peer 6::6 n
[r5-bgp-af-ipv6]peer 6::6 next-hop-local
[r6-bgp]ipv6
[r6-bgp-af-ipv6]peer 7::7 refl
[r6-bgp-af-ipv6]peer 7::7 reflect-client
//6to4基本操作,记得ip配的是6to4算出来的子网
【R2】
#
interface Tunnel0/0/0
ipv6 enable
ipv6 address 2002:1701:101:1111::1/64
tunnel-protocol ipv6-ipv4 6to4
source 23.1.1.1
#
【R4】
#
interface Tunnel0/0/0
ipv6 enable
ipv6 address 2002:2201:102:1111::1/64
tunnel-protocol ipv6-ipv4 6to4
source 34.1.1.2
#
【R4和R2都配个静态】
ipv6 route-static 2002:: 16 Tunnel0/0/0
这个地方路由就可以都到了,但是还没进行宣告V6部分的汇总,
[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
//出门的路
[r4]bgp 1
[r4-bgp]ipv6-family
[r4-bgp-af-ipv6]network 2002:: 16
【可以看一下bgp里边的bgp路由表,一条2002::出去找别的v6的路由,下面那条不重要,是5宣告给4汇总的,主要是让别人来找这个网段的门】
【验证:R8ping通R1的环回V6地址】
总结:
IPv6实验不难,主要是和v4有点区别,感觉有好配的地方比如动态路由协议宣告那方便,但这个地址确实太长了,太难配了