BGP选路

组网介绍

设备互联方式、互联接口地址如图所示,所有设备均创建Loopback0接口,IP地址为10.0.x.x/32,其中x为设备编号,所有设备都使用Loopback0地址作为BGP Router ID。

R1在AS100,R5在AS200,R2、R3、R4在AS64512。AS64512内运行OSPF,在互联接口(不包括连接外部AS的接口)、Loopback0接口上激活OSPF。

EBGP对等体关系基于直连接口建立,IBGP对等体关系基于Loopback0接口建立。

R1、R5上存在相同的网段172.16.1.0/24、172.16.2.0/24、172.16.3.0/24、172.16.4.0/24,在R1、R5上将其发布到BGP,以用于BGP路由优选。

任务思路

  1. 设备IP地址配置。
  2. 配置AS64512内的OSPF,在互联接口(不包含连接外部AS的接口)、Loopback0接口上激活OSPF。
  3. 按照规划配置BGP对等体,在R1、R5上将路由发布到BGP中。
  4. 在R1上通过路由策略修改BGP路由172.16.1.0/24的 AS_Path属性值,使得R3优选R5发布的BGP路由172.16.1.0/24。
  5. 在R4上通过路由策略修改BGP路由172.16.2.0/24的Local_Preference属性值,使得R3优选R4通告的BGP路由172.16.2.0/24。
  6. 在R2上通过路由策略修改BGP路由172.16.3.0/24的MED属性值,使得R3优选R5发布的BGP路由172.16.3.0/24。
  7. 在R3上通过路由策略修改BGP路由172.16.4.0/24的preferred-value属性值,使得R3优选R4通告的BGP路由172.16.4.0/24。

AR13

The device is running!
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys AR1
[AR1]int g0/0/0
[AR1-GigabitEthernet0/0/0]ip add 10.0.12.1 24
Jul 25 2024 21:27:19-08:00 AR1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
 on the interface GigabitEthernet0/0/0 has entered the UP state. 
[AR1-GigabitEthernet0/0/0]int lo0
[AR1-LoopBack0]ip add 10.0.1.1 32
[AR1-LoopBack0]int lo1
[AR1-LoopBack1]ip add 172.16.1.1 24
[AR1-LoopBack1]int lo2
[AR1-LoopBack2]ip add 172.16.2
[AR1-LoopBack2]int lo3
[AR1-LoopBack3]ip add 172.16.3
[AR1-LoopBack3]int lo4
[AR1-LoopBack4]ip add 172.16.4
[AR1-LoopBack4]q
[AR1]bgp 100
[AR1-bgp]rou	
[AR1-bgp]route-select
[AR1-bgp]router-id 10.0.1.1
[AR1-bgp]peer 10.0.12.2 as 64512
[AR1-bgp]
Jul 25 2024 21:41:40-08:00 AR1 %%01BGP/3/STATE_CHG_UPDOWN(l)[0]:The status of th
e peer 10.0.12.2 changed from OPENCONFIRM to ESTABLISHED. (InstanceName=Public, 
StateChangeReason=Up)  
[AR1-bgp]network 172.16.1.0 24
[AR1-bgp]network 172.16.2.0 24
[AR1-bgp]network 172.16.3.0 24
[AR1-bgp]network 172.16.4.0 24
[AR1-bgp]q
[AR1]ip ip-prefix 1 permit 172.16.1.0 24 greater-equal 24 less-equal 24
[AR1]route-policy hcip permit node 10
Info: New Sequence of this List.
[AR1-route-policy]if	
[AR1-route-policy]if-match ip	
[AR1-route-policy]if-match ip-prefix 1
[AR1-route-policy]apply as-path 300 400 additive
[AR1-route-policy]q
[AR1]route-policy hcip permit node 20
Info: New Sequence of this List.
[AR1-route-policy]q
[AR1]bgp 100
[AR1-bgp]peer 10.0.12.2 route-policy hcip export 
[AR1-bgp]q
[AR1]q
<AR1>refresh bgp all export
<AR1>
  Please check whether system data has been changed, and save data in time
  Configuration console time out, please press any key to log on
[AR1]int LoopBack 5
[AR1-LoopBack5]ip add 172.16.5.1 24
[AR1-LoopBack5]q
[AR1]bgp 100
[AR1-bgp]net 172.16.5.0 24
[AR1-bgp]undo network 172.16.5.0 24
[AR1-bgp]q
[AR1]ip ip-prefix 2 permit 172.16.5.0 24 greater-equal 24 less-equal 24
[AR1]route-policy origin permit node 10
Info: New Sequence of this List.
[AR1-route-policy]if-match ip-prefix 2
[AR1-route-policy]q
[AR1]bgp 100
[AR1-bgp]import-route direct route-policy origin 
[AR1-bgp]q
[AR1]int lo6
[AR1-LoopBack6] ip address 172.16.6.1 24
[AR1-LoopBack6]q
[AR1]bgp 100
[AR1-bgp]net 172.16.6.0 24
[AR1-bgp]q
<AR1>save
  The current configuration will be written to the device. 
  Are you sure to continue? (y/n)[n]:y
  It will take several minutes to save configuration file, please wait.......
  Configuration file had been saved successfully
  Note: The configuration file will take effect after being activated

AR14

The device is running!
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys AR2
[AR2]int g0/0/0
[AR2-GigabitEthernet0/0/0]ip add 10.0.12.2 24
Jul 25 2024 21:29:20-08:00 AR2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
 on the interface GigabitEthernet0/0/0 has entered the UP state. 
[AR2-GigabitEthernet0/0/0]int g0/0/1
[AR2-GigabitEthernet0/0/1]ip add 10.0.23.2 24
Jul 25 2024 21:29:33-08:00 AR2 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
 on the interface GigabitEthernet0/0/1 has entered the UP state. 
[AR2-GigabitEthernet0/0/1]int lo0
[AR2-LoopBack0]ip add 10.0.2.2 32
[AR2-LoopBack0]q
<AR2>ping -c 1 10.0.12.1
  PING 10.0.12.1: 56  data bytes, press CTRL_C to break
    Reply from 10.0.12.1: bytes=56 Sequence=1 ttl=255 time=120 ms
  --- 10.0.12.1 ping statistics ---
    1 packet(s) transmitted
    1 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 120/120/120 ms
<AR2>ping -c 1 10.0.23.3
  PING 10.0.23.3: 56  data bytes, press CTRL_C to break
    Reply from 10.0.23.3: bytes=56 Sequence=1 ttl=255 time=70 ms
  --- 10.0.23.3 ping statistics ---
    1 packet(s) transmitted
    1 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 70/70/70 ms
