Spring中的aware接口详情
405
2022-09-22
CCNP(BSCI)实验:配置BGP的路由过滤和默认路由(bgp引入默认路由)
R2(config)#int lo0R2(config-if)#ip add 2.2.2.2 255.255.255.0R2(config-if)#int s2/1R2(config-if)#ip add 12.0.0.2 255.255.255.0R2(config-if)#no shR2(config-if)#int s2/2R2(config-if)#ip add 23.0.0.2 255.255.255.0R2(config-if)#no sh
R3(config)#int lo0R3(config-if)#ip add 3.3.3.3 255.255.255.0R3(config-if)#int s2/1R3(config-if)#ip add 23.0.0.3 255.255.255.0R3(config-if)#no shR3(config-if)#int s2/2R3(config-if)#ip add 34.0.0.3 255.255.255.0
第二步:配置BGPR1(config)#router bgp 100R1(config-router)#nei 12.0.0.2 remote-as 200R1(config-router)#net 1.1.1.0 mask 255.255.255.0
R2(config)#router bgp 200R2(config-router)#nei 12.0.0.1 remote-as 100R2(config-router)#nei 23.0.0.3 remote-as 300R2(config-router)#net 2.2.1.0 mask 255.255.255.0R2(config-router)#net 2.2.2.0 mask 255.255.255.0
R3(config)#router bgp 300R3(config-router)#nei 23.0.0.2 remote-as 200R3(config-router)#net 3.3.3.0 mask 255.255.255.0第三步:分别查看R1和R3的bgp表R2#sh ip bgp BGP 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 Metric LocPrf Weight Path> 1.1.1.0/24 12.0.0.1 0 0 100 i> 2.2.1.0/24 0.0.0.0 0 32768 i> 2.2.2.0/24 0.0.0.0 0 32768 i> 3.3.3.0/24 23.0.0.3 0 0 300 i
R3#sh ip bgp BGP table version is 5, local router ID is 3.3.3.3Status 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.0.0.2 0 200 100 i> 2.2.1.0/24 23.0.0.2 0 0 200 i> 2.2.2.0/24 23.0.0.2 0 0 200 i> 3.3.3.0/24 0.0.0.0 0 32768 i路由过滤第三步:我们对路由进行过滤R2(config)#access-list 1 permit 2.2.0.0 0.0.255.255//抓取2.2.0.0 路由
access-list 1 permit 2.2.0.0 0.0.255.255access-list 10 deny 1.1.1.0 0.0.0.255access-list 10 permit any//我们分别写了两个控制表,并用在了下列所示bgp 200中//再一个请注意,acl最后一句是deny any的,不显示。router bgp 200…………………………neighbor 12.0.0.1 distribute-list 10 inneighbor 12.0.0.1 distribute-list 1 out//这两句是配置命令,要写入R2我们预计在R3 的bgp表中将没有1.1.1.0在R1的bgp表中将没有3.3.3.0
R3#sh ip bgp BGP table version is 4, local router ID is 3.3.3.3Status 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> 2.2.1.0/24 23.0.0.2 0 0 200 i> 2.2.2.0/24 23.0.0.2 0 0 200 i*> 3.3.3.0/24 0.0.0.0 0 32768 i
R1#sh ip bgp BGP table version is 4, local router ID is 1.1.1.1Status 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 0.0.0.0 0 32768 i> 2.2.1.0/24 12.0.0.2 0 0 200 i*> 2.2.2.0/24 12.0.0.2 0 0 200 i
第四步:我们又no掉一句neighbor 12.0.0.1 distribute-list 10 in看看R3bgp表中有了1.1.1.0/24的路由R3#sh ip bgp BGP table version is 5, local router ID is 3.3.3.3Status 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.0.0.2 0 200 100 i> 2.2.1.0/24 23.0.0.2 0 0 200 i> 2.2.2.0/24 23.0.0.2 0 0 200 i> 3.3.3.0/24 0.0.0.0 0 32768 i默认路由第五步:在R1上创建一个网络,并通过BGP通告出去R1(config)#int lo 1R1(config-if)#ip add 10.0.0.1 255.255.255.0
R1(config)#router bgp 100R1(config-router)#net 10.0.0.0 mask 255.255.255.0
R2(config)#ip default-network 10.0.0.0//把10.0.0.0作为默认网络R2#sh ip route Codes: C - connected, S - static, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2ia - IS-IS inter area, * - candidate default, U - per-user static routeo - ODR, P - periodic downloaded static route
Gateway of last resort is 12.0.0.1 to network 10.0.0.0
1.0.0.0/24 is subnetted, 1 subnetsB 1.1.1.0 [20/0] via 12.0.0.1, 00:06:002.0.0.0/24 is subnetted, 2 subnetsC 2.2.1.0 is directly connected, Loopback1C 2.2.2.0 is directly connected, Loopback03.0.0.0/24 is subnetted, 1 subnetsB 3.3.3.0 [20/0] via 23.0.0.3, 00:05:3523.0.0.0/24 is subnetted, 1 subnetsC 23.0.0.0 is directly connected, Serial2/2
10.0.0.0/24 is subnetted, 1 subnetsB* 10.0.0.0 [20/0] via 12.0.0.1, 00:06:0012.0.0.0/24 is subnetted, 1 subnetsC 12.0.0.0 is directly connected, Serial2/1
第六步:测试R1(config)#int lo 2R1(config-if)#ip add 100.0.0.1 255.255.255.0
R2# ping 100.0.0.1
Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 100.0.0.1, timeout is 2 seconds:!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 8/28/68 ms
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~