多平台统一管理软件接口,如何实现多平台统一管理软件接口
314
2022-09-16
Cisco ❀ IPV6应用实例
IPV6实验的分析与解答
首先给路由器上配置如下命令:
Router>enRouter#conf tRouter(config)#line c 0Router(config-line)#exec-t 0 0Router(config-line)#logg syRouter(config-line)#logg synchronous Router(config-line)#no ip domain-loRouter(config)#ho RX(X=1/2/3...)路由器的主机名RX(config)#
IPV4地址具体规划: R1-R2的S1/1的接口IPV4地址为:12.1.1.1/24 R2-R1的S1/0的接口IPV4地址为:12.1.1.2/24 R2-R9的S1/2的接口IPV4地址为:29.1.1.1/24 R9-R2的S1/2的接口IPV4地址为:29.1.1.2/24 R9的loopback 1的接口IPV4地址为:9.9.9.9/32 R9-R10的S1/1的接口IPV4地址为:90.1.1.1/24 R10-R9的S1/0的接口IPV4地址为:90.1.1.2/24
IPV6地址具体规划:由于IPV4与IPV6共存,需要 搭建6T4 channel 其IPV6地址必须通过IPV4地址计算而得:(IPV4地址->对应的IPV6地址) 29.1.1.1–>2002:1D01:0101:0000::1/64 90.1.1.2–>2002:5A01:0102:0000::1/64
计算方法(举例说明): 将12.1.1.1换算为二进制 0000 1100 . 0000 0001 . 0000 0001 . 0000 0001 将二进制转换为16进制: 0C 01 01 01 再将其改变为相对于的IPV6地址: 2002:0C01:0101::1/64 (2002标志该地址为6T4地址)
由此可得,IPV6的具体接口地址如下: R1-R2的S1/1接口的IPV6地址为:2002:1D01:0101:0000::1/64 R2-R1的S1/0接口的IPV6地址为:2002:1D01:0101:0000::2/64 R2-R3的S1/1接口的IPV6地址为:2002:1D01:0101:0001::1/64 R3-R2的S1/0接口的IPV6地址为:2002:1D01:0101:0001::2/64 R3的loopback 1接口的IPV6地址为:2002:1D01:0101:0002::1/64 R3-R4的S1/1接口的IPV6地址为:2002:1D01:0101:0003::1/64 R4-R3的S1/0接口的IPV6地址为:2002:1D01:0101:0003::2/64 R4的loopback 1接口的IPV6地址为:2002:1D01:0101:0004::1/64 R4-R5的S1/1接口的IPV6地址为:2002:1D01:0101:0005::1/64 R5-R4的S1/0接口的IPV6地址为:2002:1D01:0101:0005::2/64 R5的loopback 1接口的IPV6地址为:2002:1D01:0101:0006::1/64 R5-R6的S1/1接口的IPV6地址为:2002:1D01:0101:0007::1/64 R6-R5的S1/0接口的IPV6地址为:2002:1D01:0101:0007::2/64 R6的loopback 1接口的IPV6地址为:2002:1D01:0101:0008::1/64 R6-R7的S1/1接口的IPV6地址为:2002:1D01:0101:0009::1/64 R7-R6的S1/0接口的IPV6地址为:2002:1D01:0101:0009::2/64 R7的loopback 1接口的IPV6地址为:2002:1D01:0101:0010::1/64 R7-R8的S1/1接口的IPV6地址为:2002:1D01:0101:0011::1/64 R8-R7的S1/0接口的IPV6地址为:2002:1D01:0101:0011::2/64 R8的loopback 1接口的IPV6地址为:2002:1D01:0101:0012::1/64 R10-R11的S1/1接口的IPV6地址为:2002:5A01:0102:0000::1/64 R11-R10的S1/1接口的IPV6地址为:2002:5A01:0102:0000::2/64 R10的loopback 1接口的IPV6地址为:2002:5A01:0102:0001::1/64 R11的loopback 1接口的IPV6地址为:2002:5A01:0102:0002::1/65 R11的loopback 2接口的IPV6地址为:2002:5A01:0102:0002:8000::1/65
地址规划完成,开始配置对应的IPV4/IPV6地址给对应的接口(举例说明):
R1(config)#int s1/1R1(config-if)#ip address 12.1.1.1 255.255.255.0R1(config-if)#no shutdown (接口必须配置,环回可以不用)R1(config-if)#exit
在配置之前首先要在路由器上开启IPV6路由单播功能(举例说明):
R1(config)#ipv6 unicast-routing
(开启IPV6单播路由功能—所以IPV6路由器都必须开启)
R1(config)#int s1/1R1(config-if)#ipv6 address 2002:1D01:0101:0000::1/64R1(config-if)#no shutdown R1(config-if)#exit
【1】地址配置完毕之后,先建立IPV4环境的全网可达: 由于R1类似于PC
R1(config)#ip default-gateway 12.1.1.2(R1的网关为12.1.1.2->R2)R1(config)#no ip routing(关闭R1的IPV4路由功能)
在R2/R10上配置默认指向ISP(R9):
R2(config)#ip route 0.0.0.0 0.0.0.0 29.1.1.2R10(config)#ip route 0.0.0.0 0.0.0.0 90.1.1.1
由于R1可以正常访问ISP,此时应该在R2-R9处开启NAT:
R2(config)#access-list 1 permit 12.1.1.0 0.0.0.255R2(config)#ip nat inside source list 1 interface s1/2 overload R2(config)#int s1/2R2(config-if)#ip nat outsideR2(config-if)#exit R2(config)#int s1/1R2(config-if)#ip nat inside R2(config-if)#exit R2(config-if)#int s1/0R2(config-if)#ip nat inside R2(config-if)#exit
NAT配置完成之后,R1可以访问ISP:
R1#ping 9.9.9.9Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 9.9.9.9, timeout is 2 seconds:!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 19/221/1024 ms
【2】在R10-R11之间建立RIPNG环境:
R10(config)#ipv6 router rip ccieR10(config-rtr)#exit R10(config)#int s1/1 R10(config-if)#ipv6 rip ccie enable R10(config-if)#exit R10(config)#int l 1R10(config-if)#ipv6 rip ccie enable R10(config-if)#exit
R11(config)#ipv6 router rip ccieR11(config-rtr)#exit R11(config)#int s1/1R11(config-if)#ipv6 rip ccie enable R11(config-if)#exitR11(config-if)#int l 1R11(config-if)#ipv6 rip ccie enR11(config-if)#exitR11(config-if)#int l 2R11(config-if)#ipv6 rip ccie enR11(config-if)#exit
RIPNH的汇总;
R11(config)#int s1/1R11(config-if)#ipv6 rip ccie summary-address 2002:5A01:102:2::/64(将R11的loopback 1/2汇总为一条路由)R11(config-if)#exit
查看IPV6的RIPNG路由:
R10#show ipv6 route rip(此处只摘抄了路由表中的部分)R 2002:5A01:102:2::/64 [120/2] via FE80::FF:FE1F:480B, Serial1/1R 2002:5A01:102:2::/65 [120/2] via FE80::FF:FE1F:480B, Serial1/1R 2002:5A01:102:2:8000::/65 [120/2] via FE80::FF:FE1F:480B, Serial1/1
当RIPNG配置完成之后,在R10上开始配置6T4 tunnel:
R10上的6T4 tunnel接口IPV6地址为:2002:5A01:0102:0003::1/64R10(config)#int tunnel 0R10(config-if)#ipv6 address 2002:5A01:0102:0003::1/64 R10(config-if)#tunnel source s1/0(定义tunnel源)R10(config-if)#tunnel mode ipv6ip 6to4(定义tunnel的模式为6T4)R10(config-if)#exitR10(config)#ipv6 route 2002::/16 tunnel 0(将 2002::/16的路由全部划入tunnel)R10(config)#int s1/1R10(config-if)#ipv6 rip ccie default-information only (给RIPNG下发默认)R10(config-if)#exit
可以在R11上查看:
R11#show ipv6 route rip (此处只摘抄了路由表中的部分)R ::/0 [120/2] via FE80::FF:FE1F:480A, Serial1/1
此时R10与R11的所有环境全部完成;
【3】在R3-R4-R5-R6之间构建OSPF V3的骨干区域。
R3(config)#ipv6 router ospf 1*Aug 30 11:59:08.576: %OSPFv3-4-NORTRID: OSPFv3 process 1 could not pick a router-id, please configure manually(由于R3为IPV6地址,OSPF提示必须手动配置router-id)R3(config-rtr)#router-id 3.3.3.3R3(config-rtr)#exit R3(config)#int s1/1R3(config-if)#ipv6 ospf 1 area 0R3(config-if)#exit
(R3/R4/R5/R6配置类似) 配置完成,可以在R6上查看OSPF V3路由:
R6#show ipv6 route ospf(此处只摘抄了路由表中的部分)O 2002:1D01:101:2::1/128 [110/192] via FE80::FF:FE1F:4805, Serial1/0O 2002:1D01:101:3::/64 [110/192] via FE80::FF:FE1F:4805, Serial1/0O 2002:1D01:101:4::1/128 [110/128] via FE80::FF:FE1F:4805, Serial1/0O 2002:1D01:101:5::/64 [110/128] via FE80::FF:FE1F:4805, Serial1/0O 2002:1D01:101:6::1/128 [110/64] via FE80::FF:FE1F:4805, Serial1/0
【4】R7-R8之间构建RIPNG环境。
R7(config)#ipv6 router rip aR7(config-rtr)#exit R7(config)#int l 1R7(config-if)# ipv6 rip a enable R7(config-if)#exit R7(config-if)#int s1/1R7(config-if)# ipv6 rip a enable R7(config-if)#exit (R7/R8配置类型)配置完成,在R8上查看RIPNG路由:R8#show ipv6 route rip(此处只摘抄了路由表中的部分)R 2002:1D01:101:10::/64 [120/2] via FE80::FF:FE1F:4807, Serial1/0
【5】在R3-R8之间建立BGP环境 (1)R3/R4/R5/R6区域AS为1,R7/R8区域AS为2 (2)R3/R4/R5为小区域AS-64512,R6为小区域AS-64513 为了方便建立BGP邻居,我们可以配置多个IPV6地址在同一个接口上 R3的loopback 1另一个IPV6地址为3::3/64 R4的loopback 1另一个IPV6地址为4::4/64 R5的loopback 1另一个IPV6地址为5::5/64 R6的loopback 1另一个IPV6地址为6::6/64 R7的loopback 1另一个IPV6地址为7::7/64 R8的loopback 1另一个IPV6地址为8::8/64 注意:现实拓扑不可这么使用,实验只是为了方便建立BGP邻居
在R3/R4/R5/R6/R7/R8上建立BGP环境
R3(config)#router bgp 64512(由于R3处于小AS内,故用小AS建立BGP环境)*Aug 30 12:09:14.145: %BGP-4-NORTRID: BGP could not pick a router-id. Please configure manually.R3(config-router)#bgp router-id 3.3.3.3(无IPV4地址,必须手动配置)R3(config-router)#neighbor 4::4 remote-as 64512(小AS之间建立IBGP邻居)R3(config-router)#neighbor 4::4 up l 1R3(config-router)#address-family ipv6(进入IPV6家族模式)R3(config-router-af)#neighbor 4::4 activate (与4::4建立IPV6邻居关系)R3(config-router-af)#exit-address-family R3(config-router)#bgp confederation identifier 1(本地BGP大AS为1)R4(config)#router bgp 64512R4(config-router)#bgp router-id 4.4.4.4R4(config-router)#neighbor 3::3 remote-as 64512R4(config-router)#neighbor 3::3 up l 1R4(config-router)#neighbor 5::5 remote-as 64512R4(config-router)#neighbor 5::5 up l 1R4(config-router)#address-family ipv6R4(config-router-af)#neighbor 3::3 activate R4(config-router-af)#neighbor 5::5 activate R4(config-router-af)#exit-address-family R4(config-router)#bgp confederation identifier 1*Aug 30 13:40:52.746: %BGP-5-ADJCHANGE: neighbor 3::3 Up (此标识为R3与R4的BGP邻居关系建立完成)R5(config)#router bgp 64512R5(config-router)#bgp router-id 5.5.5.5R5(config-router)#neighbor 4::4 remote-as 64512R5(config-router)#neighbor 4::4 up l 1R5(config-router)#neighbor 6::6 remote-as 64513R5(config-router)#neighbor 6::6 up l 1R5(config-router)#address-family ipv6R5(config-router-af)#neighbor 4::4 activate R5(config-router-af)#neighbor 6::6 activate R5(config-router-af)#exit-address-family R5(config-router)#bgp confederation identifier 1R5(config-router)#bgp confederation peers 64513(小AS之间的EBGP邻居 需要互相对指peer)*Aug 30 13:41:38.737: %BGP-5-ADJCHANGE: neighbor 4::4 Up R6(config)#router bgp 64513R6(config-router)#bgp router-id 6.6.6.6R6(config-router)#neighbor 5::5 remote-as 64512R6(config-router)#neighbor 5::5 up l 1R6(config-router)#neighbor 2002:1D01:101:9::2 remote-as 2(R6与R7建立大AS之间的EBGP邻居需要使用链路地址来建立邻居关系)R6(config-router)#address-family ipv6R6(config-router-af)#neighbor 2002:1D01:101:9::2 activate R6(config-router-af)#neighbor 5::5 activate R6(config-router-af)#exit-address-family R6(config-router)#bgp confederation identifier 1*Aug 30 14:42:53.237: %BGP-5-ADJCHANGE: neighbor 5::5 Up *Aug 30 13:47:46.107: %BGP-5-ADJCHANGE: neighbor 2002:1D01:101:9::2 Up R6(config-router)#bgp confederation peers 64512R7(config)#router bgp 2R7(config-router)#bgp router-id 7.7.7.7R7(config-router)#neighbor 2002:1D01:101:9::1 remote-as 1 R7(config-router)#neighbor 8::8 remote-as 2 R7(config-router)#neighbor 8::8 up l 1R7(config-router)#address-family ipv6R7(config-router-af)#neighbor 2002:1D01:101:9::1 activate R7(config-router-af)#neighbor 8::8 activate R7(config-router-af)#exit-address-family R8(config)#router bgp 2R8(config-router)#bgp router-id 8.8.8.8R8(config-router)#neighbor 7::7 remote-as 2R8(config-router)#neighbor 7::7 up l 1R8(config-router)#address-family ipv6R8(config-router-af)#neighbor 7::7 activate R8(config-router-af)#exit-address-family
查看BGP的IPV6邻居关系:
R3#show bgp ipv6 summary
(cisoc推荐使用show bgp ipv6 unicast summary)
【6】在R7处将R7与R8的路由条目进行汇总,并宣告进入BGP:
R7(config)#ipv6 route 2002:1D01:0101:0000::/48 null 0(汇总的路由条目为空接口路由)R7(config)#router bgp 2R7(config-router)#address-family ipv6R7(config-router-af)#network 2002:1D01:0101:0000::/48 (宣告空接口路由)R7(config-router-af)#exit-address-family
当路由由R7宣告到R6时,R6给R5的路由条目并不是最优的路由,此时要在R6上修改发给R5路由的下一跳地址:
R6(config-router)#address-family ipv6R6(config-router-af)#neighbor 5::5 next-hop-self (修改本地为下一跳地址)R6(config-router-af)#exit-address-family
此时R5得到的路由并不会转发给R4,需要让R4成为R5的RR(反射器):
R4(config-router)#address-family ipv6R4(config-router-af)#neighbor 5::5 route-reflector-client R4(config-router-af)#exit-address-family R3#clear bgp ipv6 unicast * soft(软刷新BGP环境下的IPV6的路由表)
待邻居关系重置之后,R7的空接口路由就可以到达R3,可以在R3上进行查看:
R3#show bgp ipv6 Network Next Hop Metric LocPrf Weight Path *>i 2002:1D01:101::/48 2002:1D01:101:7::2 0 100 0 (64513) 2 i
(此处只摘抄了路由表中的部分)
【7】将R3汇总后的路由宣告进入BGP环境:
R3(config)#ipv6 route 2002::/16 2002:1D01:101:1::1R3(config)#router bgp 64512R3(config-router)#address-family ipv6R3(config-router-af)#network 2002::/16 R3(config-router-af)#exit-address-family
当R3转发给R4时,R4得到的IBGP路由不是最优,需要在R3上修改R4的下一跳地址:
R3(config-router)#address-family ipv6R3(config-router-af)#neighbor 4::4 next-hop-self R3(config-router-af)#exit-address-family
此时,可以在R8查看:
R8#show bgp ipv6
【8】在R2搭建6T4 tunnel:
R2(config)#int tunnel 0R2(config-if)#ipv6 address 2002:1D01:0101:0013::1/64R2(config-if)#tunnel source s1/2R2(config-if)#tunnel mode ipv6ip 6to4 R2(config-if)#exit R2(config)#ipv6 route 2002::/16 tunnel 0
配置完成之后,可以在R8上测试到R11的连通性:
R8#ping 2002:5A01:102:2:8000::1Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 2002:5A01:102:2:8000::1, timeout is 2 seconds:!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 9/10/14 ms
此处所有的配置即完成。
创作者:Eric· Charles
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~