<AR2>sys
Enter system view, return user view with Ctrl+Z.
[AR2]ospf 1 router 10.0.2.2
[AR2-ospf-1]area 0
[AR2-ospf-1-area-0.0.0.0]network 10.0.2.2 0.0.0.0
[AR2-ospf-1-area-0.0.0.0]network 10.0.23.2 0.0.0.0
[AR2-ospf-1-area-0.0.0.0]
Jul 25 2024 21:37:37-08:00 AR2 %%01OSPF/4/NBR_CHANGE_E(l)[0]:Neighbor changes ev
ent: neighbor status changed. (ProcessId=256, NeighborAddress=3.23.0.10, Neighbo
rEvent=HelloReceived, NeighborPreviousState=Down, NeighborCurrentState=Init) 
[AR2-ospf-1-area-0.0.0.0]
Jul 25 2024 21:37:46-08:00 AR2 %%01OSPF/4/NBR_CHANGE_E(l)[1]:Neighbor changes ev
ent: neighbor status changed. (ProcessId=256, NeighborAddress=3.23.0.10, Neighbo
rEvent=2WayReceived, NeighborPreviousState=Init, NeighborCurrentState=ExStart) 
[AR2-ospf-1-area-0.0.0.0]
Jul 25 2024 21:37:46-08:00 AR2 %%01OSPF/4/NBR_CHANGE_E(l)[2]:Neighbor changes ev
ent: neighbor status changed. (ProcessId=256, NeighborAddress=3.23.0.10, Neighbo
rEvent=NegotiationDone, NeighborPreviousState=ExStart, NeighborCurrentState=Exch
ange) 
[AR2-ospf-1-area-0.0.0.0]
Jul 25 2024 21:37:46-08:00 AR2 %%01OSPF/4/NBR_CHANGE_E(l)[3]:Neighbor changes ev
ent: neighbor status changed. (ProcessId=256, NeighborAddress=3.23.0.10, Neighbo
rEvent=ExchangeDone, NeighborPreviousState=Exchange, NeighborCurrentState=Loadin
g) 
[AR2-ospf-1-area-0.0.0.0]
Jul 25 2024 21:37:46-08:00 AR2 %%01OSPF/4/NBR_CHANGE_E(l)[4]:Neighbor changes ev
ent: neighbor status changed. (ProcessId=256, NeighborAddress=3.23.0.10, Neighbo
rEvent=LoadingDone, NeighborPreviousState=Loading, NeighborCurrentState=Full) 
[AR2-ospf-1-area-0.0.0.0]q
[AR2-ospf-1]q
[AR2]bgp 64512
[AR2-bgp]router-id 10.0.2.2
[AR2-bgp]peer 10.0.3.3 as 64512
[AR2-bgp]peer 10.0.3.3 connect-interface l0
[AR2-bgp]peer 10.0.3.3 next-hop-local
[AR2-bgp]peer 10.0.12.1 as 100
[AR2-bgp]
Jul 25 2024 21:41:39-08:00 AR2 %%01BGP/3/STATE_CHG_UPDOWN(l)[5]:The status of th
e peer 10.0.12.1 changed from OPENCONFIRM to ESTABLISHED. (InstanceName=Public, 
StateChangeReason=Up)  
[AR2-bgp]
Jul 25 2024 21:42:25-08:00 AR2 %%01BGP/3/STATE_CHG_UPDOWN(l)[6]:The status of th
e peer 10.0.3.3 changed from OPENCONFIRM to ESTABLISHED. (InstanceName=Public, S
tateChangeReason=Up)  
[AR2-bgp]q
[AR2]display bgp peer 
 BGP local router ID : 10.0.2.2
 Local AS number : 64512
 Total number of peers : 2		  Peers in established state : 2
  Peer            V          AS  MsgRcvd  MsgSent  OutQ  Up/Down       State Pre
fRcv
  10.0.3.3        4       64512        3        5     0 00:01:18 Established    
   0
  10.0.12.1       4         100        4        4     0 00:02:04 Established    
   0
[AR2]ip ip-prefix 1 permit 172.16.3.0 24 greater-equal 24 less-equal 24
[AR2]route-policy hcip permit node 10
Info: New Sequence of this List.
[AR2-route-policy]if ip-prefix 1	
[AR2-route-policy]apply cost 200
[AR2-route-policy]q
[AR2]route-policy hcip permit node 20
Info: New Sequence of this List.
[AR2-route-policy]q
[AR2]bgp 64512	
[AR2-bgp]peer 10.0.12.1 route-policy hcip import 
[AR2-bgp]q
[AR2]q
<AR2>refresh bgp all import
<AR2>sys
Enter system view, return user view with Ctrl+Z.
[AR2]int lo1
[AR2-LoopBack1]ip add 10.2.2.2 0.0.0.0
Error: The specified IP address is invalid.
[AR2-LoopBack1]ip add 10.2.2.2 32
[AR2-LoopBack1]q
[AR2]ospf 1
[AR2-ospf-1]area 0
[AR2-ospf-1-area-0.0.0.0]net 10.2.2.2 0.0.0.0
[AR2-ospf-1-area-0.0.0.0]q
[AR2-ospf-1]q
[AR2]bgp 64512
[AR2-bgp]net 10.2.2.2 32
[AR2-bgp]
<AR2>display bgp routing-table 172.16.6.0 24
 BGP local router ID : 10.0.2.2
 Local AS number : 64512
 Paths:   2 available, 1 best, 1 select
 BGP routing table entry information of 172.16.6.0/24:
 From: 10.0.3.3 (10.0.3.3)
 Route Duration: 00h00m12s  
 Relay IP Nexthop: 10.0.23.3
 Relay IP Out-Interface: GigabitEthernet0/0/1
 Original nexthop: 10.0.3.3
 Qos information : 0x0
 AS-path Nil, origin igp, MED 0, localpref 100, pref-val 0, valid, internal, bes
t, select, active, pre 255, IGP cost 1
 Advertised to such 1 peers:
    10.0.12.1
 BGP routing table entry information of 172.16.6.0/24:
 From: 10.0.12.1 (10.0.1.1)
 Route Duration: 00h00m36s  
 Direct Out-interface: GigabitEthernet0/0/0
 Original nexthop: 10.0.12.1
 Qos information : 0x0
 AS-path 100, origin igp, MED 0, pref-val 0, valid, external, pre 255, not prefe
