在ASBR2上宣告了PE2的loopbac 5.5.5.5 在PE1上的下一跳是正常的

ASBR2:

 

[ASBR2-bgp]dis ip rou
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 10       Routes : 10       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

        2.2.2.2/32  EBGP    255  1          RD   192.1.1.1       GigabitEthernet
0/0/0
        4.4.4.0/24  Direct  0    0           D   4.4.4.4         LoopBack0
        4.4.4.4/32  Direct  0    0           D   127.0.0.1       LoopBack0
        5.5.5.5/32  OSPF    10   1           D   162.1.1.2       Ethernet0/0/0
      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0
      162.1.1.0/24  Direct  0    0           D   162.1.1.1       Ethernet0/0/0
      162.1.1.1/32  Direct  0    0           D   127.0.0.1       Ethernet0/0/0
      192.1.1.0/24  Direct  0    0           D   192.1.1.2       GigabitEthernet
0/0/0
      192.1.1.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0

ASBR1上可以看到5.5.5.5正常学习到了:


<ASB
R1>
<ASBR1>dis bgp rou	
<ASBR1>dis bgp routing-table 

 BGP Local router ID is 3.3.3.3 
 Status codes: * - valid, > - best, d - damped,
               h - history,  i - internal, s - suppressed, S - Stale
               Origin : i - IGP, e - EGP, ? - incomplete


 Total Number of Routes: 2
      Network            NextHop        MED        LocPrf    PrefVal Path/Ogn

 *>   2.2.2.2/32         0.0.0.0         1                     0      i
 *>   5.5.5.5/32         192.1.1.2       1                     0      200i
<ASBR1>

PE1上学习了,而且下一跳也是正常没有问题:

<PE1>dis bgp routing-table 

 BGP Local router ID is 2.2.2.2 
 Status codes: * - valid, > - best, d - damped,
               h - history,  i - internal, s - suppressed, S - Stale
               Origin : i - IGP, e - EGP, ? - incomplete


 Total Number of Routes: 1
      Network            NextHop        MED        LocPrf    PrefVal Path/Ogn

 *>i  5.5.5.5/32         3.3.3.3         1          100        0      200i
<PE1>

反过来我把2.2.2.2这条路由在asbr1上宣告了:

bgp 100
 peer 2.2.2.2 as-number 100
 peer 2.2.2.2 connect-interface LoopBack0
 peer 192.1.1.2 as-number 200
 #
 ipv4-family unicast
  undo synchronization
  network 2.2.2.2 255.255.255.255
  peer 2.2.2.2 enable
  peer 2.2.2.2 route-policy policy2 export
  peer 2.2.2.2 label-route-capability
  peer 192.1.1.2 enable
  peer 192.1.1.2 route-policy policy1 export
  peer 192.1.1.2 label-route-capability
#

bgp路由表中也存在了

<ASBR1>dis bgp routing-table 

 BGP Local router ID is 3.3.3.3 
 Status codes: * - valid, > - best, d - damped,
               h - history,  i - internal, s - suppressed, S - Stale
               Origin : i - IGP, e - EGP, ? - incomplete


 Total Number of Routes: 2
      Network            NextHop        MED        LocPrf    PrefVal Path/Ogn

 *>   2.2.2.2/32         0.0.0.0         1                     0      i
 *>   5.5.5.5/32         192.1.1.2       1                     0      200i
<ASBR1>

asbr2正常学习到:

<ASBR2>dis bgp routing-table 

 BGP Local router ID is 4.4.4.4 
 Status codes: * - valid, > - best, d - damped,
               h - history,  i - internal, s - suppressed, S - Stale
               Origin : i - IGP, e - EGP, ? - incomplete


 Total Number of Routes: 2
      Network            NextHop        MED        LocPrf    PrefVal Path/Ogn

 *>   2.2.2.2/32         192.1.1.1       1                     0      100i
 *>   5.5.5.5/32         0.0.0.0         1                     0      i
<ASBR2>

可是到了PE2上因为下一跳的问题不进入路由表了

<PE2>dis bgp routing-table 

 BGP Local router ID is 5.5.5.5 
 Status codes: * - valid, > - best, d - damped,
               h - history,  i - internal, s - suppressed, S - Stale
               Origin : i - IGP, e - EGP, ? - incomplete


 Total Number of Routes: 1
      Network            NextHop        MED        LocPrf    PrefVal Path/Ogn

   i  2.2.2.2/32         192.1.1.1       1          100        0      100i
<PE2>

在asbr2上看看情况:

<ASBR2>dis bgp routing-table 2.2.2.2 

 BGP local router ID : 4.4.4.4
 Local AS number : 200
 Paths:   1 available, 1 best, 1 select
 BGP routing table entry information of 2.2.2.2/32:
 Label information (Received/Applied): 1029/NULL
 From: 192.1.1.1 (3.3.3.3)
 Route Duration: 00h06m23s  
 Direct Out-interface: GigabitEthernet0/0/0
 Relay Tunnel Out-Interface: GigabitEthernet0/0/0
 Relay token: 0x3
 Original nexthop: 192.1.1.1
 Qos information : 0x0
 AS-path 100, origin igp, MED 1, pref-val 0, valid, external, best, select, acti
ve, pre 255
 Advertised to such 1 peers:
    5.5.5.5
<ASBR2>

asbr1和asbr2上比较了一下这个
asbr1:

[ASBR1]dis bgp routing-table peer 2.2.2.2 advertised-routes 5.5.5.5 

 BGP local router ID : 3.3.3.3
 Local AS number : 100
 BGP routing table entry information of 5.5.5.5/32:
 Label information (Received/Applied): 1027/1028
 From: 192.1.1.2 (4.4.4.4)
 Route Duration: 00h25m35s  
 Direct Out-interface: GigabitEthernet0/0/0
 Relay Tunnel Out-Interface: GigabitEthernet0/0/0
 Relay token: 0x3
 Original nexthop: 192.1.1.2
 Advertised nexthop: 3.3.3.3
 Qos information : 0x0
 AS-path 200, origin igp, MED 1, localpref 100

asbr2:

<ASBR2>dis bgp routing-table peer 5.5.5.5 advertised-routes 2.2.2.2

 BGP local router ID : 4.4.4.4
 Local AS number : 200
 BGP routing table entry information of 2.2.2.2/32:
 Label information (Received/Applied): 1029/NULL
 From: 192.1.1.1 (3.3.3.3)
 Route Duration: 00h25m58s  
 Direct Out-interface: GigabitEthernet0/0/0
 Relay Tunnel Out-Interface: GigabitEthernet0/0/0
 Relay token: 0x3
 Original nexthop: 192.1.1.1
 Advertised nexthop: 192.1.1.1
 Qos information : 0x0
 AS-path 100, origin igp, MED 1, localpref 100
<ASBR2>

可以看到asbr1,asbr2这两个loopbackZD的区别是label infomation的区别了