R1配置
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]SYS R1
[R1]int g 0/0/0
[R1-GigabitEthernet0/0/0]ip address 12.0.0.1 24
May 14 2024 15:02:25-08:00 R1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[R1-GigabitEthernet0/0/0]q
[R1]int l 0
[R1-LoopBack0]ip address 1.1.1.1 32
[R1-LoopBack0]q
[R1]bgp 100
[R1-bgp]rou
[R1-bgp]route-id 1.1.1.1
^
Error: Unrecognized command found at '^' position.
[R1-bgp]router-id 1.1.1.1
[R1-bgp]p
[R1-bgp]peer 12.0.0.2 as-
[R1-bgp]peer 12.0.0.2 as-number 200
[R1-bgp]q
[R1]di
[R1]disp
[R1]display bgp p
[R1]display bgp paths
Total Number of Routes: 0
Total Number of Paths: 0
[R1]display bgp peer
BGP local router ID : 1.1.1.1
Local AS number : 100
Total number of peers : 1 Peers in established state : 0
Peer V AS MsgRcvd MsgSent OutQ Up/Down State Pre
fRcv
12.0.0.2 4 200 0 0 0 00:01:02 Active
0
[R1]display bgp peer
BGP local router ID : 1.1.1.1
Local AS number : 100
Total number of peers : 1 Peers in established state : 0
Peer V AS MsgRcvd MsgSent OutQ Up/Down State Pre
fRcv
12.0.0.2 4 200 0 0 0 00:02:32 Active
0
[R1]
May 14 2024 15:11:35-08:00 R1 %%01BGP/3/STATE_CHG_UPDOWN(l)[2]:The status of the
peer 12.0.0.2 changed from OPENCONFIRM to ESTABLISHED. (InstanceName=Public, St
ateChangeReason=Up)
[R1]
Please check whether system data has been changed, and save data in time
Configuration console time out, please press any key to log on
<R1>sys
Enter system view, return user view with Ctrl+Z.
[R1]bgp
^
Error:Incomplete command found at '^' position.
[R1]bgp 100
[R1-bgp]network
[R1-bgp]network 1.1.1.1 32