rred for AS-Path
 Not advertised to any peer yet
<AR2>display bgp routing-table 172.16.6.0 24
 BGP local router ID : 10.0.2.2
 Local AS number : 64512
 Paths:   2 available, 1 best, 1 select
 BGP routing table entry information of 172.16.6.0/24:
 From: 10.0.3.3 (10.0.3.3)
 Route Duration: 00h00m09s  
 Relay IP Nexthop: 10.0.23.3
 Relay IP Out-Interface: GigabitEthernet0/0/1
 Original nexthop: 10.0.3.3
 Qos information : 0x0
 AS-path Nil, origin igp, MED 0, localpref 100, pref-val 0, valid, internal, bes
t, select, active, pre 255, IGP cost 1
 Advertised to such 1 peers:
    10.0.12.1
 BGP routing table entry information of 172.16.6.0/24:
 From: 10.0.12.1 (10.0.1.1)
 Route Duration: 00h03m36s  
 Direct Out-interface: GigabitEthernet0/0/0
 Original nexthop: 10.0.12.1
 Qos information : 0x0
 AS-path 100, origin igp, MED 0, pref-val 0, valid, external, pre 255, not prefe
rred for AS-Path
 Not advertised to any peer yet
<AR2>display bgp routing-table 172.16.6.0 24
 BGP local router ID : 10.0.2.2
 Local AS number : 64512
 Paths:   2 available, 1 best, 1 select
 BGP routing table entry information of 172.16.6.0/24:
 From: 10.0.12.1 (10.0.1.1)
 Route Duration: 00h03m50s  
 Direct Out-interface: GigabitEthernet0/0/0
 Original nexthop: 10.0.12.1
 Qos information : 0x0
 AS-path 100, origin igp, MED 0, pref-val 0, valid, external, best, select, acti
ve, pre 255
 Advertised to such 1 peers:
    10.0.3.3
 BGP routing table entry information of 172.16.6.0/24:
 From: 10.0.3.3 (10.0.3.3)
 Route Duration: 00h00m07s  
 Relay IP Nexthop: 10.0.23.3
 Relay IP Out-Interface: GigabitEthernet0/0/1
 Original nexthop: 10.0.3.3
 Qos information : 0x0
 AS-path 300, origin igp, MED 0, localpref 100, pref-val 0, valid, internal, pre
 255, IGP cost 1, not preferred for peer type
 Not advertised to any peer yet
<AR2>sys
Enter system view, return user view with Ctrl+Z.
[AR2]bgp 64512
[AR2-bgp]peer 10.0.4.4 as 64512
[AR2-bgp]peer 10.0.4.4 con	
[AR2-bgp]peer 10.0.4.4 connect-interface lo0
[AR2-bgp]
Jul 25 2024 22:17:11-08:00 AR2 %%01BGP/3/STATE_CHG_UPDOWN(l)[0]:The status of th
e peer 10.0.4.4 changed from OPENCONFIRM to ESTABLISHED. (InstanceName=Public, S
tateChangeReason=Up)  
[AR2-bgp]q
[AR2]int lo7
[AR2-LoopBack7]ip add 172.16.7.1 24
[AR2-LoopBack7]q
[AR2]bgp 64512
[AR2-bgp]net 172.16.7.0 24
[AR2-bgp]q
[AR2]q
<AR2>save
  The current configuration will be written to the device. 
  Are you sure to continue? (y/n)[n]:y
  It will take several minutes to save configuration file, please wait.......
  Configuration file had been saved successfully
  Note: The configuration file will take effect after being activated

AR15

The device is running!
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys AR3
[AR3]int lo0
[AR3-LoopBack0]ip add 10.0.3.3 32
[AR3-LoopBack0]int g0/0/1
[AR3-GigabitEthernet0/0/1]ip add 10.0.23.3 24
Jul 25 2024 21:30:52-08:00 AR3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
 on the interface GigabitEthernet0/0/1 has entered the UP state. 
[AR3-GigabitEthernet0/0/1]int g0/0/2
[AR3-GigabitEthernet0/0/2]ip add 10.0.34.3 24
Jul 25 2024 21:31:05-08:00 AR3 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
 on the interface GigabitEthernet0/0/2 has entered the UP state. 
