发新话题
打印

BGP邻居的形成

本主题由 网络小菜鸟 于 2008-12-21 00:52 移动

BGP邻居的形成

R1------(-R2--------R3--------R4-)==============R5(一条串口,一条以太口)
AS10         OSPF AS20                                     AS 30





R1#show ip interface brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            unassigned      YES unset  administratively down down   
Serial1/0                  unassigned      YES unset  administratively down down   
Serial1/1                  10.10.12.1      YES manual up                    up      
Serial1/2                  unassigned      YES unset  administratively down down   
Serial1/3                  unassigned      YES unset  administratively down down   
Loopback0                  1.1.1.1         YES manual up                    up      
Loopback10                 172.16.10.1     YES manual up                    up      

R2#show ip interface brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            unassigned      YES unset  administratively down down   
Serial1/0                  10.10.12.2      YES manual up                    up      
Serial1/1                  10.10.23.2      YES manual up                    up      
Serial1/2                  unassigned      YES unset  administratively down down   
Serial1/3                  unassigned      YES unset  administratively down down   
Loopback0                  2.2.2.2         YES manual up                    up      

R2#show ip interface brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            unassigned      YES unset  administratively down down   
Serial1/0                  10.10.12.2      YES manual up                    up      
Serial1/1                  10.10.23.2      YES manual up                    up      
Serial1/2                  unassigned      YES unset  administratively down down   
Serial1/3                  unassigned      YES unset  administratively down down   
Loopback0                  2.2.2.2         YES manual up                    up      


R1:
router bgp 10
no synchronization
bgp router-id 1.1.1.1
bgp log-neighbor-changes
network 1.1.1.1 mask 255.255.255.255
network 172.16.10.1 mask 255.255.255.255
neighbor 10.10.12.2 remote-as 20
neighbor 10.10.12.2 ebgp-multihop 255
no auto-summary

R2:

router ospf 1
log-adjacency-changes
network 2.2.2.2 0.0.0.0 area 0
network 10.10.23.0 0.0.0.255 area 0
!
router bgp 20
no synchronization
bgp log-neighbor-changes
network 2.2.2.2 mask 255.255.255.255
neighbor 3.3.3.3 remote-as 20
neighbor 3.3.3.3 update-source Loopback0
neighbor 3.3.3.3 next-hop-self
neighbor 4.4.4.4 remote-as 20
neighbor 4.4.4.4 update-source Loopback0
neighbor 4.4.4.4 next-hop-self
neighbor 10.10.12.1 remote-as 10
neighbor 10.10.12.1 ebgp-multihop 255
no auto-summary

R3:

R3#show run | begin router
router ospf 1
log-adjacency-changes
network 3.3.3.3 0.0.0.0 area 0
network 10.10.23.0 0.0.0.255 area 0
network 10.10.34.0 0.0.0.255 area 0
!
router bgp 20
no synchronization
bgp log-neighbor-changes
network 3.3.3.3 mask 255.255.255.255
neighbor 2.2.2.2 remote-as 20
neighbor 2.2.2.2 update-source Loopback0
neighbor 4.4.4.4 remote-as 20
neighbor 4.4.4.4 update-source Loopback0
no auto-summary
!

R4:
router ospf 1
log-adjacency-changes
network 4.4.4.4 0.0.0.0 area 0
network 10.10.34.0 0.0.0.255 area 0
!
router bgp 20
no synchronization
bgp log-neighbor-changes
network 192.168.45.0
neighbor 2.2.2.2 remote-as 20
neighbor 2.2.2.2 update-source Loopback0
neighbor 2.2.2.2 next-hop-self
neighbor 3.3.3.3 remote-as 20
neighbor 3.3.3.3 update-source Loopback0
neighbor 3.3.3.3 next-hop-self
neighbor 5.5.5.5 remote-as 30
neighbor 5.5.5.5 ebgp-multihop 255
neighbor 5.5.5.5 update-source Loopback0
no auto-summary
!
ip classless
ip route 5.5.5.5 255.255.255.255 10.10.45.5
ip route 5.5.5.5 255.255.255.255 192.168.45.5
ip http server
!         
!   

R5:

R5#show run | begin router   
router bgp 30
no synchronization
bgp log-neighbor-changes
network 5.5.5.5 mask 255.255.255.255
neighbor 4.4.4.4 remote-as 20
neighbor 4.4.4.4 ebgp-multihop 255
neighbor 4.4.4.4 update-source Loopback0
no auto-summary
!
ip classless
ip route 4.4.4.4 255.255.255.255 192.168.45.4
ip route 4.4.4.4 255.255.255.255 10.10.45.4      


R1#show ip bgp summary
BGP router identifier 1.1.1.1, local AS number 10
BGP table version is 7, main routing table version 7
6 network entries using 582 bytes of memory
6 path entries using 216 bytes of memory
4 BGP path attribute entries using 240 bytes of memory
2 BGP AS-PATH entries using 48 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 1086 total bytes of memory
BGP activity 15/9 prefixes, 17/11 paths, scan interval 60 secs

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
10.10.12.2      4    20     102      92        7    0    0 00:13:32        4