R2
12.0.0.1 4 100 0 0 0 00:00:25 Idle
0
[R2]
May 14 2024 15:11:35-08:00 R2 %%01BGP/3/STATE_CHG_UPDOWN(l)[0]:The status of the
peer 12.0.0.1 changed from OPENCONFIRM to ESTABLISHED. (InstanceName=Public, St
ateChangeReason=Up)
[R2]display bgp peer
BGP local router ID : 2.2.2.2
Local AS number : 200
Total number of peers : 1 Peers in established state : 1
Peer V AS MsgRcvd MsgSent OutQ Up/Down State Pre
fRcv
12.0.0.1 4 100 2 2 0 00:00:42 Established
0
[R2]os
[R2]ospf 1 r
[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]nrt
[R2-ospf-1-area-0.0.0.0]net
[R2-ospf-1-area-0.0.0.0]network 23.0.0.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0]net
[R2-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0]
May 14 2024 15:15:01-08:00 R2 %%01OSPF/4/NBR_CHANGE_E(l)[1]:Neighbor changes eve
nt: neighbor status changed. (ProcessId=256, NeighborAddress=3.0.0.23, NeighborE
vent=HelloReceived, NeighborPreviousState=Down, NeighborCurrentState=Init)
[R2-ospf-1-area-0.0.0.0]
May 14 2024 15:15:04-08:00 R2 %%01OSPF/4/NBR_CHANGE_E(l)[2]:Neighbor changes eve
nt: neighbor status changed. (ProcessId=256, NeighborAddress=3.0.0.23, NeighborE
vent=2WayReceived, NeighborPreviousState=Init, NeighborCurrentState=ExStart)
[R2-ospf-1-area-0.0.0.0]
May 14 2024 15:15:04-08:00 R2 %%01OSPF/4/NBR_CHANGE_E(l)[3]:Neighbor changes eve
nt: neighbor status changed. (ProcessId=256, NeighborAddress=3.0.0.23, NeighborE
vent=NegotiationDone, NeighborPreviousState=ExStart, NeighborCurrentState=Exchan
ge)
[R2-ospf-1-area-0.0.0.0]
May 14 2024 15:15:04-08:00 R2 %%01OSPF/4/NBR_CHANGE_E(l)[4]:Neighbor changes eve
nt: neighbor status changed. (ProcessId=256, NeighborAddress=3.0.0.23, NeighborE
vent=ExchangeDone, NeighborPreviousState=Exchange, NeighborCurrentState=Loading)
[R2-ospf-1-area-0.0.0.0]
May 14 2024 15:15:04-08:00 R2 %%01OSPF/4/NBR_CHANGE_E(l)[5]:Neighbor changes eve
nt: neighbor status changed. (ProcessId=256, NeighborAddress=3.0.0.23, NeighborE
vent=LoadingDone, NeighborPreviousState=Loading, NeighborCurrentState=Full)
[R2-ospf-1-area-0.0.0.0]q
[R2-ospf-1]q
[R2]dis
[R2]display ip r
[R2]display ip rou
[R2]display ip routing-table p
[R2]display ip routing-table protocol
[R2]display ip routing-table protocol o
[R2]display ip routing-table protocol ospf
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : OSPF
Destinations : 3 Routes : 3
OSPF routing table status : <Active>
Destinations : 3 Routes : 3
Destination/Mask Proto Pre Cost Flags NextHop Interface
3.3.3.3/32 OSPF 10 1 D 23.0.0.3 GigabitEthernet
0/0/1
4.4.4.4/32 OSPF 10 2 D 23.0.0.3 GigabitEthernet
0/0/1
34.0.0.0/24 OSPF 10 2 D 23.0.0.3 GigabitEthernet
0/0/1
OSPF routing table status : <Inactive>
Destinations : 0 Routes : 0
[R2]bgp 200
[R2-bgp]disp
[R2-bgp]display this
[V200R003C00]
#
bgp 200
router-id 2.2.2.2
peer 12.0.0.1 as-number 100
#
ipv4-family unicast
undo synchronization
peer 12.0.0.1 enable
#
return
[R2-bgp]peer 3.3.3.3 as-n
[R2-bgp]peer 3.3.3.3 as-number 200
[R2-bgp]peer 3.3.3.3 con
[R2-bgp]peer 3.3.3.3 connect-interface l
[R2-bgp]peer 3.3.3.3 connect-interface LoopBack 0
[R2-bgp]q
[R2]dis
[R2]display bgp peer
BGP local router ID : 2.2.2.2
Local AS number : 200
Total number of peers : 2 Peers in established state : 1
Peer V AS MsgRcvd MsgSent OutQ Up/Down State Pre
fRcv
3.3.3.3 4 200 0 0 0 00:00:22 Idle
0
12.0.0.1 4 100 12 12 0 00:10:09 Established
0
[R2]
May 14 2024 15:21:54-08:00 R2 %%01BGP/3/STATE_CHG_UPDOWN(l)[6]:The status of the
peer 3.3.3.3 changed from OPENCONFIRM to ESTABLISHED. (InstanceName=Public, Sta
teChangeReason=Up)
[R2]dis
[R2]display bgp peer
BGP local router ID : 2.2.2.2
Local AS number : 200
Total number of peers : 2 Peers in established state : 2
Peer V AS MsgRcvd MsgSent OutQ Up/Down State Pre
fRcv
3.3.3.3 4 200 3 3 0 00:01:09 Established
0
12.0.0.1 4 100 13 13 0 00:11:28 Established
0
[R2]
Please check whether system data has been changed, and save data in time
Configuration console time out, please press any key to log on
<R2>sys
Enter system view, return user view with Ctrl+Z.
[R2]bgp 200
[R2-bgp]peer 3.3.3.3 next
[R2-bgp]peer 3.3.3.3 next-hop-lo
[R2-bgp]peer 3.3.3.3 next-hop-local
[R2-bgp]peer 4.4.4.4 as-n
[R2-bgp]peer 4.4.4.4 as-number 200
[R2-bgp]peer 4.4.4.4 con
[R2-bgp]peer 4.4.4.4 connect-interface l
[R2-bgp]peer 4.4.4.4 connect-interface LoopBack 0
[R2-bgp]peer 4.4.4.4 next
[R2-bgp]peer 4.4.4.4 next-hop-l
[R2-bgp]peer 4.4.4.4 next-hop-local
[R2-bgp]
May 14 2024 15:51:39-08:00 R2 %%01BGP/3/STATE_CHG_UPDOWN(l)[0]:The status of the
peer 4.4.4.4 changed from OPENCONFIRM to ESTABLISHED. (InstanceName=Public, Sta
teChangeReason=Up)
[R2-bgp]
Please check whether system data has been changed, and save data in time
Configuration console time out, please press any key to log on
<R2>sys
Enter system view, return user view with Ctrl+Z.
[R2]dis
[R2]display ip
[R2]display ip rou
[R2]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 15 Routes : 15
Destination/Mask Proto Pre Cost Flags NextHop Interface
1.1.1.1/32 EBGP 255 0 D 12.0.0.1 GigabitEthernet
0/0/0
2.2.2.2/32 Direct 0 0 D 127.0.0.1 LoopBack0
3.3.3.3/32 OSPF 10 1 D 23.0.0.3 GigabitEthernet
0/0/1
4.4.4.4/32 OSPF 10 2 D 23.0.0.3 GigabitEthernet
0/0/1
12.0.0.0/24 Direct 0 0 D 12.0.0.2 GigabitEthernet
0/0/0
12.0.0.2/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
12.0.0.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
23.0.0.0/24 Direct 0 0 D 23.0.0.2 GigabitEthernet
0/0/1
23.0.0.2/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
23.0.0.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
34.0.0.0/24 OSPF 10 2 D 23.0.0.3 GigabitEthernet
0/0/1
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
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

