Lab BGP Peer-Group
当同样的路由策略应用于多个BGP对端的时候,将对端指定为一个对等组的成员将会极大地简化一个路由器的BGP配置。
Step 1、配置各台路由器的IP地址,并且使用Ping命令确认各路由器的直连口的互通性。
Step 2、R3,R4,R5运行OSPF,通告环回口,再使用环回口建IBGP,在建立邻居时使用对等组节约命令。R1通告1.1.1.1/32 。R1和R3,R1和R5之间运行EBGP。
Step 3、在R4上show ip bgp 查看,正常。实验完成。
R4#sh ip bgp
BGP table version is 2, local router ID is 4.4.4.4
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
* i1.1.1.1/32 5.5.5.5 0 100 0 1 i
*>i 3.3.3.3 0 100 0 1 i
======================================================================================================
R1+++++++++++++++++++++++++++++++++++++++++++++++++
int lo 0
ip add 1.1.1.1 255.255.255.255
int e0/0
no sh
int e0/0.13
en do 13
ip add 13.1.1.1 255.255.255.0
int e0/0.15
en do 15
ip add 15.1.1.1 255.255.255.0
router bgp 1
bgp route 1.1.1.1
nei 13.1.1.3 remote 345
nei 15.1.1.5 remote 345
net 1.1.1.1 mask 255.255.255.255
R3+++++++++++++++++++++++++++++++++++++++++++
int lo 0
ip add 3.3.3.3 255.255.255.255
int e0/0
no sh
int e0/0.13
en do 13
ip add 13.1.1.3 255.255.255.0
int e0/0.34
en do 34
ip add 34.1.1.3 255.255.255.0
router ospf 100
router-id 3.3.3.3
log-adjacency-changes
network 3.3.3.3 0.0.0.0 area 0
network 34.1.1.3 0.0.0.0 area 0
!
router bgp 345
no synchronization
bgp router-id 3.3.3.3
bgp log-neighbor-changes
neighbor PEER peer-group
neighbor PEER remote-as 345
neighbor PEER update-source Loopback0
neighbor PEER next-hop-self
neighbor 4.4.4.4 peer-group PEER
neighbor 5.5.5.5 peer-group PEER
neighbor 13.1.1.1 remote-as 1
no auto-summary
router ospf 100
net 34.1.1.3 0.0.0.0 a 0
net 3.3.3.3 0.0.0.0 a 0
R4+++++++++++++++++++++++++++++++++++++++++++
int lo 0
ip add 4.4.4.4 255.255.255.255
int e0/0
no sh
int e0/0.34
en do 34
ip add 34.1.1.4 255.255.255.0
int e0/0.45
en do 45
ip add 45.1.1.4 255.255.255.0
router ospf 100
net 0.0.0.0 0.0.0.0 a 0
router bgp 345
no synchronization
bgp router-id 4.4.4.4
bgp log-neighbor-changes
neighbor PEER peer-group
neighbor PEER remote-as 345
neighbor PEER update-source Loopback0
neighbor PEER next-hop-self
neighbor 3.3.3.3 peer-group PEER
neighbor 5.5.5.5 peer-group PEER
no auto-summary
R5+++++++++++++++++++++++++++++++++++++++++++
int lo 0
ip add 5.5.5.5 255.255.255.255
int e0/0
no sh
int e0/0.45
en do 45
ip add 45.1.1.5 255.255.255.0
int e0/0.15
en do 15
ip add 15.1.1.5 255.255.255.0
router ospf 100
net 5.5.5.5 0.0.0.0 a 0
net 45.1.1.5 0.0.0.0 a 0
router ospf 100
router-id 5.5.5.5
log-adjacency-changes
network 5.5.5.5 0.0.0.0 area 0
network 45.1.1.5 0.0.0.0 area 0
!
router bgp 345
no synchronization
bgp router-id 5.5.5.5
bgp log-neighbor-changes
neighbor PEER peer-group
neighbor PEER remote-as 345
neighbor PEER update-source Loopback0
neighbor PEER next-hop-self
neighbor 3.3.3.3 peer-group PEER
neighbor 4.4.4.4 peer-group PEER
neighbor 15.1.1.1 remote-as 1
no auto-summary