R2#show ip bgp summary
BGP router identifier 2.2.2.2, local AS number 20
BGP table version is 13, main routing table version 13
6 network entries using 582 bytes of memory
6 path entries using 216 bytes of memory
4 BGP path attribute entries using 240 bytes of memory
2 BGP AS-PATH entries using 48 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 1086 total bytes of memory
BGP activity 15/9 prefixes, 16/10 paths, scan interval 60 secs

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
3.3.3.3         4    20     109     125       13    0    0 00:20:15        1
4.4.4.4         4    20     128     136       13    0    0 00:17:27        2
10.10.12.1      4    10      93     103       13    0    0 00:14:01        2

R3#show ip bgp summary
BGP router identifier 3.3.3.3, local AS number 20
BGP table version is 13, main routing table version 13
6 network entries using 582 bytes of memory
6 path entries using 216 bytes of memory
4 BGP path attribute entries using 240 bytes of memory
2 BGP AS-PATH entries using 48 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 1086 total bytes of memory
BGP activity 12/6 prefixes, 17/11 paths, scan interval 60 secs

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
2.2.2.2         4    20     125     109       13    0    0 00:20:42        3
4.4.4.4         4    20     117     102       13    0    0 00:17:54        2

R4#show ip bgp summary
BGP router identifier 4.4.4.4, local AS number 20
BGP table version is 9, main routing table version 9
6 network entries using 582 bytes of memory
6 path entries using 216 bytes of memory
4 BGP path attribute entries using 240 bytes of memory
2 BGP AS-PATH entries using 48 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 1086 total bytes of memory
BGP activity 16/10 prefixes, 17/11 paths, scan interval 60 secs

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
2.2.2.2         4    20     137     129        9    0    0 00:18:18        3
3.3.3.3         4    20     103     118        9    0    0 00:18:18        1
5.5.5.5         4    30      77      89        9    0    0 00:18:08        1

R5#show ip bgp summary
BGP router identifier 5.5.5.5, local AS number 30
BGP table version is 21, main routing table version 21
6 network entries using 582 bytes of memory
6 path entries using 216 bytes of memory
4 BGP path attribute entries using 240 bytes of memory
2 BGP AS-PATH entries using 48 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 1086 total bytes of memory
BGP activity 12/6 prefixes, 13/7 paths, scan interval 60 secs

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
4.4.4.4         4    20      89      77       21    0    0 00:18:29        5





R1#show ip bgp
BGP table version is 7, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 1.1.1.1/32       0.0.0.0                  0         32768 i
*> 2.2.2.2/32       10.10.12.2               0             0 20 i
*> 3.3.3.3/32       10.10.12.2                             0 20 i
*> 5.5.5.5/32       10.10.12.2                             0 20 30 i
*> 172.16.10.1/32   0.0.0.0                  0         32768 i

R2#show ip bgp   
  Network          Next Hop            Metric LocPrf Weight Path
*> 1.1.1.1/32       10.10.12.1               0             0 10 i
*> 2.2.2.2/32       0.0.0.0                  0         32768 i
*>i3.3.3.3/32       3.3.3.3                  0    100      0 i
*>i5.5.5.5/32       4.4.4.4                  0    100      0 30 i
*> 172.16.10.1/32   10.10.12.1               0             0 10 i
*>i192.168.45.0     4.4.4.4                  0    100      0 i

R3#show ip bgp
  Network          Next Hop            Metric LocPrf Weight Path
*>i1.1.1.1/32       2.2.2.2                  0    100      0 10 i
*>i2.2.2.2/32       2.2.2.2                  0    100      0 i
*> 3.3.3.3/32       0.0.0.0                  0         32768 i
*>i5.5.5.5/32       4.4.4.4                  0    100      0 30 i
*>i172.16.10.1/32   2.2.2.2                  0    100      0 10 i
*>i192.168.45.0     4.4.4.4                  0    100      0 i

R4#show ip bgp
  Network          Next Hop            Metric LocPrf Weight Path
*>i1.1.1.1/32       2.2.2.2                  0    100      0 10 i
*>i2.2.2.2/32       2.2.2.2                  0    100      0 i
*>i3.3.3.3/32       3.3.3.3                  0    100      0 i
*> 5.5.5.5/32       5.5.5.5                  0             0 30 i
*>i172.16.10.1/32   2.2.2.2                  0    100      0 10 i
*> 192.168.45.0     0.0.0.0                  0         32768 i

R5#show ip bgp
   Network          Next Hop            Metric LocPrf Weight Path
*> 1.1.1.1/32       4.4.4.4                                0 20 10 i
*> 2.2.2.2/32       4.4.4.4                                0 20 i
*> 3.3.3.3/32       4.4.4.4                                0 20 i
*> 5.5.5.5/32       0.0.0.0                  0         32768 i
*> 172.16.10.1/32   4.4.4.4                                0 20 10 i
*> 192.168.45.0     4.4.4.4                  0             0 20 i

欢迎大家指正错误,学习交流!!!

TOP

网段分别为: 10.10.12.0/25   10.10.23.0/24 10.10.34.0 /24    10.10.45.0/24
LOOP口:
R1:    1.1.1.1/32     172.16.10.1/32
R2:    2.2.2.2/32
R3:    3.3.3.3/32
R4:    4.4.4.4/32
R5: 5.5.5.5/32

TOP

发新话题
版块跳转