|
r1 配置
router>en router#conf t router(config)#host r1 r1(config)#bann mot #Welcome to r1# r1(config)#no ip domain-lookup r1(config)#ena sec 123 r1(config)#line vyt 0 4 r1(config-line)#no login r1(config-line)#exit r1(config)#access-list 1 deny 150.1.0.0 0.0.255.255 r1(config)#access-llst 1 permit any r1(config)#access-list 2 permit 150.1.0.0 0.0.255.255 r1(config)#route-map acl1 permit 10 r1(config-route-map)#match ip add 1 r1(config-route-map)#route-map acl2 permit 10 r1(config-route-map)#match ip add 2 r1(config-route-map)#int f 0/0 r1(config-if)#ip add 151.1.1.1 255.255.255.252 r1(config-if)#des link to r2 r1(config-if)#no shut r1(config-if)#int lo0 r1(config-if)#ip add 150.1.0.1 255.255.255.192 r1(config-if)#des test ip r1(config-if)#int lo1 r1(config-if)#ip add 150.1.1.65 255.255.255.192 r1(config-if)#des test ip r1(config-if)#int lo2 r1(config-if)#ip add 151.1.2.1 255.255.255.0 r1(config-if)#des test ip r1(config-if)#int lo3 r1(config-if)#ip add 151.1.1.65 255.255.255.192 r1(config-if)#des test ip r1(config-if)#router rip r1(config-route)#network 151.1.0.0 r1(config-route)#redistribute egirp 10 metric 3 route-map acl2 r1(config-route)#router eigrp 10 r1(config-route)#network 150.1.0.0 0.0.0.63 r1(config-route)#network 150.1.1.64 0.0.0.63 r1(config-route)#network 151.1.2.0 0.0.0.255 r1(config-route)#network 151.1.1.64 0.0.0.63 r1(config-route)#redistribut rip metric 100000 100 255 1 1500 route-map acl1 r1(config-route)#router bgp 65001 r1(config-route)#network 151.1.1.64 mask 255.255.255.192 r1(config-route)#network 151.1.2.0 mask 255.255.255.0 r1(config-route)#neighbor 151.1.1.2 remote-as 65001 r1(config-route)#no synchronization r1(config-route)#end r1#
r2 配置
router>en router#conf t router(config)#host r2 r2(config)#bann mot #Welcome to r2# r2(config)#no ip domain-lookup r2(config)#ena sec 123 r2(config)#line vyt 0 4 r2(config-line)#no login r2(config-line)#int f 1/0 r2(config-if)#ip add 160.1.1.1 255.255.255.252 r2(config-if)#des link to r3 r2(config-if)#no shut r2(config-if)#int f 0/0 r2(config-if)#ip add 151.1.1.2 255.255.255.252 r2(config-if)#des link to r1 r2(config-if)#no shut r2(config-if#router rip r2(config-route)#network 151.1.0.0 r2(config-route)#router bgp 65001 r2(config-route)#no synchronization r2(config-route)#network 150.1.0.0 mask 255.255.0.0 r2(config-route)#network 151.1.1.0 mask 255.255.255.252 r2(config-route)#aggregate-address 151.1.0.0 255.255.0.0 as-set summary-only r2(config-route)#neighbor 151.1.1.1 remote-as 65001 r2(config-route)#neighbor 151.1.1.1 next-hop-self r2(config-route)#neighbor 160.1.1.2 remote-as 65002 r2(config-route)#end r2#
r3 配置
router>en router#conf t router(config)#host r3 r3(config)#bann mot #Welcome to r3# r3(config)#no ip domain-lookup r3(config)#ena sec 123 r3(config)#line vyt 0 4 r3(config-line)#no login r3(config-line)#int f 0/0 r3(config-if)#ip add 160.1.1.2 255.255.255.252 r3(config-if)#des link to r2 r3(config-if)#no shut r3(config-if)#int f 1/0 r3(config-if)#ip add 160.1.1.5 255.255.255.252 r3(config-if)#des link to r4 r3(config-if)#no shut r3(config-if)#router bgp 65002 r3(config-route)#network 160.1.1.0 mask 255.255.255.252 r3(config-route)#network 160.1.1.4 mask 255.255.255.252 r3(config-route)#no synchronization r3(config-route)#neighbor 160.1.1.6 remote-as 65002 r3(config-route)#neighbor 160.1.1.6 next-hop-self r3(config-rotue)#neighbor 160.1.1.1 remote-as 65001 r3(config-route)#end r3#
r4 配置
router>en router#conf t router(config)#host r4 r4(config)#bann mot #Welcome to r4# r4(config)#no ip domain-lookup r4(config)#ena sec 123 r4(config)#line vyt 0 4 r4(config-line)#no login r4(config-line)#int f 1/0 r4(config-if)#ip add 160.1.1.9 255.255.255.252 r4(config-if)#des link to r5 r4(config-if)#no shut r4(config-if)#int f 0/0 r4(config-if)#ip add 160.1.1.6 255.255.255.252 r4(config-if)#des link to r3 r4(config-if)#no shut r4(config-if)#router bgp 65002 r4(config-route)#no synchronization r4(config-route)#network 160.1.1.8 mask 255.255.255.252 r4(config-route)#neighbor 160.1.1.5 remote-as 65002 r4(config-route)#neighbor 160.1.1.5 next-hop-self r4(config-route)#neighbor 160.1.1.10 remote-as 65000 r4(config-route)#end r4#
r5 配置
router>en router#conf t router(config)#host r5 r5(config)#bann mot #Welcome to r5# r5(config)#no ip domain-lookup r5(config)#ena sec 123 r5(config)#line vyt 0 4 r5(config-line)#no login r5(config-line)#int f 0/0 r5(config-if)#ip add 160.1.1.10 255.255.255.252 r5(config-if)#des link to r4 r5(config-if)#no shut r5(config-if)#int lo0 r5(config-if)#ip add 170.1.1.1 255.255.255.0 r5(config-if)#des test ip r5(config-if)#int lo1 r5(config-if)#ip add 170.1.2.1 255.255.255.0 r5(config-if)#des test ip r5(config-if)#int lo2 r5(config-if)#ip add 170.1.3.1 255.255.255.0 r5(config-if)#des test ip r5(config-if)#router ospf 64 r5(config-route)#network 170.1.1.0 0.0.0.255 area 0 r5(config-route)#network 170.1.2.0.0.0.0.255 area 0 r5(config-route)#network 170.1.3.0 0.0.0.255 area 0 r5(config-route)#router bgp 65000 r5(config-route)#no synchronization r5(config-route)#network 170.1.1.0 mask 255.255.255.0 r5(config-route)#network 170.1.2.0 mask 255.255.255.0 r5(config-route)#network 170.1.3.0 mask 255.255.255.0 r5(config-route)#aggregate-address 170.1.0.0 255.255.252.0 as-set summary-only r5(config-route)#neighbor 160.1.1.9 remote-as 65002 r5(config-route)#end r5#
show run Building configuration...
Current configuration : 1603 bytes ! version 12.3 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname r1 ! boot-start-marker boot-end-marker ! enable secret 5 $1$wbwM$r2uEaBT7AZRIRf7ujAYR51 ! no aaa new-model ip subnet-zero ! ! no ip domain lookup ! ip cef ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! interface Loopback0 description test ip ip address 150.1.0.1 255.255.255.192 ! interface Loopback1 description test ip ip address 150.1.0.65 255.255.255.192 ! interface Loopback2 description test ip ip address 151.1.2.1 255.255.255.0 ! interface Loopback3 description test ip ip address 151.1.1.65 255.255.255.192 ! interface FastEthernet0/0 description link to r2 ip address 151.1.1.1 255.255.255.252 duplex half ! router eigrp 10 redistribute rip metric 100000 100 255 1 1500 route-map acl1 network 150.1.0.0 0.0.0.63 network 150.1.1.64 0.0.0.63 network 151.1.1.64 0.0.0.63 network 151.1.2.0 0.0.0.255 auto-summary ! router rip redistribute eigrp 10 metric 3 route-map acl2 network 151.1.0.0 ! router bgp 65001 no synchronization bgp log-neighbor-changes network 151.1.1.64 mask 255.255.255.192 network 151.1.2.0 mask 255.255.255.0 neighbor 151.1.1.2 remote-as 65001 no auto-summary ! ip classless no ip http server ! ! access-list 1 deny 150.1.0.0 0.0.255.255 access-list 1 permit any access-list 2 permit 150.1.0.0 0.0.255.255 ! route-map acl2 permit 10 match ip address 2 ! route-map acl1 permit 10 match ip address 1 ! ! ! ! ! ! ! gatekeeper shutdown ! banner motd ^CWelcome to r1^C ! line con 0 stopbits 1 line aux 0 line vty 0 4 no login ! ! end
r1#show ip bgp BGP table version is 31, local router ID is 151.1.2.1 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path r>i150.1.0.0 151.1.1.2 3 100 0 i r>i151.1.0.0 151.1.1.2 0 100 0 i *> 151.1.1.64/26 0.0.0.0 0 32768 i *> 151.1.2.0/24 0.0.0.0 0 32768 i *>i160.1.1.0/30 151.1.1.2 0 100 0 65002 i *>i160.1.1.4/30 151.1.1.2 0 100 0 65002 i *>i160.1.1.8/30 151.1.1.2 0 100 0 65002 i *>i170.1.0.0/22 151.1.1.2 0 100 0 65002 65000 i r1#151.1.1.2 Trying 151.1.1.2 ... Open Welcome to r2 r2>en Password: r2#show run Building configuration...
Current configuration : 1032 bytes ! version 12.3 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname r2 ! boot-start-marker boot-end-marker ! enable secret 5 $1$6Jj1$IqdOXvIpX3VP1RujJLWXr1 ! no aaa new-model ip subnet-zero ! ! no ip domain lookup ! ip cef ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! interface FastEthernet0/0 description link to r1 ip address 151.1.1.2 255.255.255.252 duplex half ! interface FastEthernet1/0 description link to r3 ip address 160.1.1.1 255.255.255.252 duplex half ! router rip network 151.1.0.0 ! router bgp 65001 no synchronization bgp log-neighbor-changes network 150.1.0.0 network 151.1.1.0 mask 255.255.255.252 aggregate-address 151.1.0.0 255.255.0.0 as-set summary-only neighbor 151.1.1.1 remote-as 65001 neighbor 151.1.1.1 next-hop-self neighbor 160.1.1.2 remote-as 65002 no auto-summary ! ip classless no ip http server ! ! ! ! ! ! ! ! ! gatekeeper shutdown ! banner motd ^CWelcome to r2^C ! line con 0 stopbits 1 line aux 0 line vty 0 4 no login ! ! end
r2#show ip bgp BGP table version is 14, local router ID is 160.1.1.1 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path *> 150.1.0.0 151.1.1.1 3 32768 i *> 151.1.0.0 0.0.0.0 100 32768 i s> 151.1.1.0/30 0.0.0.0 0 32768 i s>i151.1.1.64/26 151.1.1.1 0 100 0 i s>i151.1.2.0/24 151.1.1.1 0 100 0 i r> 160.1.1.0/30 160.1.1.2 0 0 65002 i *> 160.1.1.4/30 160.1.1.2 0 0 65002 i *> 160.1.1.8/30 160.1.1.2 0 65002 i *> 170.1.0.0/22 160.1.1.2 0 65002 65000 i r2#160.1.1.2 Trying 160.1.1.2 ... Open Weclome to r3 r3>en Password: r3#show run Building configuration...
Current configuration : 960 bytes ! version 12.3 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname r3 ! boot-start-marker boot-end-marker ! enable secret 5 $1$gF4b$3.V6yh8dlkewywpstaNI40 ! no aaa new-model ip subnet-zero ! ! no ip domain lookup ! ip cef ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! interface FastEthernet0/0 description link to r2 ip address 160.1.1.2 255.255.255.252 duplex half ! interface FastEthernet1/0 description link to r4 ip address 160.1.1.5 255.255.255.252 duplex half ! router bgp 65002 no synchronization bgp log-neighbor-changes network 160.1.1.0 mask 255.255.255.252 network 160.1.1.4 mask 255.255.255.252 neighbor 160.1.1.1 remote-as 65001 neighbor 160.1.1.6 remote-as 65002 neighbor 160.1.1.6 next-hop-self no auto-summary ! ip classless no ip http server ! ! ! ! ! ! ! ! ! gatekeeper shutdown ! banner motd ^CWeclome to r3^C ! line con 0 stopbits 1 line aux 0 line vty 0 4 no login ! ! end
r3#show ip bgp BGP table version is 21, local router ID is 160.1.1.5 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path *> 150.1.0.0 160.1.1.1 3 0 65001 i *> 151.1.0.0 160.1.1.1 0 0 65001 i *> 160.1.1.0/30 0.0.0.0 0 32768 i *> 160.1.1.4/30 0.0.0.0 0 32768 i *>i160.1.1.8/30 160.1.1.6 0 100 0 i *>i170.1.0.0/22 160.1.1.6 0 100 0 65000 i
r3#160.1.1.6 Trying 160.1.1.6 ... Open
r4>en Password: r4#show run Building configuration...
Current configuration : 873 bytes ! version 12.3 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname r4 ! boot-start-marker boot-end-marker ! enable secret 5 $1$sJj1$PdbqIpko3Q.1UI.KBBKQW/ ! no aaa new-model ip subnet-zero ! ! ! ip cef ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! interface FastEthernet0/0 description link to r3 ip address 160.1.1.6 255.255.255.252 duplex half ! interface FastEthernet1/0 description link to r5 ip address 160.1.1.9 255.255.255.252 duplex half ! router bgp 65002 no synchronization bgp log-neighbor-changes network 160.1.1.8 mask 255.255.255.252 neighbor 160.1.1.5 remote-as 65002 neighbor 160.1.1.5 next-hop-self neighbor 160.1.1.10 remote-as 65000 no auto-summary ! ip classless no ip http server ! ! ! ! ! ! ! ! ! gatekeeper shutdown ! ! line con 0 stopbits 1 line aux 0 line vty 0 4 no login ! ! end
r4#show ip bgp BGP table version is 22, local router ID is 160.1.1.9 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path *>i150.1.0.0 160.1.1.5 3 100 0 65001 i *>i151.1.0.0 160.1.1.5 0 100 0 65001 i *>i160.1.1.0/30 160.1.1.5 0 100 0 i r>i160.1.1.4/30 160.1.1.5 0 100 0 i *> 160.1.1.8/30 0.0.0.0 0 32768 i *> 170.1.0.0/22 160.1.1.10 0 0 65000 i r4#160.1.1.10 Trying 160.1.1.10 ... Open Welcome to r5 r5>en Password: r5#show run Building configuration...
Current configuration : 1270 bytes ! version 12.3 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname r5 ! boot-start-marker boot-end-marker ! enable secret 5 $1$MLYm$TlREH1ZtBxC6NOrsjabi3. ! no aaa new-model ip subnet-zero ! ! no ip domain lookup ! ip cef ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! interface Loopback0 description test ip ip address 170.1.1.1 255.255.255.0 ! interface Loopback1 description test ip ip address 170.1.2.1 255.255.255.0 ! interface Loopback2 description test ip ip address 170.1.3.1 255.255.255.0 ! interface FastEthernet0/0 description link to r4 ip address 160.1.1.10 255.255.255.252 duplex half ! router ospf 64 log-adjacency-changes network 170.1.1.0 0.0.0.255 area 0 network 170.1.2.0 0.0.0.255 area 0 network 170.1.3.0 0.0.0.255 area 0 ! router bgp 65000 no synchronization bgp log-neighbor-changes network 170.1.1.0 mask 255.255.255.0 network 170.1.2.0 mask 255.255.255.0 network 170.1.3.0 mask 255.255.255.0 aggregate-address 170.1.0.0 255.255.252.0 as-set summary-only neighbor 160.1.1.9 remote-as 65002 no auto-summary ! ip classless no ip http server ! ! ! ! ! ! ! ! ! gatekeeper shutdown ! banner motd ^CWelcome to r5^C ! line con 0 stopbits 1 line aux 0 line vty 0 4 no login ! ! end
r5#show ip bgp BGP table version is 28, local router ID is 170.1.3.1 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path *> 150.1.0.0 160.1.1.9 0 65002 65001 i *> 151.1.0.0 160.1.1.9 0 65002 65001 i *> 160.1.1.0/30 160.1.1.9 0 65002 i *> 160.1.1.4/30 160.1.1.9 0 65002 i r> 160.1.1.8/30 160.1.1.9 0 0 65002 i *> 170.1.0.0/22 0.0.0.0 100 32768 i s> 170.1.1.0/24 0.0.0.0 0 32768 i s> 170.1.2.0/24 0.0.0.0 0 32768 i s> 170.1.3.0/24 0.0.0.0 0 32768 i r5#ping 150.1.0.1
Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 150.1.0.1, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 188/281/404 ms r5#ping 151.1.1.65
Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 151.1.1.65, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 236/291/356 ms r5# 本文出自 “人类一思考,上帝都发笑” 博客,转载请与作者联系! 本文出自 51CTO.COM技术博客 |