[AR3-GigabitEthernet0/0/2]q
[AR3]ospf 1 router-id 10.0.3.3
[AR3-ospf-1]area 0
[AR3-ospf-1-area-0.0.0.0]network 10.0.3.3 0.0.0.0
[AR3-ospf-1-area-0.0.0.0] network 10.0.23.3 0.0.0.0
[AR3-ospf-1-area-0.0.0.0]network 10.0.34.3 0.0.0.0
[AR3-ospf-1-area-0.0.0.0]
Jul 25 2024 21:37:45-08:00 AR3 %%01OSPF/4/NBR_CHANGE_E(l)[0]:Neighbor changes ev
ent: neighbor status changed. (ProcessId=256, NeighborAddress=2.23.0.10, Neighbo
rEvent=HelloReceived, NeighborPreviousState=Down, NeighborCurrentState=Init) 
[AR3-ospf-1-area-0.0.0.0]
Jul 25 2024 21:37:45-08:00 AR3 %%01OSPF/4/NBR_CHANGE_E(l)[1]:Neighbor changes ev
ent: neighbor status changed. (ProcessId=256, NeighborAddress=2.23.0.10, Neighbo
rEvent=2WayReceived, NeighborPreviousState=Init, NeighborCurrentState=2Way) 
[AR3-ospf-1-area-0.0.0.0]
Jul 25 2024 21:37:45-08:00 AR3 %%01OSPF/4/NBR_CHANGE_E(l)[2]:Neighbor changes ev
ent: neighbor status changed. (ProcessId=256, NeighborAddress=2.23.0.10, Neighbo
rEvent=AdjOk?, NeighborPreviousState=2Way, NeighborCurrentState=ExStart) 
[AR3-ospf-1-area-0.0.0.0]
Jul 25 2024 21:37:45-08:00 AR3 %%01OSPF/4/NBR_CHANGE_E(l)[3]:Neighbor changes ev
ent: neighbor status changed. (ProcessId=256, NeighborAddress=2.23.0.10, Neighbo
rEvent=NegotiationDone, NeighborPreviousState=ExStart, NeighborCurrentState=Exch
ange) 
[AR3-ospf-1-area-0.0.0.0]
Jul 25 2024 21:37:45-08:00 AR3 %%01OSPF/4/NBR_CHANGE_E(l)[4]:Neighbor changes ev
ent: neighbor status changed. (ProcessId=256, NeighborAddress=2.23.0.10, Neighbo
rEvent=ExchangeDone, NeighborPreviousState=Exchange, NeighborCurrentState=Loadin
g) 
[AR3-ospf-1-area-0.0.0.0]
Jul 25 2024 21:37:45-08:00 AR3 %%01OSPF/4/NBR_CHANGE_E(l)[5]:Neighbor changes ev
ent: neighbor status changed. (ProcessId=256, NeighborAddress=2.23.0.10, Neighbo
rEvent=LoadingDone, NeighborPreviousState=Loading, NeighborCurrentState=Full) 
[AR3-ospf-1-area-0.0.0.0]
Jul 25 2024 21:38:18-08:00 AR3 %%01OSPF/4/NBR_CHANGE_E(l)[6]:Neighbor changes ev
ent: neighbor status changed. (ProcessId=256, NeighborAddress=4.34.0.10, Neighbo
rEvent=HelloReceived, NeighborPreviousState=Down, NeighborCurrentState=Init) 
[AR3-ospf-1-area-0.0.0.0]
Jul 25 2024 21:38:21-08:00 AR3 %%01OSPF/4/NBR_CHANGE_E(l)[7]:Neighbor changes ev
ent: neighbor status changed. (ProcessId=256, NeighborAddress=4.34.0.10, Neighbo
rEvent=2WayReceived, NeighborPreviousState=Init, NeighborCurrentState=ExStart) 
[AR3-ospf-1-area-0.0.0.0]
Jul 25 2024 21:38:21-08:00 AR3 %%01OSPF/4/NBR_CHANGE_E(l)[8]:Neighbor changes ev
ent: neighbor status changed. (ProcessId=256, NeighborAddress=4.34.0.10, Neighbo
rEvent=NegotiationDone, NeighborPreviousState=ExStart, NeighborCurrentState=Exch
ange) 
[AR3-ospf-1-area-0.0.0.0]
Jul 25 2024 21:38:21-08:00 AR3 %%01OSPF/4/NBR_CHANGE_E(l)[9]:Neighbor changes ev
ent: neighbor status changed. (ProcessId=256, NeighborAddress=4.34.0.10, Neighbo
rEvent=ExchangeDone, NeighborPreviousState=Exchange, NeighborCurrentState=Loadin
g) 
[AR3-ospf-1-area-0.0.0.0]
Jul 25 2024 21:38:21-08:00 AR3 %%01OSPF/4/NBR_CHANGE_E(l)[10]:Neighbor changes e
vent: neighbor status changed. (ProcessId=256, NeighborAddress=4.34.0.10, Neighb
orEvent=LoadingDone, NeighborPreviousState=Loading, NeighborCurrentState=Full) 
[AR3-ospf-1-area-0.0.0.0]q
[AR3-ospf-1]q
[AR3]display ospf peer brief 
	 OSPF Process 1 with Router ID 10.0.3.3
		  Peer Statistic Information
 ----------------------------------------------------------------------------
 Area Id          Interface                        Neighbor id      State    
 0.0.0.0          GigabitEthernet0/0/1             10.0.2.2         Full        
 0.0.0.0          GigabitEthernet0/0/2             10.0.4.4         Full        
 ----------------------------------------------------------------------------
[AR3]display ospf routing 
	 OSPF Process 1 with Router ID 10.0.3.3
		  Routing Tables 
 Routing for Network 
 Destination        Cost  Type       NextHop         AdvRouter       Area
 10.0.3.3/32        0     Stub       10.0.3.3        10.0.3.3        0.0.0.0
 10.0.23.0/24       1     Transit    10.0.23.3       10.0.3.3        0.0.0.0
 10.0.34.0/24       1     Transit    10.0.34.3       10.0.3.3        0.0.0.0
 10.0.2.2/32        1     Stub       10.0.23.2       10.0.2.2        0.0.0.0
 10.0.4.4/32        1     Stub       10.0.34.4       10.0.4.4        0.0.0.0
 Total Nets: 5  
 Intra Area: 5  Inter Area: 0  ASE: 0  NSSA: 0 
[AR3]bgp 64512
[AR3-bgp]router-id 10.0.3.3
[AR3-bgp]peer 10.0.2.2 as-number 64512
[AR3-bgp]peer 10.0.2.2 connect-interface LoopBack0
[AR3-bgp]peer 10.0.4.4 as-number 64512
[AR3-bgp] peer 10.0.4.4 connect-interface LoopBack0
[AR3-bgp]
Jul 25 2024 21:42:25-08:00 AR3 %%01BGP/3/STATE_CHG_UPDOWN(l)[11]:The status of t
he peer 10.0.2.2 changed from OPENCONFIRM to ESTABLISHED. (InstanceName=Public, 
StateChangeReason=Up)  
[AR3-bgp]
Jul 25 2024 21:43:21-08:00 AR3 %%01BGP/3/STATE_CHG_UPDOWN(l)[12]:The status of t
he peer 10.0.4.4 changed from OPENCONFIRM to ESTABLISHED. (InstanceName=Public, 
StateChangeReason=Up)  
[AR3-bgp]q
[AR3]display bgp routing-table
 BGP Local router ID is 10.0.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: 8
      Network            NextHop        MED        LocPrf    PrefVal Path/Ogn
 *>i  172.16.1.0/24      10.0.2.2        0          100        0      100i
 * i                     10.0.4.4        0          100        0      200i
 *>i  172.16.2.0/24      10.0.2.2        0          100        0      100i
 * i                     10.0.4.4        0          100        0      200i
 *>i  172.16.3.0/24      10.0.2.2        0          100        0      100i
 * i                     10.0.4.4        0          100        0      200i
 *>i  172.16.4.0/24      10.0.2.2        0          100        0      100i
 * i                     10.0.4.4        0          100        0      200i
<AR3>display bgp routing-table 172.16.1.0 24
 BGP local router ID : 10.0.3.3
 Local AS number : 64512
 Paths:   2 available, 1 best, 1 select
 BGP routing table entry information of 172.16.1.0/24:
 From: 10.0.2.2 (10.0.2.2)
 Route Duration: 00h06m54s  
 Relay IP Nexthop: 10.0.23.2
 Relay IP Out-Interface: GigabitEthernet0/0/1
 Original nexthop: 10.0.2.2
 Qos information : 0x0
 AS-path 100, origin igp, MED 0, localpref 100, pref-val 0, valid, internal, bes
