- 论坛徽章:
- 0
|
26.5. PE-CE 之间运行RIP
提问 PE和CE路由器之间启用RIP路由协议
回答
Router-CE-A2#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router-CE-A2(config)#router rip
Router-CE-A2(config-router)#version 2
Router-CE-A2(config-router)#network 10.0.0.0
Router-CE-A2(config-router)#network 192.168.3.0
Router-CE-A2(config-router)#end
Router-CE-A2#
Router-PE2#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router-PE2(config)#router rip
Router-PE2(config-router)#version 2
Router-PE2(config-router)#address-family ipv4 vrf NetworkA
Router-PE2(config-router-af)#version 2
Router-PE2(config-router-af)#redistribute bgp 100 metric 4
Router-PE2(config-router-af)#network 192.168.3.0
Router-PE2(config-router-af)#exit-address-family
Router-PE2(config-router)#exit
Router-PE2(config)#router bgp 100
Router-PE2(config-router)#address-family ipv4 vrf NetworkA
Router-PE2(config-router-af)#redistribute rip metric 4
Router-PE2(config-router-af)#end
Router-PE2#
注释 这里需要注意的是RIP不是全局启用的,只是在特定的VRF下面的配置address-family ipv4 vrf NetworkA,另外需要配置RIP和MP-BGP之间的路由再分布。这里的再分布和传统再分布不同的是,分布到IGP的路由不是标记为外部路由的
26.6. PE-CE之间运行OSPF
提问 PE和CE路由器之间启用OSPF路由协议
回答
两个不同站点的CE路由器
Router-CE-A1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router-CE-A1(config)#router ospf 55
Router-CE-A1(config-router)#network 192.168.1.0 0.0.0.255 area 0
Router-CE-A1(config-router)#network 192.168.5.0 0.0.0.255 area 0
Router-CE-A1(config-router)#end
Router-CE-A1#
Router-CE-A2#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router-CE-A2(config)#router ospf 55
Router-CE-A2(config-router)#network 192.168.3.0 0.0.0.255 area 0
Router-CE-A2(config-router)#end
Router-CE-A2#
两个相应站点的PE路由器
Router-PE1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router-PE1(config)#router ospf 155 vrf NetworkA
Router-PE1(config-router)#redistribute bgp 100 subnets
Router-PE1(config-router)#network 192.168.1.0 0.0.0.255 area 0
Router-PE1(config-router)#exit
Router-PE1(config)#router bgp 100
Router-PE1(config-router)#address-family ipv4 vrf NetworkA
Router-PE1(config-router-af)#redistribute ospf 155
Router-PE1(config-router-af)#exit-address-family
Router-PE1(config-router)#end
Router-PE1#
Router-PE2#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router-PE2(config)#router ospf 155 vrf NetworkA
Router-PE2(config-router)#redistribute bgp 100 subnets
Router-PE2(config-router)#network 192.168.3.0 0.0.0.255 area 0
Router-PE2(config-router)#exit
Router-PE2(config)#router bgp 100
Router-PE2(config-router)#address-family ipv4 vrf NetworkA
Router-PE2(config-router-af)#redistribute ospf 155
Router-PE2(config-router-af)#exit-address-family
Router-PE2(config-router)#end
Router-PE2#
注释 这里只是和路由相关的配置,其他配置略去。12.2( T以后有shamlink这种特性来通过类似虚拟链路的方式修改OSPF的路由条目,从inter-area路由变为intra-area路由,
Router-PE1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router-PE1(config)#interface Loopback155
Router-PE1(config-if)#ip vrf forwarding NetworkA
Router-PE1(config-if)#ip address 192.168.155.1 255.255.255.255
Router-PE1(config-if)#exit
Router-PE1(config)#router ospf 155 vrf NetworkA
Router-PE1(config-router)#area 0 sham-link 192.168.155.1 192.168.155.2 cost 10
Router-PE1(config-router)#redistribute bgp 100 subnets
Router-PE1(config-router)#network 192.168.1.0 0.0.0.255 area 0
Router-PE1(config-router)#end
Router-PE1#
Router-PE2#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router-PE2(config)#interface Loopback155
Router-PE2(config-if)#ip vrf forwarding NetworkA
Router-PE2(config-if)#ip address 192.168.155.2 255.255.255.255
Router-PE2(config-if)#exit
Router-PE2(config)#router ospf 155 vrf NetworkA
Router-PE2(config-router)#area 0 sham-link 192.168.155.2 192.168.155.1 cost 10
Router-PE2(config-router)#redistribute bgp 100 subnets
Router-PE2(config-router)#network 192.168.3.0 0.0.0.255 area 0
Router-PE2(config-router)#end
Router-PE2#
26.7. PE-CE之间运行EIGRP
提问 PE和CE路由器之间启用EIGRP路由协议
回答
Router-CE-A1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router-CE-A1(config)#router eigrp 156
Router-CE-A1(config-router)#network 192.168.1.0
Router-CE-A1(config-router)#network 192.168.5.0
Router-CE-A1(config-router)#no auto-summary
Router-CE-A1(config-router)#end
Router-CE-A1#
Router-CE-A2#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router-CE-A2(config)#router eigrp 156
Router-CE-A2(config-router)#network 10.0.0.0
Router-CE-A2(config-router)#network 192.168.3.0
Router-CE-A2(config-router)#no auto-summary
Router-CE-A2(config-router)#end
Router-CE-A2#
Router-PE1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router-PE1(config)#router eigrp 1001
Router-PE1(config-router)#no auto-summary
Router-PE1(config-router)#address-family ipv4 vrf NetworkA
Router-PE1(config-router-af)#redistribute bgp 100 metric 10000 10 255 1 1500
Router-PE1(config-router-af)#network 192.168.1.0
Router-PE1(config-router-af)#no auto-summary
Router-PE1(config-router-af)#autonomous-system 156
Router-PE1(config-router-af)#exit-address-family
Router-PE1(config-router)#exit
Router-PE1(config)#router bgp 100
Router-PE1(config-router)#address-family ipv4 vrf NetworkA
Router-PE1(config-router-af)#redistribute eigrp 156
Router-PE1(config-router-af)#exit-address-family
Router-PE1(config-router)#exit
Router-PE1(config)#end
Router-PE1#
Router-PE2#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router-PE2(config)#router eigrp 1001
Router-PE2(config-router)#auto-summary
Router-PE2(config-router)#address-family ipv4 vrf NetworkA
Router-PE2(config-router-af)#redistribute bgp 100 metric 10000 10 255 1 1500
Router-PE2(config-router-af)#network 192.168.3.0
Router-PE2(config-router-af)#no auto-summary
Router-PE2(config-router-af)#autonomous-system 156
Router-PE2(config-router-af)#exit-address-family
Router-PE2(config-router)#end
Router-PE2#
注释 注意的是VRF中自治域系统的配置和相应再分发是选择的AS配置,要确保PE和CE的一致,对PE这里有两个EIGRP的AS号 |
|