Lab 3-1 Ibgp and Ebgp
Lab 3-1 Ibgp and Ebgp
Learning Objectives
Topology
Scenario
You are a network administrator of a company. The company’s network uses BGP as
the routing protocol. This network consists of multiple autonomous systems (ASs).
Different branches use different AS numbers. You need to build this network. OSPF is
used in the headquarters as an IGP. Different branches in the company use private
BGP AS numbers. After building the network, you still need to observe BGP routing
information transmission.
Tasks
Configure IP addresses and masks for all the routers. The mask of IP addresses for
Loopback1 of R4 and R5 is 24 bits, which is used to simulate a user network.
<R1>system-view
[R1-Serial1/0/0]quit
[R1-Serial3/0/0]quit
[R1]interface LoopBack 0
[R1-LoopBack0]quit
<R2>system-view
[R2-Serial1/0/0]quit
[R2-Serial2/0/0]quit
[R2]interface LoopBack 0
<R3>system-view
[R3-Serial2/0/0]quit
[R3-Serial3/0/0]quit
[R3]interface LoopBack 0
<R4>system-view
[R4-Serial1/0/0]quit
[R3]interface LoopBack 0
<R5>system-view
[R5-Serial1/0/0]quit
[R3]interface LoopBack 0
<R1>ping -c 1 10.0.12.2
1 packet(s) transmitted
1 packet(s) received
<R1>ping -c 1 10.0.14.4
1 packet(s) transmitted
1 packet(s) received
<R3>ping -c 1 10.0.23.2
1 packet(s) transmitted
1 packet(s) received
<R3>ping -c 1 10.0.35.5
1 packet(s) transmitted
1 packet(s) received
The preceding command output shows that direct link connectivity is normal.
Use OSPF as an IGP in AS 64512 and advertise the network segment connected to
Loopback0 into OSPF. Run OSPF on the network segment connected to S1/0/0 of R1.
[R1]router id 10.0.1.1
[R1]ospf 1
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]quit
[R1-ospf-1]quit
Run OSPF on the network segments connected to S1/0/0 and S2/0/0 of R2.
[R2]router id 10.0.2.2
[R2]ospf 1
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]quit
[R2-ospf-1]quit
[R3]router id 10.0.3.3
[R3]ospf 1
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]quit
[R3-ospf-1]quit
When configuring the network command, use the wildcard mask 0.0.0.0.
After the configurations are complete, check whether OSPF neighbor relationships
are established.
Neighbors
Authentication Sequence: [ 0 ]
Neighbors
Authentication Sequence: [ 0 ]
Check the IP routing table of each router. Check whether these routers can learn
routes to the network segments connected to loopback interfaces of the peer device.
[R1]display ip routing-table
----------------------------------------------------------------------------
Destinations : 15 Routes : 15
[R2]display ip routing-table
----------------------------------------------------------------------------
Destinations : 15 Routes : 15
[R3]display ip routing-table
----------------------------------------------------------------------------
Destinations : 16 Routes : 16
The IP routing tables of R1, R2, and R3 show that each router can learn routes to the
network segment connected to Loopback0 of the other two routers.
Configure IBGP full mesh on R1, R2, and R3. Use Loopback0 address as a source
address.
[R1]bgp 64512
[R1-bgp]quit
[R2]bgp 64512
[R2-bgp]quit
[R3]bgp 64512
[R3-bgp]quit
Run the display tcp status command to check the TCP port connection status.
The preceding command output shows that the Local Add field displays 10.0.2.2
(Loopback0 address of R2) and port number is 179 (TCP port number of BGP). The
neighbor state with 10.0.3.3 and 10.0.1.1 is Established, indicating that R2 has
established a TCP connection with R1 and R3.
Run the display bgp peer command to check BGP peer relationships of routers.
The preceding command output shows that BGP peer relationships between R1, R2,
and R3 are in Established state, indicating that BGP peer relationships have been
established.
On R1, run the timer command in the BGP process to change the Keepalive time to
30s and hold time to 90s. Check whether the BGP peer relationship between R1 and
R2 is established and run the display bgp peer verbose command to check the
negotiation interval after the BGP peer relationship is established.
Warning: Changing the parameter in this command resets the peer session. Continue?[Y/N]:y
[R1-bgp]quit
Note that changing the Keepalive time and hold time will restart the BGP session.
Update-group ID: 1
Update messages 0
Open messages 1
KeepAlive messages 15
Notification messages 0
Refresh messages 0
Update messages 0
Open messages 1
KeepAlive messages 15
Notification messages 0
Refresh messages 0
Optional capabilities:
Update-group ID: 1
Update messages 0
Open messages 1
Notification messages 0
Refresh messages 0
Update messages 0
Open messages 1
Notification messages 0
Refresh messages 0
Optional capabilities:
The preceding command output of R2 shows that the default parameter Active Hold
Time is 180s and Keepalive Time is 60s.
After parameters of R1 are changed, the Active Hold Time of packets received by R2
becomes 90s. The negotiated parameters use the smaller value. Therefore, the Active
Hold Time and Keepalive Timer that are negotiated between R2 and R1 are 90s and
30s respectively, but the parameters of R3 still use the default values.
Therefore, the negotiated parameters are the same as the configured parameters.
That is, the Active Hold Time and Keepalive Timer on R2 and R3 are 180s and 60s
respectively.
Configure BGP on R4, set the local AS number to 64513, and establish an EBGP peer
relationship between R4 and R1. During EBGP peer relationship establishment,
specify the address of Loopback0 as the source address and set ebgp-max-hop to 2.
Add a 32-bit static route to the Loopback0 address of the peer device to ensure that
an EBGP peer relationship can be established normally.
[R1]bgp 64512
[R1-bgp]quit
[R4]router id 10.0.4.4
[R4]bgp 64513
[R4-bgp]quit
After an EBGP peer relationship is established, run the display bgp peer command
to check the peer relationship status.
Run the debugging ip packet verbose command on R4 to check the TTL value of
Keepalive packets.
<R4>terminal monitor
<R4>terminal debugging
<R4>debugging ip packet
<R4>
45 c0 00 28 01 ad 00 00 02 06 9d 5f 0a 00 01 01
0a 00 04 04
The preceding command output shows that the TTL value of received packets is 2.
Establish an EBGP peer relationship between R3 and R5. Use physical interface
addresses to establish a connection.
[R3]bgp 64512
[R3-bgp]quit
[R5]router id 10.0.5.5
[R5]bgp 64514
[R5-bgp]quit
[R4]interface LoopBack 1
[R4-LoopBack1]quit
[R4]bgp 64513
[R4-bgp]network 10.1.4.4 24
[R4-bgp]quit
Check the IP routing tables of R1 and R3 to check whether the route to 10.1.4.4/24
exists.
Check the BGP routing table of R3 to analyze next-hop information of this route.
[R1]display ip routing-table
----------------------------------------------------------------------------
Destinations : 18 Routes : 18
The command output shows that R1 has learned the EBGP route to 10.1.4.0/24.
[R3]display ip routing-table
----------------------------------------------------------------------------
Destinations : 16 Routes : 16
The preceding command output shows that R3 does not have any BGP route to
10.1.4.4.
The preceding command output shows that there is a BGP route to 10.1.4.0/24, but
this route is not marked with *, indicating that this route is not preferred. The
NextHop field of this route displays 10.0.4.4, but R3 does not have the route to
10.0.4.4. According to BGP route selection rules, when the next hop of a BGP route is
unreachable, this route is ignored.
Run the next-hop-local command on R1 and check the BGP routing table of R3
again.
[R1]bgp 64512
[R1-bgp]quit
The preceding command output shows that the next hop of the BGP route
10.1.4.0/24 is 10.0.1.1 and this route is marked with * and >, indicating that this route
is correct and the optimal route.
[R3]display ip routing-table
----------------------------------------------------------------------------
Destinations : 17 Routes : 17
[R5]interface LoopBack 1
[R5-LoopBack1]quit
[R5]bgp 64514
[R5-bgp]network 10.1.5.0 24
[R3]bgp 64512
Check the BGP routing table of R4 to determine whether R4 learns a route to the
network segment connected to Loopback1 of R5. Analyze the display bgp
routing-table command output.
1 packet(s) transmitted
1 packet(s) received
Why does the TTL value of packets sent to EBGP peers default to 1? What is the
default configuration of the peer group_name ebgp-max-hop [ hop-count ]
command?
Device Configurations
[R1]display current-configuration
[V200R007C00SPC600]
sysname R1
router id 10.0.1.1
interface Serial1/0/0
link-protocol ppp
interface Serial3/0/0
link-protocol ppp
interface LoopBack0
bgp 64512
ipv4-family unicast
undo synchronization
ospf 1
area 0.0.0.0
return
[R2]display current-configuration
[V200R007C00SPC600]
sysname R2
router id 10.0.2.2
interface Serial1/0/0
link-protocol ppp
interface Serial2/0/0
link-protocol ppp
interface LoopBack0
bgp 64512
ipv4-family unicast
undo synchronization
ospf 1
area 0.0.0.0
return
[R3]display current-configuration
[V200R007C00SPC600]
sysname R3
router id 10.0.3.3
interface Serial2/0/0
link-protocol ppp
interface Serial3/0/0
link-protocol ppp
interface LoopBack0
bgp 64512
ipv4-family unicast
undo synchronization
ospf 1
area 0.0.0.0
return
[R4]display current-configuration
[V200R007C00SPC600]
sysname R4
router id 10.0.4.4
interface Serial1/0/0
link-protocol ppp
interface LoopBack0
interface LoopBack1
bgp 64513
ipv4-family unicast
undo synchronization
return
[R5]display current-configuration
[V200R007C00SPC600]
sysname R5
router id 10.0.5.5
interface Serial1/0/0
link-protocol ppp
interface LoopBack0
interface LoopBack1
bgp 64514
ipv4-family unicast
undo synchronization
return
Learning Objectives