t, select, active, pre 255, IGP cost 1
 Not advertised to any peer yet
 BGP routing table entry information of 172.16.1.0/24:
 From: 10.0.4.4 (10.0.4.4)
 Route Duration: 00h06m06s  
 Relay IP Nexthop: 10.0.34.4
 Relay IP Out-Interface: GigabitEthernet0/0/2
 Original nexthop: 10.0.4.4
 Qos information : 0x0
 AS-path 200, origin igp, MED 0, localpref 100, pref-val 0, valid, internal, pre
 255, IGP cost 1, not preferred for router ID
 Not advertised to any peer yet
<AR3>display bgp routing-table 172.16.1.0 24
 BGP local router ID : 10.0.3.3
 Local AS number : 64512
 Paths:   2 available, 1 best, 1 select
 BGP routing table entry information of 172.16.1.0/24:
 From: 10.0.4.4 (10.0.4.4)
 Route Duration: 00h07m37s  
 Relay IP Nexthop: 10.0.34.4
 Relay IP Out-Interface: GigabitEthernet0/0/2
 Original nexthop: 10.0.4.4
 Qos information : 0x0
 AS-path 200, origin igp, MED 0, localpref 100, pref-val 0, valid, internal, bes
t, select, active, pre 255, IGP cost 1
 Not advertised to any peer yet
 BGP routing table entry information of 172.16.1.0/24:
 From: 10.0.2.2 (10.0.2.2)
 Route Duration: 00h01m30s  
 Relay IP Nexthop: 10.0.23.2
 Relay IP Out-Interface: GigabitEthernet0/0/1
 Original nexthop: 10.0.2.2
 Qos information : 0x0
 AS-path 100 300 400, origin igp, MED 0, localpref 100, pref-val 0, valid, inter
nal, pre 255, IGP cost 1, not preferred for AS-Path
 Not advertised to any peer yet
<AR3>display bgp routing-table 172.16.2.0 24
 BGP local router ID : 10.0.3.3
 Local AS number : 64512
 Paths:   2 available, 1 best, 1 select
 BGP routing table entry information of 172.16.2.0/24:
 From: 10.0.2.2 (10.0.2.2)
 Route Duration: 00h10m07s  
 Relay IP Nexthop: 10.0.23.2
 Relay IP Out-Interface: GigabitEthernet0/0/1
 Original nexthop: 10.0.2.2
 Qos information : 0x0
 AS-path 100, origin igp, MED 0, localpref 100, pref-val 0, valid, internal, bes
t, select, active, pre 255, IGP cost 1
 Not advertised to any peer yet
 BGP routing table entry information of 172.16.2.0/24:
 From: 10.0.4.4 (10.0.4.4)
 Route Duration: 00h00m10s  
 Relay IP Nexthop: 10.0.34.4
 Relay IP Out-Interface: GigabitEthernet0/0/2
 Original nexthop: 10.0.4.4
 Qos information : 0x0
 AS-path 200, origin igp, MED 0, localpref 100, pref-val 0, valid, internal, pre
 255, IGP cost 1, not preferred for router ID
 Not advertised to any peer yet
<AR3>display bgp routing-table 172.16.2.0 24
 BGP local router ID : 10.0.3.3
 Local AS number : 64512
 Paths:   2 available, 1 best, 1 select
 BGP routing table entry information of 172.16.2.0/24:
 From: 10.0.4.4 (10.0.4.4)
 Route Duration: 00h00m28s  
 Relay IP Nexthop: 10.0.34.4
 Relay IP Out-Interface: GigabitEthernet0/0/2
 Original nexthop: 10.0.4.4
 Qos information : 0x0
 AS-path 200, origin igp, MED 0, localpref 200, pref-val 0, valid, internal, bes
t, select, active, pre 255, IGP cost 1
 Not advertised to any peer yet
 BGP routing table entry information of 172.16.2.0/24:
 From: 10.0.2.2 (10.0.2.2)
 Route Duration: 00h10m41s  
 Relay IP Nexthop: 10.0.23.2
 Relay IP Out-Interface: GigabitEthernet0/0/1
 Original nexthop: 10.0.2.2
 Qos information : 0x0
 AS-path 100, origin igp, MED 0, localpref 100, pref-val 0, valid, internal, pre
 255, IGP cost 1, not preferred for Local_Pref
 Not advertised to any peer yet
<AR3>sys
Enter system view, return user view with Ctrl+Z.
[AR3]bgp 64512
[AR3-bgp]compare-different-as-med
[AR3-bgp]q
[AR3]q
<AR3>display bgp routing-table 172.16.3.0 24
 BGP local router ID : 10.0.3.3
 Local AS number : 64512
 Paths:   2 available, 1 best, 1 select
 BGP routing table entry information of 172.16.3.0/24:
 From: 10.0.4.4 (10.0.4.4)
 Route Duration: 00h02m35s  
 Relay IP Nexthop: 10.0.34.4
 Relay IP Out-Interface: GigabitEthernet0/0/2
 Original nexthop: 10.0.4.4
 Qos information : 0x0
 AS-path 200, origin igp, MED 0, localpref 100, pref-val 0, valid, internal, bes
t, select, active, pre 255, IGP cost 1
 Not advertised to any peer yet
 BGP routing table entry information of 172.16.3.0/24:
 From: 10.0.2.2 (10.0.2.2)
 Route Duration: 00h00m41s  
 Relay IP Nexthop: 10.0.23.2
 Relay IP Out-Interface: GigabitEthernet0/0/1
 Original nexthop: 10.0.2.2
 Qos information : 0x0
 AS-path 100, origin igp, MED 200, localpref 100, pref-val 0, valid, internal, p
re 255, IGP cost 1, not preferred for MED
 Not advertised to any peer yet
<AR3>sys
Enter system view, return user view with Ctrl+Z.
[AR3]ip ip-prefix 1 permit 172.16.4.0 24 greater-equal 24 less-equal 24
[AR3]route-policy hcip permit node 10
Info: New Sequence of this List.
[AR3-route-policy]if ip-prefix 1
[AR3-route-policy]apply preferred-value 300
[AR3-route-policy]q
[AR3]route-policy hcip permit node 20
Info: New Sequence of this List.
[AR3-route-policy]q
[AR3]bgp 64512
[AR3-bgp]peer 10.0.4.4 route-policy hcip import 
[AR3-bgp]q
[AR3]q
<AR3>refresh bgp all import
<AR3>display bgp routing-table 172.16.4.0 24
 BGP local router ID : 10.0.3.3
 Local AS number : 64512
 Paths:   2 available, 1 best, 1 select
 BGP routing table entry information of 172.16.4.0/24:
 From: 10.0.4.4 (10.0.4.4)
 Route Duration: 00h00m11s  
 Relay IP Nexthop: 10.0.34.4
 Relay IP Out-Interface: GigabitEthernet0/0/2
 Original nexthop: 10.0.4.4
 Qos information : 0x0
 AS-path 200, origin igp, MED 0, localpref 100, pref-val 300, valid, internal, b
