1. 程式人生 > >CCNP-BGP基本配置 理解IBGP和EBGP 學會IBGP全互聯 學會用環回口建立EBGP鄰居

CCNP-BGP基本配置 理解IBGP和EBGP 學會IBGP全互聯 學會用環回口建立EBGP鄰居

interface Loopback0- ip address 2.2.2.2 255.255.255.0 interface Serial0/0--- ip address 12.1.1.2 255.255.255.0 interface Serial0/1--- ip address 24.1.1.2 255.255.255.0 interface Serial0/2--- ip address 23.1.1.2 255.255.255.0 router ospf 100  log-adjacency-changes  network 2.2.2.2 0.0.0.0 area 0  network 23.1.1.2 0.0.0.0 area 0  network 24.1.1.2 0.0.0.0 area 0 ! router bgp 200  no synchronization  bgp log-neighbor-changes  neighbor 1.1.1.1 remote-as 100  neighbor 1.1.1.1 ebgp-multihop 5 / / EBGP的預設TTL值為1,所以不能建立鄰居關係  neighbor 1.1.1.1 update-source Loopback0  neighbor 3.3.3.3 remote-as 200  neighbor 3.3.3.3 update-source Loopback0  neighbor 3.3.3.3 next-hop-self//通過EBGP得到的路由傳遞給IBGP鄰居時下一跳不改變  neighbor 4.4.4.4 remote-as 200  neighbor 4.4.4.4 update-source Loopback0  neighbor 4.4.4.4 next-hop-self  neighbor 5.5.5.5 remote-as 200  neighbor 5.5.5.5 update-source Loopback0  neighbor 5.5.5.5 next-hop-self  no auto-summary ! ip route 1.1.1.0 255.255.255.0 12.1.1.1 //
在配置中必須加上靜態路由或起IGP,保證兩者能互通 R3: interface Loopback0-  ip address 3.3.3.3 255.255.255.0 interface Serial0/0--  ip address 23.1.1.3 255.255.255.0 interface Serial0/1--  ip address 35.1.1.3 255.255.255.0 router ospf 100  log-adjacency-changes  network 3.3.3.3 0.0.0.0 area 0  network 23.1.1.3 0.0.0.0 area 0  network 35.1.1.3 0.0.0.0 area 0 ! router bgp 200  no synchronization  bgp log-neighbor-changes  neighbor 2.2.2.2 remote-as 200  neighbor 2.2.2.2 update-source Loopback0  neighbor 4.4.4.4 remote-as 200  neighbor 4.4.4.4 update-source Loopback0  neighbor 5.5.5.5 remote-as 200  neighbor 5.5.5.5 update-source Loopback0  no auto-summary R4: interface Loopback0-- ip address 4.4.4.4 255.255.255.0 interface Serial0/0--- ip address 24.1.1.4 255.255.255.0 interface Serial0/1--- ip address 45.1.1.4 255.255.255.0 ! router ospf 100  log-adjacency-changes  network 4.4.4.4 0.0.0.0 area 0  network 24.1.1.4 0.0.0.0 area 0  network 45.1.1.4 0.0.0.0 area 0 ! router bgp 200  no synchronization  bgp log-neighbor-changes  neighbor 2.2.2.2 remote-as 200  neighbor 2.2.2.2 update-source Loopback0  neighbor 3.3.3.3 remote-as 200  neighbor 3.3.3.3 update-source Loopback0  neighbor 5.5.5.5 remote-as 200  neighbor 5.5.5.5 update-source Loopback0  no auto-summary R5: interface Loopback0-- ip address 5.5.5.5 255.255.255.0 interface Serial0/0--- ip address 45.1.1.5 255.255.255.0 interface Serial0/1--- ip address 56.1.1.5 255.255.255.0 interface Serial0/2---  ip address 35.1.1.5 255.255.255.0 ! router ospf 100  log-adjacency-changes  network 5.5.5.5 0.0.0.0 area 0  network 35.1.1.5 0.0.0.0 area 0  network 45.1.1.5 0.0.0.0 area 0 ! router bgp 200  no synchronization  bgp log-neighbor-changes  neighbor 2.2.2.2 remote-as 200  neighbor 2.2.2.2 update-source Loopback0  neighbor 2.2.2.2 next-hop-self  neighbor 3.3.3.3 remote-as 200  neighbor 3.3.3.3 update-source Loopback0  neighbor 3.3.3.3 next-hop-self  neighbor 4.4.4.4 remote-as 200  neighbor 4.4.4.4 update-source Loopback0  neighbor 4.4.4.4 next-hop-self  neighbor 56.1.1.6 remote-as 300  no auto-summary R 6: