1、BGP联邦配置BGP联邦配置一、 路由器基本配置R1enableR1#conf tR1(config)#int lo 0R1(config-if)#ip add 1.1.1.1 255.255.255.0R1(config-if)#exitR1(config)#int e0/0R1(config-if)#ip add 13.13.13.1 255.255.255.0R1(config-if)#no shutdownR1(config-if)#exitR1(config)#int s1/0R1(config-if)#ip add 12.12.12.1 255.255.255.0R1(config
2、-if)#clock rate 128000R1(config-if)#no shutdownR1(config-if)#endR1#R2enableR2#conf tR2(config)#int lo 0R2(config-if)#ip add 2.2.2.2 255.255.255.0R2(config-if)#exitR2(config)#int s0/0R2(config-if)#ip add 12.12.12.2 255.255.255.0R2(config-if)#no shutdownR2(config-if)#exitR2(config)#int s0/1R2(config-i
3、f)#ip add 23.23.23.2 255.255.255.0R2(config-if)#clock rate 128000R2(config-if)#no shutdownR2(config-if)#endR2#R3enableR3#conf tR3(config)#int lo 0R3(config-if)#ip add 3.3.3.3 255.255.255.0R3(config-if)#exitR3(config)#int e0/0R3(config-if)#ip add 13.13.13.3 255.255.255.0R3(config-if)#no shutdownR3(co
4、nfig-if)#exitR3(config)#int s1/0R3(config-if)#ip add 23.23.23.3 255.255.255.0R3(config-if)#no shutdownR3(config-if)#exitR3(config)#int s1/1R3(config-if)#ip add 34.34.34.3 255.255.255.0R3(config-if)#clock rate 128000R3(config-if)#no shutdownR3(config-if)#endR3#R4enableR4#conf tR4(config)#int lo 0R4(c
5、onfig-if)#ip add 3.3.3.3 255.255.255.0R4(config-if)#exitR4(config)#int lo 0R4(config-if)#ip add 4.4.4.4 255.255.255.0R4(config-if)#exitR4(config)#int s0/0R4(config-if)#ip add 34.34.34.4 255.255.255.0R4(config-if)#no shutdownR4(config-if)#endR4#二、 配置路由器R1#conf tR1(config)#router bgp 65001R1(config-ro
6、uter)#no synchronizationR1(config-router)#no auto-summaryR1(config-router)#bgp router-id 1.1.1.1R1(config-router)#bgp confederation identifier 100R1(config-router)#bgp confederation peers 65002R1(config-router)#net 1.1.1.0 mask 255.255.255.0R1(config-router)#neighbor 12.12.12.2 remote-as 200R1(confi
7、g-router)#neighbor 13.13.13.3 remote-as 65002R1(config-router)#neighbor 13.13.13.3 next-hop-selfR1(config-router)#endR1#R2#conf tR2(config)#router bgp 200R2(config-router)#no synchronizationR2(config-router)#no auto-summaryR2(config-router)#bgp router-id 2.2.2.2R2(config-router)#net 2.2.2.0 mask 255
8、.255.255.0R2(config-router)#neighbor 12.12.12.1 remote-as 100R2(config-router)#neighbor 23.23.23.3 remote-as 100R2(config-router)#endR2#R3#conf tR3(config)#router eigrp 1R3(config-router)#net 3.3.3.0R3(config-router)#net 34.34.34.0R3(config-router)#no auto-summaryR3(config-router)#exitR3(config)#rou
9、ter bgp 65002R3(config-router)#no synchronizationR3(config-router)#no auto-summaryR3(config-router)#bgp router-id 3.3.3.3R3(config-router)#bgp confederation identifier 100R3(config-router)#bgp confederation peers 65001R3(config-router)#net 3.3.3.0 mask 255.255.255.0R3(config-router)#neighbor 4.4.4.4
10、 remote-as 65002R3(config-router)#neighbor 4.4.4.4 update-source lo 0R3(config-router)#neighbor 4.4.4.4 next-hop-selfR3(config-router)#neighbor 13.13.13.1 remote-as 65001R3(config-router)#neighbor 13.13.13.1 next-hop-selfR3(config-router)#neighbor 23.23.23.2 remote-as 200R3(config-router)#endR3#R4#c
11、onf tR4(config)#router eigrp 1R4(config-router)#net 4.4.4.0R4(config-router)#net 34.34.34.0R4(config-router)#no auto-summaryR4(config-router)#exitR4(config)#router bgp 65002R4(config-router)#no synchronizationR4(config-router)#no auto-summaryR4(config-router)#bgp router-id 4.4.4.4R4(config-router)#n
12、et 4.4.4.0 mask 255.255.255.0R4(config-router)#neighbor 3.3.3.3 remote-as 65002R4(config-router)#neighbor 3.3.3.3 update-source lo 0R4(config-router)#endR4#三、 查看路由表R1#sh ip routeCodes: C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter a
13、rea N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded stati
14、c routeGateway of last resort is not set 1.0.0.0/24 is subnetted, 1 subnetsC 1.1.1.0 is directly connected, Loopback0 2.0.0.0/24 is subnetted, 1 subnetsB 2.2.2.0 20/0 via 12.12.12.2, 00:09:26 3.0.0.0/24 is subnetted, 1 subnetsB 3.3.3.0 200/0 via 13.13.13.3, 00:00:04 4.0.0.0/24 is subnetted, 1 subnet
15、sB 4.4.4.0 200/0 via 13.13.13.3, 00:00:04 12.0.0.0/24 is subnetted, 1 subnetsC 12.12.12.0 is directly connected, Serial1/0 13.0.0.0/24 is subnetted, 1 subnetsC 13.13.13.0 is directly connected, Ethernet0/0R1#R2#sh ip routeCodes: C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX -
16、 EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static
17、route o - ODR, P - periodic downloaded static routeGateway of last resort is not set 1.0.0.0/24 is subnetted, 1 subnetsB 1.1.1.0 20/0 via 12.12.12.1, 00:10:02 2.0.0.0/24 is subnetted, 1 subnetsC 2.2.2.0 is directly connected, Loopback0 3.0.0.0/24 is subnetted, 1 subnetsB 3.3.3.0 20/0 via 23.23.23.3,
18、 00:06:04 4.0.0.0/24 is subnetted, 1 subnetsB 4.4.4.0 20/0 via 23.23.23.3, 00:04:54 23.0.0.0/24 is subnetted, 1 subnetsC 23.23.23.0 is directly connected, Serial0/1 12.0.0.0/24 is subnetted, 1 subnetsC 12.12.12.0 is directly connected, Serial0/0R2#R3#sh ip routeCodes: C - connected, S - static, R -
19、RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * -
20、 candidate default, U - per-user static route o - ODR, P - periodic downloaded static routeGateway of last resort is not set 34.0.0.0/24 is subnetted, 1 subnetsC 34.34.34.0 is directly connected, Serial1/1 1.0.0.0/24 is subnetted, 1 subnetsB 1.1.1.0 200/0 via 13.13.13.1, 00:00:29 2.0.0.0/24 is subne
21、tted, 1 subnetsB 2.2.2.0 20/0 via 23.23.23.2, 00:05:53 3.0.0.0/24 is subnetted, 1 subnetsC 3.3.3.0 is directly connected, Loopback0 4.0.0.0/24 is subnetted, 1 subnetsD 4.4.4.0 90/2297856 via 34.34.34.4, 00:06:00, Serial1/1 23.0.0.0/24 is subnetted, 1 subnetsC 23.23.23.0 is directly connected, Serial
22、1/0 13.0.0.0/24 is subnetted, 1 subnetsC 13.13.13.0 is directly connected, Ethernet0/0R3#R4#sh ip routeCodes: C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSP
23、F external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static routeGateway of last resort is not set 34.0.0.0/24 is subnetted, 1 subnet
24、sC 34.34.34.0 is directly connected, Serial0/0 1.0.0.0/24 is subnetted, 1 subnetsB 1.1.1.0 200/0 via 3.3.3.3, 00:00:13 2.0.0.0/24 is subnetted, 1 subnetsB 2.2.2.0 200/0 via 3.3.3.3, 00:04:27 3.0.0.0/24 is subnetted, 1 subnetsD 3.3.3.0 90/2297856 via 34.34.34.3, 00:05:44, Serial0/0 4.0.0.0/24 is subn
25、etted, 1 subnetsC 4.4.4.0 is directly connected, Loopback0R4#四、 查看BGPR2#sh ip bgpBGP table version is 5, local router ID is 2.2.2.2Status codes: s suppressed, d damped, h history, * valid, best, i - internal, r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metri
26、c LocPrf Weight Path* 1.1.1.0/24 23.23.23.3 0 100 i* 12.12.12.1 0 0 100 i* 2.2.2.0/24 0.0.0.0 0 32768 i* 3.3.3.0/24 12.12.12.1 0 100 i* 23.23.23.3 0 0 100 i* 4.4.4.0/24 12.12.12.1 0 100 i* 23.23.23.3 0 100 iR2#R3#sh ip bgpBGP table version is 6, local router ID is 3.3.3.3Status codes: s suppressed,
27、d damped, h history, * valid, best, i - internal, r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path* 1.1.1.0/24 13.13.13.1 0 100 0 (65001) i* 2.2.2.0/24 13.13.13.1 0 100 0 (65001) 200 i* 23.23.23.2 0 0 200 i* 3.3.3.0/24 0.0.0.0 0 32768 ir
28、i4.4.4.0/24 4.4.4.4 0 100 0 iR3#实验二:BGP团体配置一、配置团体属性local_asR4#conf t.R4(config)#ip prefix-list 1 permit 4.4.4.0/24 /定义前缀列表R4(config)#route-map Local_AS permit 10 /定义route-mapR4(config-route-map)#match ip address prefix-list 1 /匹配前缀列表R4(config-route-map)#set community local-AS /设置团体属性R4(config-route-
29、map)#router bgp 65002R4(config-router)#neighbor 3.3.3.3 send-community /开启发送团体属性的能力R4(config-router)#neighbor 3.3.3.3 route-map Local_AS out /再出方向向邻居发送团体属性R4(config-router)#查看bgpR3#sh ip bgpBGP table version is 7, local router ID is 3.3.3.3Status codes: s suppressed, d damped, h history, * valid, be
30、st, i - internal, r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path* 1.1.1.0/24 13.13.13.1 0 100 0 (65001) i* 2.2.2.0/24 13.13.13.1 0 100 0 (65001) 200 i* 23.23.23.2 0 0 200 i* 3.3.3.0/24 0.0.0.0 0 32768 iri4.4.4.0/24 4.4.4.4 0 100 0 iR3#
31、R2#sh ip bgpBGP table version is 7, local router ID is 2.2.2.2Status codes: s suppressed, d damped, h history, * valid, best, i - internal, r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path* 1.1.1.0/24 23.23.23.3 0 100 i* 12.12.12.1 0 0 100 i* 2.2.2.0/24 0.0.0.0 0 32768 i* 3.3.3.0/24 12.12.12.1 0 100 i* 23.23.23.3 0 0 100 i
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1