est, select, active, pre 255, IGP cost 1
 Not advertised to any peer yet
 BGP routing table entry information of 172.16.4.0/24:
 From: 10.0.2.2 (10.0.2.2)
 Route Duration: 00h00m11s  
 Relay IP Nexthop: 10.0.23.2
 Relay IP Out-Interface: GigabitEthernet0/0/1
 Original nexthop: 10.0.2.2
 Qos information : 0x0
 AS-path 100, origin igp, MED 0, localpref 100, pref-val 0, valid, internal, pre
 255, IGP cost 1, not preferred for PreVal
 Not advertised to any peer yet
<AR3>display bgp routing-table
 BGP Local router ID is 10.0.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: 8
      Network            NextHop        MED        LocPrf    PrefVal Path/Ogn
 *>i  172.16.1.0/24      10.0.4.4        0          100        0      200i
 * i                     10.0.2.2        0          100        0      100 300 40
0i
 *>i  172.16.2.0/24      10.0.4.4        0          200        0      200i
 * i                     10.0.2.2        0          100        0      100i
 *>i  172.16.3.0/24      10.0.4.4        0          100        0      200i
 * i                     10.0.2.2        200        100        0      100i
 *>i  172.16.4.0/24      10.0.4.4        0          100        300    200i
 * i                     10.0.2.2        0          100        0      100i
<AR3>display ospf routing 10.2.2.2
	 OSPF Process 1 with Router ID 10.0.3.3
 Destination : 10.2.2.2/32        
 AdverRouter : 10.0.2.2                 Area      : 0.0.0.0  
 Cost        : 1                        Type      : Stub 
 NextHop     : 10.0.23.2                Interface : GigabitEthernet0/0/1  
 Priority    : Medium                   Age       : 00h00m12s  
<AR3>sys
Enter system view, return user view with Ctrl+Z.
[AR3]bgp 64512
[AR3-bgp]net 10.2.2.2 32
[AR3-bgp]q
[AR3]display bgp routing-table 10.2.2.2 32
 BGP local router ID : 10.0.3.3
 Local AS number : 64512
 Paths:   2 available, 1 best, 1 select
 BGP routing table entry information of 10.2.2.2/32:
 Network route. 
 From: 0.0.0.0 (0.0.0.0)
 Route Duration: 00h00m11s  
 Direct Out-interface: GigabitEthernet0/0/1
 Original nexthop: 10.0.23.2
 Qos information : 0x0
 AS-path Nil, origin igp, MED 1, pref-val 0, valid, local, best, select, pre 10
 Advertised to such 2 peers:
    10.0.4.4
    10.0.2.2
 BGP routing table entry information of 10.2.2.2/32:
 From: 10.0.2.2 (10.0.2.2)
 Route Duration: 00h00m31s  
 Relay IP Nexthop: 10.0.23.2
 Relay IP Out-Interface: GigabitEthernet0/0/1
 Original nexthop: 10.0.2.2
 Qos information : 0x0
 AS-path Nil, origin igp, MED 0, localpref 100, pref-val 0, valid, internal, pre
 255, IGP cost 1, not preferred for route type
 Not advertised to any peer yet
<AR3>display bgp routing-table 
 BGP Local router ID is 10.0.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: 12
      Network            NextHop        MED        LocPrf    PrefVal Path/Ogn
 *>   10.2.2.2/32        0.0.0.0         1                     0      i
 * i                     10.0.2.2        0          100        0      i
 *>i  172.16.1.0/24      10.0.4.4        0          100        0      200i
 * i                     10.0.2.2        0          100        0      100 300 40
0i
 *>i  172.16.2.0/24      10.0.4.4        0          200        0      200i
 * i                     10.0.2.2        0          100        0      100i
 *>i  172.16.3.0/24      10.0.4.4        0          100        0      200i
 * i                     10.0.2.2        200        100        0      100i
 *>i  172.16.4.0/24      10.0.4.4        0          100        300    200i
 * i                     10.0.2.2        0          100        0      100i
 *>i  172.16.5.0/24      10.0.2.2        0          100        0      100i
 * i                     10.0.4.4        0          100        0      200i
<AR3>display bgp routing-table 172.16.5.0 24
 BGP local router ID : 10.0.3.3
 Local AS number : 64512
 Paths:   2 available, 1 best, 1 select
 BGP routing table entry information of 172.16.5.0/24:
 From: 10.0.4.4 (10.0.4.4)
 Route Duration: 00h02m04s  
 Relay IP Nexthop: 10.0.34.4
 Relay IP Out-Interface: GigabitEthernet0/0/2
 Original nexthop: 10.0.4.4
 Qos information : 0x0
 AS-path 200, origin igp, MED 0, localpref 100, pref-val 0, valid, internal, bes
t, select, active, pre 255, IGP cost 1
 Not advertised to any peer yet
 BGP routing table entry information of 172.16.5.0/24:
 From: 10.0.2.2 (10.0.2.2)
 Route Duration: 00h00m12s  
 Relay IP Nexthop: 10.0.23.2
 Relay IP Out-Interface: GigabitEthernet0/0/1
 Original nexthop: 10.0.2.2
 Qos information : 0x0
 AS-path 100, origin incomplete, MED 0, localpref 100, pref-val 0, valid, intern
al, pre 255, IGP cost 1, not preferred for Origin
 Not advertised to any peer yet
