剖析使用物理端口建立的BGP关系(实验部分)
拓扑图:

hostname R1
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
no ip domain lookup
interface Loopback0
ip address 1.1.1.1 255.255.255.0
interface Ethernet0/1
ip address 12.1.1.1 255.255.255.0
router bgp 1
no synchronization
bgp router-id 1.1.1.1
bgp log-neighbor-changes
network 1.1.1.0 mask 255.255.255.0
network 12.1.1.0 mask 255.255.255.0
neighbor 12.1.1.2 remote-as 1
no auto-summary
hostname R
2
no ip domain lookup
interface Loopback0
ip address 2.2.2.2 255.255.255.0
interface Ethernet0/0
ip address 12.1.1.2 255.255.255.0
interface Ethernet0/1
ip address 23.1.1.1 255.255.255.0
router bgp 1
no synchronization
bgp router-id 2.2.2.2
bgp log-neighbor-changes
network 2.2.2.0 mask 255.255.255.0
network 12.1.1.0 mask 255.255.255.0
network 23.1.1.0 mask 255.255.255.0
neighbor 12.1.1.1 remote-as 1
neighbor 23.1.1.2 remote-as 1
no auto-summary
line con 0
exec-timeout 0 0
logging synchronous
hostname R3
interface Loopback0
ip address 3.3.3.3 255.255.255.0
interface Ethernet0/0
ip address 23.1.1.2 255.255.255.0
interface Ethernet0/1
ip address 34.1.1.1 255.255.255.0
router bgp 1
no synchronization
bgp router-id 3.3.3.3
bgp log-neighbor-changes
network 3.3.3.0 mask 255.255.255.0
network 23.1.1.0 mask 255.255.255.0
neighbor 23.1.1.1 remote-as 1
no auto-summary
line con 0
exec-timeout 0 0
logging synchronous
现在看下路由表
R3# show ip bgp
BGP table version is 5, local router ID is 3.3.3.3
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
*>i2.2.2.0/24 23.1.1.1 0 100 0 i
*> 3.3.3.0/24 0.0.0.0 0 32768 i
*>i12.1.1.0/24 23.1.1.1 0 100 0 i
* i23.1.1.0/24 23.1.1.1 0 100 0 i
*> 0.0.0.0 0 32768 i
试验现象:
R3# show ip bgp
BGP table version is 5, local router ID is 3.3.3.3
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
*>i2.2.2.0/24 23.1.1.1 0 100 0 i
*> 3.3.3.0/24 0.0.0.0 0 32768 i
*>i12.1.1.0/24 23.1.1.1 0 100 0 i
* i23.1.1.0/24 23.1.1.1 0 100 0 i
*> 0.0.0.0 0 32768 i
这个时间我们看到效果了吧!那是因为R1要和R3建立BGP邻居关系,而BGP中建立的邻居关系是依据TCP来做的,在初始状态下,R3没有到达R1的路由条目,所以我们要启用任何的三层路由协议。只要R3中能有R1 的路由条目就行
转载于:https://blog.51cto.com/pzh0227/113677