实验TOP:
【实验配置】:
190:bgp 100
network 1.1.1.1 255.255.255.255
undo synchronization
peer 14.14.14.1 as-number 200
peer 34.34.34.1 as-number 300
group 200 external
peer 14.14.14.1 group 200
group 300 external
peer 34.34.34.1 group 300
interface LoopBack100
ip address 1.1.1.1 255.255.255.255
160:bgp 200
undo synchronization
peer 13.13.13.2 as-number 300
peer 14.14.14.2 as-number 100
group 100 external
peer 14.14.14.2 group 100
group 300 external
peer 13.13.13.2 group 300
180:bgp 300
undo synchronization
peer 13.13.13.1 as-number 200
peer 34.34.34.2 as-number 100
group 100 external
peer 34.34.34.2 group 100
group 200 external
peer 13.13.13.1 group 200
☆☆☆:查看160路由表;可以看到1.1.1.1经过14.14.14.0网段去往160;(经过一个AS);
*> 1.1.1.1/32 14.14.14.2 0 0 100i(一跳)
☆☆☆:查看160路由表;可以看到还有一条1.1.1.1经过AS300然后到160;(经过两个AS);
* 13.13.13.2 0 300 100i(两跳)
☆☆☆:160会优选AS路径跳数短的路由;(180也是一样)
160:[R-1]dis bgp rou
Total Number of Routes: 2
BGP Local router ID is 192.168.1.160
Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
Network NextHop MED LocPrf PrefVal Path/Ogn
*> 1.1.1.1/32 14.14.14.2 0 0 100i(一跳)
* 13.13.13.2 0 300 100i
180:[R-3]dis bgp rou
Total Number of Routes: 2
BGP Local router ID is 192.168.1.180
Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
Network NextHop MED LocPrf PrefVal Path/Ogn
*> 1.1.1.1/32 34.34.34.2 0 0 100i
* 13.13.13.1 0 00 100i