<AR3>sys
Enter system view, return user view with Ctrl+Z.
[AR3]int lo6
[AR3-LoopBack6]ip address 172.16.6.1 24
[AR3-LoopBack6]q
[AR3]bgp 64512
[AR3-bgp]net 172.16.6.0 24
[AR3-bgp]q
[AR3]ip ip-prefix 2 permit 172.16.6.0 24 greater-equal 24 less-equal 24
[AR3]route-policy as_path permit node 10
Info: New Sequence of this List.
[AR3-route-policy]if ip-prefix 2
[AR3-route-policy]apply as-path 300 additive 
[AR3-route-policy]q
[AR3]route-policy as_path permit node 20
Info: New Sequence of this List.
[AR3-route-policy]q
[AR3]bgp 64512	
[AR3-bgp]peer 10.0.2.2 route-policy as_path export 
[AR3-bgp]q
[AR3]q
<AR3>refresh bgp all export
<AR3>sys
Enter system view, return user view with Ctrl+Z.
[AR3]int lo7
[AR3-LoopBack7]ip add 172.16.7.1 24
[AR3-LoopBack7]q
[AR3]bgp 64512
[AR3-bgp]net 172.16.7.0 24
[AR3-bgp]q
[AR3]q
<AR3>save
  The current configuration will be written to the device. 
  Are you sure to continue? (y/n)[n]:y
  It will take several minutes to save configuration file, please wait.......
  Configuration file had been saved successfully
  Note: The configuration file will take effect after being activated

AR16

The device is running!
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys AR4
[AR4]int lo0
[AR4-LoopBack0]ip add 10.0.4.4 32
[AR4-LoopBack0]int g0/0/2
[AR4-GigabitEthernet0/0/2]ip add 10.0.34.4 24
Jul 25 2024 21:31:51-08:00 AR4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
 on the interface GigabitEthernet0/0/2 has entered the UP state. 
[AR4-GigabitEthernet0/0/2]int g0/0/0
[AR4-GigabitEthernet0/0/0]ip add 10.0.45。4 24
Jul 25 2024 21:32:02-08:00 AR4 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
 on the interface GigabitEthernet0/0/0 has entered the UP state. 
[AR4-GigabitEthernet0/0/0]q
[AR4]ping -c 1 10.0.34.3
  PING 10.0.34.3: 56  data bytes, press CTRL_C to break
    Reply from 10.0.34.3: bytes=56 Sequence=1 ttl=255 time=80 ms
  --- 10.0.34.3 ping statistics ---
    1 packet(s) transmitted
    1 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 80/80/80 ms
[AR4]ping -c 1 10.0.45.5
  PING 10.0.45.5: 56  data bytes, press CTRL_C to break
    Reply from 10.0.45.5: bytes=56 Sequence=1 ttl=255 time=70 ms
  --- 10.0.45.5 ping statistics ---
    1 packet(s) transmitted
    1 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 70/70/70 ms
[AR4]ospf 1 router-id 10.0.4.4
[AR4-ospf-1]area 0
[AR4-ospf-1-area-0.0.0.0]network 10.0.4.4 0.0.0.0
[AR4-ospf-1-area-0.0.0.0]network 10.0.34.4 0.0.0.0
[AR4-ospf-1-area-0.0.0.0]
Jul 25 2024 21:38:21-08:00 AR4 %%01OSPF/4/NBR_CHANGE_E(l)[2]:Neighbor changes ev
ent: neighbor status changed. (ProcessId=256, NeighborAddress=3.34.0.10, Neighbo
rEvent=HelloReceived, NeighborPreviousState=Down, NeighborCurrentState=Init) 
[AR4-ospf-1-area-0.0.0.0]
Jul 25 2024 21:38:21-08:00 AR4 %%01OSPF/4/NBR_CHANGE_E(l)[3]:Neighbor changes ev
ent: neighbor status changed. (ProcessId=256, NeighborAddress=3.34.0.10, Neighbo
rEvent=2WayReceived, NeighborPreviousState=Init, NeighborCurrentState=2Way) 
[AR4-ospf-1-area-0.0.0.0]
Jul 25 2024 21:38:21-08:00 AR4 %%01OSPF/4/NBR_CHANGE_E(l)[4]:Neighbor changes ev
ent: neighbor status changed. (ProcessId=256, NeighborAddress=3.34.0.10, Neighbo
rEvent=AdjOk?, NeighborPreviousState=2Way, NeighborCurrentState=ExStart) 
[AR4-ospf-1-area-0.0.0.0]
Jul 25 2024 21:38:21-08:00 AR4 %%01OSPF/4/NBR_CHANGE_E(l)[5]:Neighbor changes ev
ent: neighbor status changed. (ProcessId=256, NeighborAddress=3.34.0.10, Neighbo
rEvent=NegotiationDone, NeighborPreviousState=ExStart, NeighborCurrentState=Exch
ange) 
[AR4-ospf-1-area-0.0.0.0]
Jul 25 2024 21:38:21-08:00 AR4 %%01OSPF/4/NBR_CHANGE_E(l)[6]:Neighbor changes ev
ent: neighbor status changed. (ProcessId=256, NeighborAddress=3.34.0.10, Neighbo
rEvent=ExchangeDone, NeighborPreviousState=Exchange, NeighborCurrentState=Loadin
g) 
[AR4-ospf-1-area-0.0.0.0]
Jul 25 2024 21:38:21-08:00 AR4 %%01OSPF/4/NBR_CHANGE_E(l)[7]:Neighbor changes ev
ent: neighbor status changed. (ProcessId=256, NeighborAddress=3.34.0.10, Neighbo
rEvent=LoadingDone, NeighborPreviousState=Loading, NeighborCurrentState=Full) 
[AR4-ospf-1-area-0.0.0.0]q
[AR4-ospf-1]q
[AR4]bgp 64512
[AR4-bgp] router-id 10.0.4.4
[AR4-bgp]peer 10.0.3.3 as-number 64512
[AR4-bgp] peer 10.0.3.3 connect-interface LoopBack0
[AR4-bgp]peer 10.0.3.3 next-hop-local
[AR4-bgp]peer 10.0.45.5 as-number 200
[AR4-bgp]
Jul 25 2024 21:43:22-08:00 AR4 %%01BGP/3/STATE_CHG_UPDOWN(l)[8]:The status of th
e peer 10.0.3.3 changed from OPENCONFIRM to ESTABLISHED. (InstanceName=Public, S
tateChangeReason=Up)  
[AR4-bgp]q
[AR4]display bgp peer 
 BGP local router ID : 10.0.4.4
 Local AS number : 64512
 Total number of peers : 2		  Peers in established state : 1
  Peer            V          AS  MsgRcvd  MsgSent  OutQ  Up/Down       State Pre
fRcv
  10.0.3.3        4       64512        2        2     0 00:00:30 Established    
   0
  10.0.45.5       4         200        0        1     0 00:00:44      Active    
   0