R3
<Huawei>
Please check whether system data has been changed, and save data in time
Configuration console time out, please press any key to log on
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysR3
^
Error: Unrecognized command found at '^' position.
[Huawei]sys R3
[R3]int g 0/0/0
[R3-GigabitEthernet0/0/0]ip address 23.0.0.3 24
May 14 2024 15:03:12-08:00 R3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[R3-GigabitEthernet0/0/0]int g 0/0/1
[R3-GigabitEthernet0/0/1]ip address 34.0.0.3 24
May 14 2024 15:03:32-08:00 R3 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[R3-GigabitEthernet0/0/1]q
[R3]int l 0
[R3-LoopBack0]ip address 3.3.3.3 32
[R3-LoopBack0]
Please check whether system data has been changed, and save data in time
Configuration console time out, please press any key to log on
<R3>sys
Enter system view, return user view with Ctrl+Z.
[R3]os
[R3]ospf 1 rou
[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]net
[R3-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0
[R3-ospf-1-area-0.0.0.0]net
[R3-ospf-1-area-0.0.0.0]network 23.0.0.3 0.0.0.0
[R3-ospf-1-area-0.0.0.0]
May 14 2024 15:15:04-08:00 R3 %%01OSPF/4/NBR_CHANGE_E(l)[0]:Neighbor changes eve
nt: neighbor status changed. (ProcessId=256, NeighborAddress=2.0.0.23, NeighborE
vent=HelloReceived, NeighborPreviousState=Down, NeighborCurrentState=Init)
[R3-ospf-1-area-0.0.0.0]
May 14 2024 15:15:04-08:00 R3 %%01OSPF/4/NBR_CHANGE_E(l)[1]:Neighbor changes eve
nt: neighbor status changed. (ProcessId=256, NeighborAddress=2.0.0.23, NeighborE
vent=2WayReceived, NeighborPreviousState=Init, NeighborCurrentState=2Way)
[R3-ospf-1-area-0.0.0.0]
May 14 2024 15:15:04-08:00 R3 %%01OSPF/4/NBR_CHANGE_E(l)[2]:Neighbor changes eve
nt: neighbor status changed. (ProcessId=256, NeighborAddress=2.0.0.23, NeighborE
vent=AdjOk?, NeighborPreviousState=2Way, NeighborCurrentState=ExStart)
[R3-ospf-1-area-0.0.0.0]
May 14 2024 15:15:04-08:00 R3 %%01OSPF/4/NBR_CHANGE_E(l)[3]:Neighbor changes eve
nt: neighbor status changed. (ProcessId=256, NeighborAddress=2.0.0.23, NeighborE
vent=NegotiationDone, NeighborPreviousState=ExStart, NeighborCurrentState=Exchan
ge)
[R3-ospf-1-area-0.0.0.0]
May 14 2024 15:15:04-08:00 R3 %%01OSPF/4/NBR_CHANGE_E(l)[4]:Neighbor changes eve
nt: neighbor status changed. (ProcessId=256, NeighborAddress=2.0.0.23, NeighborE
vent=ExchangeDone, NeighborPreviousState=Exchange, NeighborCurrentState=Loading)
[R3-ospf-1-area-0.0.0.0]
May 14 2024 15:15:04-08:00 R3 %%01OSPF/4/NBR_CHANGE_E(l)[5]:Neighbor changes eve
nt: neighbor status changed. (ProcessId=256, NeighborAddress=2.0.0.23, NeighborE
vent=LoadingDone, NeighborPreviousState=Loading, NeighborCurrentState=Full)
[R3-ospf-1-area-0.0.0.0]n
[R3-ospf-1-area-0.0.0.0]network 34.0.0.3 0.0.0.0
[R3-ospf-1-area-0.0.0.0]
May 14 2024 15:16:27-08:00 R3 %%01OSPF/4/NBR_CHANGE_E(l)[6]:Neighbor changes eve
nt: neighbor status changed. (ProcessId=256, NeighborAddress=4.0.0.34, NeighborE
vent=HelloReceived, NeighborPreviousState=Down, NeighborCurrentState=Init)
[R3-ospf-1-area-0.0.0.0]
May 14 2024 15:16:28-08:00 R3 %%01OSPF/4/NBR_CHANGE_E(l)[7]:Neighbor changes eve
nt: neighbor status changed. (ProcessId=256, NeighborAddress=4.0.0.34, NeighborE
vent=2WayReceived, NeighborPreviousState=Init, NeighborCurrentState=ExStart)
[R3-ospf-1-area-0.0.0.0]
May 14 2024 15:16:28-08:00 R3 %%01OSPF/4/NBR_CHANGE_E(l)[8]:Neighbor changes eve
nt: neighbor status changed. (ProcessId=256, NeighborAddress=4.0.0.34, NeighborE
vent=NegotiationDone, NeighborPreviousState=ExStart, NeighborCurrentState=Exchan
ge)
[R3-ospf-1-area-0.0.0.0]
May 14 2024 15:16:28-08:00 R3 %%01OSPF/4/NBR_CHANGE_E(l)[9]:Neighbor changes eve
nt: neighbor status changed. (ProcessId=256, NeighborAddress=4.0.0.34, NeighborE
vent=ExchangeDone, NeighborPreviousState=Exchange, NeighborCurrentState=Loading)
[R3-ospf-1-area-0.0.0.0]
May 14 2024 15:16:28-08:00 R3 %%01OSPF/4/NBR_CHANGE_E(l)[10]:Neighbor changes ev
ent: neighbor status changed. (ProcessId=256, NeighborAddress=4.0.0.34, Neighbor
Event=LoadingDone, NeighborPreviousState=Loading, NeighborCurrentState=Full)
[R3-ospf-1-area-0.0.0.0]q
[R3-ospf-1]q
[R3]BGP 200
[R3-bgp]rou
[R3-bgp]router-id 3.3.3.3
[R3-bgp]peer 2.2.2.2 as-nu
[R3-bgp]peer 2.2.2.2 as-number
[R3-bgp]peer 2.2.2.2 as-number 200
[R3-bgp]peer 2.2.2.2 con
[R3-bgp]peer 2.2.2.2 connect-interface l
[R3-bgp]peer 2.2.2.2 connect-interface LoopBack 0
[R3-bgp]q
[R3]
May 14 2024 15:21:54-08:00 R3 %%01BGP/3/STATE_CHG_UPDOWN(l)[11]:The status of th
e peer 2.2.2.2 changed from OPENCONFIRM to ESTABLISHED. (InstanceName=Public, St
ateChangeReason=Up)
[R3]bgp 200
[R3-bgp]peer 4.4.4.4 as-nu
[R3-bgp]peer 4.4.4.4 as-number 200
[R3-bgp]peer 4.4.4.4 con
[R3-bgp]peer 4.4.4.4 connect-interface l
[R3-bgp]peer 4.4.4.4 connect-interface LoopBack 0
[R3-bgp]
May 14 2024 15:25:35-08:00 R3 %%01BGP/3/STATE_CHG_UPDOWN(l)[12]:The status of th
e peer 4.4.4.4 changed from OPENCONFIRM to ESTABLISHED. (InstanceName=Public, St
ateChangeReason=Up)
[R3-bgp]

R4
Total number of peers : 2 Peers in established state : 1
Peer V AS MsgRcvd MsgSent OutQ Up/Down State Pre
fRcv
3.3.3.3 4 200 9 9 0 00:07:14 Established
0
5.5.5.5 4 300 0 0 0 00:01:14 Connect
0
[R4]display bgp peer
BGP local router ID : 4.4.4.4
Local AS number : 200
Total number of peers : 2 Peers in established state : 1
Peer V AS MsgRcvd MsgSent OutQ Up/Down State Pre
fRcv
3.3.3.3 4 200 9 9 0 00:07:17 Established
0
5.5.5.5 4 300 0 0 0 00:01:17 Connect
0
[R4]display bgp peer
BGP local router ID : 4.4.4.4
Local AS number : 200
Total number of peers : 2 Peers in established state : 1
Peer V AS MsgRcvd MsgSent OutQ Up/Down State Pre
fRcv
3.3.3.3 4 200 9 9 0 00:07:18 Established
0
5.5.5.5 4 300 0 0 0 00:01:18 Connect
0
[R4]display bgp peer
BGP local router ID : 4.4.4.4
Local AS number : 200
Total number of peers : 2 Peers in established state : 1
Peer V AS MsgRcvd MsgSent OutQ Up/Down State Pre
fRcv
3.3.3.3 4 200 13 13 0 00:11:06 Established
0
5.5.5.5 4 300 0 0 0 00:05:06 Connect
0
[R4]display bgp peer
BGP local router ID : 4.4.4.4
Local AS number : 200
Total number of peers : 2 Peers in established state : 1
Peer V AS MsgRcvd MsgSent OutQ Up/Down State Pre
fRcv
3.3.3.3 4 200 13 13 0 00:11:08 Established
0
5.5.5.5 4 300 0 0 0 00:05:08 Connect
0
[R4]
[R4]display bgp peer
BGP local router ID : 4.4.4.4
Local AS number : 200
Total number of peers : 2 Peers in established state : 1
Peer V AS MsgRcvd MsgSent OutQ Up/Down State Pre
fRcv
3.3.3.3 4 200 13 13 0 00:11:10 Established
0
5.5.5.5 4 300 0 0 0 00:05:10 Connect
0
[R4]display bgp peer
BGP local router ID : 4.4.4.4
Local AS number : 200
Total number of peers : 2 Peers in established state : 1
Peer V AS MsgRcvd MsgSent OutQ Up/Down State Pre
fRcv
3.3.3.3 4 200 14 13 0 00:11:59 Established
0
5.5.5.5 4 300 0 0 0 00:05:59 Connect
0
[R4]display bgp peer
BGP local router ID : 4.4.4.4
Local AS number : 200
Total number of peers : 2 Peers in established state : 1
Peer V AS MsgRcvd MsgSent OutQ Up/Down State Pre
fRcv
3.3.3.3 4 200 16 16 0 00:14:43 Established
0
5.5.5.5 4 300 0 0 0 00:08:43 Connect
0
[R4]bgp
^
Error:Incomplete command found at '^' position.
[R4]bgp 200
[R4-bgp]disp
[R4-bgp]display this
[V200R003C00]
#
bgp 200
router-id 4.4.4.4
peer 3.3.3.3 as-number 200
peer 3.3.3.3 connect-interface LoopBack0
peer 5.5.5.5 as-number 300
peer 5.5.5.5 ebgp-max-hop 20
peer 5.5.5.5 connect-interface LoopBack0
#
ipv4-family unicast
undo synchronization
peer 3.3.3.3 enable
peer 5.5.5.5 enable
#
return
[R4-bgp]q
[R4]dis
[R4]display bgp peer
BGP local router ID : 4.4.4.4
Local AS number : 200
Total number of peers : 2 Peers in established state : 1
Peer V AS MsgRcvd MsgSent OutQ Up/Down State Pre
fRcv
3.3.3.3 4 200 19 19 0 00:17:53 Established
0
5.5.5.5 4 300 0 0 0 00:11:53 Connect
0
[R4]
Please check whether system data has been changed, and save data in time
Configuration console time out, please press any key to log on
<R4>sys
Enter system view, return user view with Ctrl+Z.
[R4]bgp 200
[R4-bgp]peer 2.2.2.2 as-n
[R4-bgp]peer 2.2.2.2 as-number 200
[R4-bgp]peer 2.2.2.2 cn
[R4-bgp]peer 2.2.2.2 co
[R4-bgp]peer 2.2.2.2 connect-interface l
[R4-bgp]peer 2.2.2.2 connect-interface LoopBack 0
[R4-bgp]peer 2.2.2.2 connect-interface LoopBack 0
[R4-bgp]peer 2.2.2.2 ne`
[R4-bgp]peer 2.2.2.2 ne
[R4-bgp]peer 2.2.2.2 next-hop-l
[R4-bgp]peer 2.2.2.2 next-hop-local
[R4-bgp]
May 14 2024 15:51:40-08:00 R4 %%01BGP/3/STATE_CHG_UPDOWN(l)[0]:The status of the
peer 2.2.2.2 changed from OPENCONFIRM to ESTABLISHED. (InstanceName=Public, Sta
teChangeReason=Up)
[R4-bgp]q
[R4]displa
[R4]display bgp peer
BGP local router ID : 4.4.4.4
Local AS number : 200
Total number of peers : 3 Peers in established state : 2
Peer V AS MsgRcvd MsgSent OutQ Up/Down State Pre
fRcv
2.2.2.2 4 200 2 2 0 00:00:40 Established
0
3.3.3.3 4 200 28 28 0 00:26:44 Established
0
5.5.5.5 4 300 0 0 0 00:20:44 Connect
0
[R4]bgp
^
Error:Incomplete command found at '^' position.
[R4]bgp 200
[R4-bgp]peer 5.5.5.5 as-
[R4-bgp]peer 5.5.5.5 as-number 300
Error: The peer already exists in AS 300.
[R4-bgp]peer 5.5.5.5 co
[R4-bgp]peer 5.5.5.5 connect-interface l
[R4-bgp]peer 5.5.5.5 connect-interface LoopBack 0
[R4-bgp]peer 5.5.5.5 ne
[R4-bgp]peer 5.5.5.5 ebg
[R4-bgp]peer 5.5.5.5 ebgp-max-hop 20
[R4-bgp]q
[R4]disp
[R4]display ip
[R4]display ip rouy
[R4]display ip rou
[R4]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 16 Routes : 16
Destination/Mask Proto Pre Cost Flags NextHop Interface
1.1.1.1/32 IBGP 255 0 RD 2.2.2.2 GigabitEthernet
0/0/1
2.2.2.2/32 OSPF 10 2 D 34.0.0.3 GigabitEthernet
0/0/1
3.3.3.3/32 OSPF 10 1 D 34.0.0.3 GigabitEthernet
0/0/1
4.4.4.4/32 Direct 0 0 D 127.0.0.1 LoopBack0
5.5.5.5/32 Static 60 0 RD 45.0.0.5 GigabitEthernet
0/0/0
23.0.0.0/24 OSPF 10 2 D 34.0.0.3 GigabitEthernet
0/0/1
34.0.0.0/24 Direct 0 0 D 34.0.0.4 GigabitEthernet
0/0/1
34.0.0.4/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
34.0.0.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
45.0.0.0/24 Direct 0 0 D 45.0.0.4 GigabitEthernet
0/0/0
45.0.0.4/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
45.0.0.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/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
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

R5
<Huawei>
Please check whether system data has been changed, and save data in time
Configuration console time out, please press any key to log on
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]SYS R5
[R5]int g 0/0/0
[R5-GigabitEthernet0/0/0]ip address 45.0.0.5 24
May 14 2024 15:05:13-08:00 R5 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[R5-GigabitEthernet0/0/0]q
[R5]int l 0
[R5-LoopBack0]ip address 5.5.5.5 32
[R5-LoopBack0]ip address 10.0.0.0 32
[R5-LoopBack0]1
^
Error: Unrecognized command found at '^' position.
[R5-LoopBack0]q
[R5]
Please check whether system data has been changed, and save data in time
Configuration console time out, please press any key to log on
<R5>sys
Enter system view, return user view with Ctrl+Z.
[R5]bgp
^
Error:Incomplete command found at '^' position.
[R5]bgp 300
[R5-bgp]router
[R5-bgp]router-id 5.5.5.5
[R5-bgp]peer 4.4.4.4 as-nu
[R5-bgp]peer 4.4.4.4 as-number 200
[R5-bgp]peer 4.4.4.4 con
[R5-bgp]peer 4.4.4.4 connect-interface l
[R5-bgp]peer 4.4.4.4 connect-interface LoopBack 0
[R5-bgp]q
[R5]ip rou
[R5]ip route-
[R5]ip route-static 4.4.4.4 32 45.0.0.4
[R5]bgp 300
[R5-bgp]peer 4.4.4.4 ebgp-m
[R5-bgp]peer 4.4.4.4 ebgp-max-hop 20
[R5-bgp]q
[R5]disp
[R5]display bgp peer
BGP local router ID : 5.5.5.5
Local AS number : 300
Total number of peers : 1 Peers in established state : 0
Peer V AS MsgRcvd MsgSent OutQ Up/Down State Pre
fRcv
4.4.4.4 4 200 0 0 0 00:00:19 Idle
0
[R5]
Please check whether system data has been changed, and save data in time
Configuration console time out, please press any key to log on
<R5>sys
Enter system view, return user view with Ctrl+Z.
[R5]dis
[R5]display bgp peer
BGP local router ID : 5.5.5.5
Local AS number : 300
Total number of peers : 1 Peers in established state : 0
Peer V AS MsgRcvd MsgSent OutQ Up/Down State Pre
fRcv
4.4.4.4 4 200 0 0 0 00:06:27 Connect
0
[R5]bgp
^
Error:Incomplete command found at '^' position.
[R5]bgp 300
[R5-bgp]dis
[R5-bgp]display this
[V200R003C00]
#
bgp 300
router-id 5.5.5.5
peer 4.4.4.4 as-number 200
peer 4.4.4.4 ebgp-max-hop 20
peer 4.4.4.4 connect-interface LoopBack0
#
ipv4-family unicast
undo synchronization
peer 4.4.4.4 enable
#
return
[R5-bgp]q
[R5]disp
[R5]dis
[R5]display bgp peer
BGP local router ID : 5.5.5.5
Local AS number : 300
Total number of peers : 1 Peers in established state : 0
Peer V AS MsgRcvd MsgSent OutQ Up/Down State Pre
fRcv
4.4.4.4 4 200 0 0 0 00:11:07 Connect
0
[R5]
Please check whether system data has been changed, and save data in time
Configuration console time out, please press any key to log on
<R5>sys
Enter system view, return user view with Ctrl+Z.
[R5]bgp 300
[R5-bgp]peer 4.4.4.4 c
[R5-bgp]peer 4.4.4.4 con
[R5-bgp]peer 4.4.4.4 connect-interface l
[R5-bgp]peer 4.4.4.4 connect-interface LoopBack 0
[R5-bgp]peer 4.4.4.4 eb
[R5-bgp]peer 4.4.4.4 ebgp-max-hop 20
[R5-bgp]q
[R5]disp
[R5]display bgp peer
BGP local router ID : 5.5.5.5
Local AS number : 300
Total number of peers : 1 Peers in established state : 0
Peer V AS MsgRcvd MsgSent OutQ Up/Down State Pre
fRcv
4.4.4.4 4 200 0 0 0 00:23:04 Connect
0
[R5]dis
[R5]display ip ro
[R5]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 9 Routes : 9
Destination/Mask Proto Pre Cost Flags NextHop Interface
4.4.4.4/32 Static 60 0 RD 45.0.0.4 GigabitEthernet
0/0/0
10.0.0.0/32 Direct 0 0 D 127.0.0.1 LoopBack0
45.0.0.0/24 Direct 0 0 D 45.0.0.5 GigabitEthernet
0/0/0
45.0.0.5/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
45.0.0.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/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
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

结果