[AR4]
Jul 25 2024 21:44:02-08:00 AR4 %%01BGP/3/STATE_CHG_UPDOWN(l)[9]:The status of th
e peer 10.0.45.5 changed from OPENCONFIRM to ESTABLISHED. (InstanceName=Public, 
StateChangeReason=Up)  
[AR4]display bgp peer 
 BGP local router ID : 10.0.4.4
 Local AS number : 64512
 Total number of peers : 2		  Peers in established state : 2
  Peer            V          AS  MsgRcvd  MsgSent  OutQ  Up/Down       State Pre
fRcv
  10.0.3.3        4       64512        2        2     0 00:00:45 Established    
   0
  10.0.45.5       4         200        2        3     0 00:00:05 Established    
   0
[AR4]ip ip-prefix 1 permit 172.16.2.0 24 greater-equal 24 less-equal 24
[AR4]route-policy hcip permit node 10
Info: New Sequence of this List.
[AR4-route-policy]if-match ip-prefix 1
[AR4-route-policy]apply local-preference 200
[AR4-route-policy]q
[AR4]route-policy hcip permit node 20
Info: New Sequence of this List.
[AR4-route-policy]q
[AR4]bgp 64512
[AR4-bgp]peer 10.0.3.3 route-policy hcip export 
[AR4-bgp]q
[AR4]q
<AR4>refresh bgp all export
<AR4>sys
Enter system view, return user view with Ctrl+Z.
[AR4]bgp 64512
[AR4-bgp]peer 10.0.2.2 as 64512
[AR4-bgp]peer 10.0.2.2 connect-interface lo0
[AR4-bgp]q	
[AR4]display bgp peer
 BGP local router ID : 10.0.4.4
 Local AS number : 64512
 Total number of peers : 3		  Peers in established state : 2
  Peer            V          AS  MsgRcvd  MsgSent  OutQ  Up/Down       State Pre
fRcv
  10.0.2.2        4       64512        0        0     0 00:00:28        Idle    
   0
  10.0.3.3        4       64512       41       50     0 00:33:47 Established    
   2
  10.0.45.5       4         200       40       38     0 00:33:07 Established    
   5
[AR4]
Jul 25 2024 22:17:12-08:00 AR4 %%01BGP/3/STATE_CHG_UPDOWN(l)[0]:The status of th
e peer 10.0.2.2 changed from OPENCONFIRM to ESTABLISHED. (InstanceName=Public, S
tateChangeReason=Up)  
[AR4]display bgp peer
 BGP local router ID : 10.0.4.4
 Local AS number : 64512
 Total number of peers : 3		  Peers in established state : 3
  Peer            V          AS  MsgRcvd  MsgSent  OutQ  Up/Down       State Pre
fRcv
  10.0.2.2        4       64512        7        3     0 00:00:06 Established    
   7
  10.0.3.3        4       64512       41       50     0 00:33:56 Established    
   2
  10.0.45.5       4         200       40       39     0 00:33:16 Established    
   5
[AR4]dis bgp routing-table 172.16.7.0 24
 BGP local router ID : 10.0.4.4
 Local AS number : 64512
 Paths:   2 available, 1 best, 1 select
 BGP routing table entry information of 172.16.7.0/24:
 From: 10.0.3.3 (10.0.3.3)
 Route Duration: 00h00m14s  
 Relay IP Nexthop: 10.0.34.3
 Relay IP Out-Interface: GigabitEthernet0/0/2
 Original nexthop: 10.0.3.3
 Qos information : 0x0
 AS-path Nil, origin igp, MED 0, localpref 100, pref-val 0, valid, internal, bes
t, select, active, pre 255, IGP cost 1
 Advertised to such 1 peers:
    10.0.45.5
 BGP routing table entry information of 172.16.7.0/24:
 From: 10.0.2.2 (10.0.2.2)
 Route Duration: 00h01m05s  
 Relay IP Nexthop: 10.0.34.3
 Relay IP Out-Interface: GigabitEthernet0/0/2
 Original nexthop: 10.0.2.2
 Qos information : 0x0
 AS-path Nil, origin igp, MED 0, localpref 100, pref-val 0, valid, internal, pre
 255, IGP cost 2, not preferred for IGP cost
 Not advertised to any peer yet
[AR4]q
<AR4>save
  The current configuration will be written to the device. 
  Are you sure to continue? (y/n)[n]:y
  It will take several minutes to save configuration file, please wait.......
  Configuration file had been saved successfully
  Note: The configuration file will take effect after being activated

AR17

The device is running!
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys AR5
[AR5]int g0/0/0
[AR5-GigabitEthernet0/0/0]ip add 10.0.45.5 24
Jul 25 2024 21:32:34-08:00 AR5 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
 on the interface GigabitEthernet0/0/0 has entered the UP state. 
[AR5-GigabitEthernet0/0/0]int lo0
[AR5-LoopBack0]ip add 10.0.5.5 32
[AR5-LoopBack0]int lo1
[AR5-LoopBack1]ip add 172.16.1.1 24
[AR5-LoopBack1]int lo2
[AR5-LoopBack2]ip add 172.16.2.1 24
[AR5-LoopBack2]int lo3
[AR5-LoopBack3]ip add 172.16.3.1 24
[AR5-LoopBack3]int lo4
[AR5-LoopBack4]ip add 172.16.4.1 24
[AR5-LoopBack4]q
<AR5>
<AR5>sys
Enter system view, return user view with Ctrl+Z.
[AR5]bgp 200
[AR5-bgp] router-id 10.0.5.5
[AR5-bgp]peer 10.0.45.4 as 64512
[AR5-bgp]
Jul 25 2024 21:44:02-08:00 AR5 %%01BGP/3/STATE_CHG_UPDOWN(l)[0]:The status of th
e peer 10.0.45.4 changed from OPENCONFIRM to ESTABLISHED. (InstanceName=Public, 
StateChangeReason=Up)  
[AR5-bgp]q
[AR5]bgp 200
[AR5-bgp]network 172.16.1.0 24
[AR5-bgp]network 172.16.2.0 24
[AR5-bgp]network 172.16.3.0 24
[AR5-bgp]network 172.16.4.0 24
[AR5-bgp]q
<AR5>sys
Enter system view, return user view with Ctrl+Z.
[AR5]int lo5
[AR5-LoopBack5]ip add 172.16.5.1
[AR5-LoopBack5]q
[AR5]bgp 200
[AR5-bgp]network 172.16.5.0 24
[AR5-bgp]q
<AR5>save
  The current configuration will be written to the device. 
  Are you sure to continue? (y/n)[n]:y
  It will take several minutes to save configuration file, please wait.......
  Configuration file had been saved successfully
  Note: The configuration file will take effect after being activated

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值