3. Capítulo III. Caracterización de las formas de Habitar
3.4. Conclusiones y recomendaciones
3.4.2. Reflexiones del investigador
route-policy sup permit node 10
if-match acl 2001
#
route-policy ori deny node 10
if-match acl 2000
#
route-policy ori permit node 20
#
route-policy comm_r5 permit node 10
if-match acl 2000
apply community no-export
#
route-policy comm_r5 permit node 20
#
ip route-static 10.0.2.2 255.255.255.255 10.0.25.2
#
return
Chapter 5 BGP Advanced Hands-on Exercise Guide
Overview
Multiple routes to the same destination may exist in a BGP routing table. BGP selects
the optimal route from the multiple routes and sends only the optimal route to peers. To select
the optimal route, BGP compares the BGP attributes of the routes according to BGP route
selection rules. BGP attributes are a set of parameters that describe routes.
BGP attributes are classified into four types:
Well-known mandatory attributes: This type of attribute can be identified by all the BGP routers and must be carried in Update messages. Without this type of attribute, errors occur in routing information. For example, the Origin, AS-Path, and Next_Hop attributes are well-known mandatory attributes.
Well-known discretionary attributes: This type of attribute can be identified by all the BGP routers and is not necessarily carried in Update messages. Errors do not occur in routing information even if this type of attribute is not available. For example, the Local_Pref attribute is a well-known discretionary attribute.
Optional transitive attributes: A BGP router may not recognize this type of attribute, but it still accepts these attributes and advertises them to other peers. For example, the Community attribute is an optional transitive attribute.
Optional non-transitive attributes: If a BGP router does not recognize this type of attribute, it ignores these attributes and does not advertise them to other peers. For example, the MED attribute is an optional non-transitive attribute.
When there are multiple routes to the same destination, BGP compares the following attributes in sequence to select the optimal route:
Prefers the route with the largest PrefVal value.
Prefers the route with the highest Local_Pref.
Prefers the manually summarized route, automatically summarized route, route imported using the network command, route imported using the import-route command, and route learned from peers in sequence.
Prefers the route with the shortest AS-Path.
Prefers the route with the lowest origin type. IGP is lower than EGP, and EGP is lower than Incomplete.
Prefers the route with the lowest MED among the routes from the same AS.
Prefers an EBGP route (the preference of an EBGP route is higher than that of an IBGP route).
Prefers the route with the lowest IGP metric to the BGP next hop.
Prefers the route with the shortest Cluster_List.
Prefers the route advertised by the router with the smallest router ID.
Prefers the route learned from the peer with the lowest IP address.
The PrefVal attribute is a Huawei proprietary attribute and is valid only on the device where it is configured. If a route does not have the local preference, BGP calculates its local preference as the default value of 100. When there are multiple equal-cost routes to the same destination, you can perform load balancing among these routes to load balance traffic.
Equal-cost BGP routes can be generated for traffic load balancing only when the first eight attributes described in "BGP Route Selection Rules" are the same.
Objectives
Upon completion of this exercise guide, you will be able to:
Understand BGP route advertisement rules.
Understand BGP route selection rules.
Explain BGP route reflector functions.
Modify the AS-Path attribute.
Modify the MED attribute.
Modify the Next_Hop attribute.
Configure a BGP route reflector.
Tasks
The following topology shows the network of a company. In the topology, R4, R5, R6,
and R7 are routers in the headquarters. R1 and R3 are routers in two different branches. R2 is
a carrier's network device. Different service network segments are defined on R1 and R3.
Network segments 192.168.10.0/24 and 172.16.10.0/24 are used by service A, and network segments 192.168.20.0/24 and 172.16.20.0/24 are used by service B. Leased lines are deployed between two branches and the headquarters so that service network segments on devices in two branches can access each other through the carrier's network device or through the headquarters' devices over leased lines. Deploy the network according to the following requirements:
(1) Build the network according to the topology, and establish EBGP peer relationships between devices in different ASs through directly connected interfaces.
(2) Establish IBGP peer relationships between R4 and R5, between R5 and R7, between R7 and R6, and between R6 and R4 through loopback interfaces. Deploy OSPF as an IGP.
(3) Ensure that all service network segments, and the network segments where loopback interfaces Loopback 0 of all devices reside, access each other through BGP routes.
(4) Enable traffic of service network segment A to be forwarded by the carrier's network device, and traffic of service network segment B to be forwarded by leased lines, in order to make full use of network resources.
(5) Make the network administrator periodically check lines. After the link costs of IGPs are adjusted, all the traffic that passes through the AS of the headquarters is forwarded along the path R4->R5->R7->R6.
(6) Forward traffic of service network segment B along the path R4->R6, because this network segment has a high volume of traffic. Ensure that the optimal route selected by BGP is the same as the actual forwarding path.
(7) Reconstruct the headquarters' network, retain the existing configuration, and add configuration to disable R5 and R7 from participating in BGP route selection.
Topology
IP Address Table
Device Interface IP Address Subnet Mask Default
Gateway
R1 G 0/0/0 10.0.14.1 255.255.255.0 N/A
G 0/0/1 10.0.12.1 255.255.255.0 N/A
Loopback 0 10.0.1.1 255.255.255.255 N/A
R2
G 0/0/0 10.0.12.2 255.255.255.0 N/A
G 0/0/1 10.0.23.2 255.255.255.0 N/A
Loopback 0 10.0.2.2 255.255.255.255 N/A
R3
G 0/0/0 10.0.23.3 255.255.255.0 N/A
G 0/0/1 10.0.36.3 255.255.255.0 N/A
Loopback 0 10.0.3.3 255.255.255.255 N/A
R4
G 0/0/0 10.0.45.4 255.255.255.0 N/A
G 0/0/1 10.0.14.4 255.255.255.0 N/A
G 0/0/2 10.0.46.4 255.255.255.0 N/A
Loopback 0 10.0.4.4 255.255.255.255 N/A
R5
G 0/0/0 10.0.57.5 255.255.255.0 N/A
G 0/0/1 10.0.45.5 255.255.255.0 N/A
Loopback 0 10.0.5.5 255.255.255.255 N/A
R6
G 0/0/0 10.0.36.6 255.255.255.0 N/A
G 0/0/1 10.0.67.6 255.255.255.0 N/A
G 0/0/2 10.0.46.6 255.255.255.0 N/A
Loopback 0 10.0.6.6 255.255.255.255 N/A
R7
G 0/0/0 10.0.67.7 255.255.255.0 N/A
G 0/0/1 10.0.57.7 255.255.255.0 N/A
Loopback 0 10.0.5.5 255.255.255.255 N/A
Configuration and Verification
1. Build the network according to the topology, and establish EBGP peer relationships between devices in different ASs through directly connected interfaces.
Perform basic configuration according to the address table, and then check the establishment of BGP peer relationships.
After completing this task, run the display bgp peer command to view BGP peer information. The following uses the display of R1 as an example. Only key information is displayed, while other information is omitted.
<R1>display bgp peer
BGP local router ID : 10.0.1.1
Local AS number : 100
Total number of peers : 2 Peers in established state : 2
Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv
10.0.12.2 4 100 22 23 0 00:15:16 Established 3
10.0.14.4 4 400 17 22 0 00:14:24 Established 1
2. Establish IBGP peer relationships between R4 and R5, between R5 and R7, between R7 and R6, and between R6 and R4 through loopback interfaces.
Deploy OSPF as an IGP.
Configuration commands are required when peer relationships are established through loopback interfaces.
After completing this task, run the display ospf peer brief command to view OSPF peer information, run the display bgp peer command to view BGP peer information. The following uses the display of R4 as an example. Only key information is displayed, while other information is omitted.
[R4]display ospf peer brief
OSPF Process 1 with Router ID 10.0.4.4
Peer Statistic Information
---
Area Id Interface Neighbor id State
0.0.0.0 GigabitEthernet0/0/0 10.0.5.5 Full
0.0.0.0 GigabitEthernet0/0/2 10.0.6.6 Full
---
[R4]display bgp peer
BGP local router ID : 10.0.4.4
Local AS number : 400
Total number of peers : 3 Peers in established state : 2
Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv
10.0.5.5 4 400 0 0 0 00:04:19 Established 0
10.0.6.6 4 400 12 13 0 00:03:15 Established 0
10.0.14.1 4 100 18 12 0 00:03:47 Established 0
3. Ensure that all service network segments, and the network segments where
loopback interfaces Loopback 0 of all devices reside, access each other
through BGP routes.
After completing this task, run the display bgp routing-table command to view the BGP routing table. The following uses the display of R1 as an example. Only key information is displayed, while other information is omitted.
<R1>display bg routing-table
BGP Local router ID is 10.0.1.1
Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
Total Number of Routes: 14
Network NextHop MED LocPrf PrefVal Path/Ogn
*> 10.0.1.1/32 0.0.0.0 0 0 i
*> 10.0.2.2/32 10.0.12.2 0 0 200i
*> 10.0.3.3/32 10.0.12.2 0 200 300i
* 10.0.14.4 0 400 300i
*> 10.0.4.4/32 10.0.14.4 0 0 400i
*> 10.0.5.5/32 10.0.14.4 1 0 400?
*> 10.0.6.6/32 10.0.12.2 0 200 300 400i
*> 10.0.7.7/32 10.0.14.4 0 400?
*> 172.16.10.0/24 10.0.12.2 0 200 300i
* 10.0.14.4 0 400 300i
*> 172.16.20.0/24 10.0.12.2 0 200 300i
* 10.0.14.4 0 400 300i
*> 192.168.10.0 0.0.0.0 0 0 i
*> 192.168.20.0 0.0.0.0 0 0 i
4. Enable traffic of service network segment A to be forwarded by the carrier's network device, and traffic of service network segment B to be forwarded by leased lines, in order to make full use of network resources.
Understand the AS-Path attribute principles and modify the attribute accordingly.
After completing this task, run the display bgp routing-table command to view the BGP routing table. The following uses the display of R1 as an example. Only key information is displayed, while other information is omitted.
<R1>display bgp routing-table
BGP Local router ID is 10.0.1.1
Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
Total Number of Routes: 14
Network NextHop MED LocPrf PrefVal Path/Ogn
*> 172.16.10.0/24 10.0.12.2 0 200 300i
* 10.0.14.4 0 400 300i
*> 172.16.20.0/24 10.0.14.4 0 400 300i
* 10.0.12.2 0 200 200 200 300i
<R1>tracert -a 192.168.10.1 172.16.10.1
traceroute to 172.16.10.1(172.16.10.1), max hops: 30 ,packet length: 40,press
CTRL_C to break
1 10.0.12.2 90 ms 50 ms 50 ms
2 10.0.23.3 120 ms 60 ms 50 ms
<R1>tracert -a 192.168.20.1 172.16.20.1
traceroute to 172.16.20.1(172.16.20.1), max hops: 30 ,packet length: 40,press
CTRL_C to break
1 10.0.14.4 40 ms 30 ms 50 ms
2 10.0.46.6 60 ms 80 ms 60 ms
3 10.0.36.3 100 ms 120 ms 80 ms
MED is used to control the channel of inbound traffic from external AS, compare of MED is limited in only one AS by default, but it can be modified to compare among different AS. The less MED is, the better. BGP can modify the value of MED.
Understand the MED attribute principles, learn how to configure the attribute, and modify the attribute accordingly.
After completing this task, run the display bgp routing-table command to view the BGP routing table. The following uses the display of R3 as an example. Only key information is displayed, while other information is omitted.
<R3>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: 16
Network NextHop MED LocPrf PrefVal Path/Ogn
*> 192.168.10.0 10.0.23.2 0 200 100i
* 10.0.36.6 0 400 100i
*> 192.168.20.0 10.0.36.6 0 400 100i
* 10.0.23.2 200 0 200 100i
<R3>tracert -a 172.16.10.1 192.168.10.1
traceroute to 192.168.10.1(192.168.10.1), max hops: 30 ,packet length: 40,press
CTRL_C to break
1 10.0.23.2 10 ms 40 ms 40 ms
2 10.0.12.1 70 ms 60 ms 40 ms
<R3>tracert -a 172.16.20.1 192.168.20.1
traceroute to 192.168.20.1(192.168.20.1), max hops: 30 ,packet length: 40,press
CTRL_C to break
1 10.0.36.6 10 ms 50 ms 30 ms
2 10.0.46.4 80 ms 60 ms 80 ms
3 10.0.14.1 110 ms 80 ms 70 ms
5. Make the network administrator periodically check lines. After the link costs of IGPs are adjusted, all the traffic that passes through the AS of the headquarters is forwarded along the path R4->R5->R7->R6.
Based on the principle of split-horizon among IBGP neighbors, R5 has no access to the service network segment 172.16.20.0, R7 has no access to the service network segment 192.168.20.0. We can import BGP routes into OSPF so that R5 and R7 can get access under IGP.
When OSPF imports BGP as external route, the other OSPF routers will choose the
nearest ASBR by default, during which path can be modified by cost of interface, which is
one by default.
After completing this task, run the display ip routing-table command to view routing-table information. The following uses the display of R4 and R6 as an example. Only key information is displayed, while other information is omitted.
[R4]display ip routing-table
Route Flags: R - relay, D - download to fib
---
Routing Tables: Public
Destinations : 21 Routes : 22
Destination/Mask Proto Pre Cost Flags NextHop Interface
172.16.10.0/24 IBGP 255 0 RD 10.0.6.6
GigabitEthernet0/0/2
172.16.20.0/24 O_ASE 150 1 D 10.0.45.5
GigabitEthernet0/0/0
[R4]display ospf routing
OSPF Process 1 with Router ID 10.0.4.4
Routing Tables
Routing for ASEs
Destination Cost Type Tag NextHop AdvRouter
172.16.20.0/24 1 Type2 1 10.0.46.6 10.0.6.6
[R4]display ospf interface
OSPF Process 1 with Router ID 10.0.4.4
Interfaces
Area: 0.0.0.0 (MPLS TE not enabled)
IP Address Type State Cost Pri DR BDR
10.0.45.4 Broadcast BDR 1 1 10.0.45.5 10.0.45.4
10.0.46.4 Broadcast BDR 100 1 10.0.46.6 10.0.46.4
10.0.4.4 P2P P-2-P 0 1 0.0.0.0 0.0.0.0
[R6]display ospf routing
OSPF Process 1 with Router ID 10.0.6.6
Routing Tables
Routing for ASEs
Destination Cost Type Tag NextHop AdvRouter
192.168.20.0/24 1 Type2 1 10.0.67.7 10.0.4.4
<R1>tracert -a 192.168.20.1 172.16.20.1
traceroute to 172.16.20.1(172.16.20.1), max hops: 30 ,packet length: 40,press
CTRL_C to break
1 10.0.14.4 30 ms 30 ms 30 ms
2 10.0.45.5 80 ms 70 ms 40 ms
3 10.0.57.7 130 ms 110 ms 70 ms
4 10.0.67.6 100 ms 120 ms 160 ms
5 10.0.36.3 120 ms 210 ms 110 ms
6. Forward traffic of service network segment B along the path R4->R6, because this network segment has a high volume of traffic. Ensure that the optimal route selected by BGP is the same as the actual forwarding path.
IBGP cannot transfer route because of the principle of split-horizon, so we need to use full mesh topology or router-reflector to realize.
Since the default route preference of BGP is 255 and OSPF is 150, we must decrease the BGP’s route preference to choose path.
Understand BGP route selection rules and route-reflectors, analyze the routing table, and perform configuration based on routing policies.
After completing this task, run the display bgp routing-table command to view the BGP routing table. The following uses the display of R6 and R4as an example. Only key information is displayed, while other information is omitted.
[R4]display bgp routing-table
BGP Local router ID is 10.0.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: 18
Network NextHop MED LocPrf PrefVal Path/Ogn
*>i 172.16.10.0/24 10.0.6.6 0 100 0 300i
* i 10.0.6.6 0 100 0 300i
* 10.0.14.1 0 100 200 300i
*>i 172.16.20.0/24 10.0.46.6 0 100 0 300i
* i 10.0.6.6 0 100 0 300i
*> 192.168.10.0 10.0.14.1 0 0 100i
*> 192.168.20.0 10.0.14.1 0 0 100i
[R4]display ip routing-table
Route Flags: R - relay, D - download to fib
---
Routing Tables: Public
Destinations : 21 Routes : 21
Destination/Mask Proto Pre Cost Flags NextHop Interface
172.16.20.0/24 IBGP 100 0 RD 10.0.46.6 GigabitEthernet0/0/2
[R6]display bgp routing-table
BGP Local router ID is 10.0.6.6
Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
Total Number of Routes: 18
Network NextHop MED LocPrf PrefVal Path/Ogn
*> 172.16.10.0/24 10.0.36.3 0 0 300i
*> 172.16.20.0/24 10.0.36.3 0 0 300i
*>i 192.168.10.0 10.0.4.4 0 100 0 100i
* i 10.0.4.4 0 100 0 100i
* 10.0.36.3 0 300 200 100i
*>i 192.168.20.0 10.0.46.4 0 100 0 100i
* i 10.0.4.4 0 100 0 100i
[R6-ospf-1]display ip routing-table
Route Flags: R - relay, D - download to fib
---
Routing Tables: Public
Destinations : 21 Routes : 21
Destination/Mask Proto Pre Cost Flags NextHop Interface
192.168.20.0/24 IBGP 100 0 RD 10.0.46.4
GigabitEthernet0/0/2
<R1>tracert -a 192.168.20.1 172.16.20.1
traceroute to 172.16.20.1(172.16.20.1), max hops: 30 ,packet length: 40,press
CTRL_C to break
1 10.0.14.4 30 ms 50 ms 60 ms
2 10.0.46.6 30 ms 80 ms 90 ms
3 10.0.36.3 100 ms 70 ms 70 ms
7. Reconstruct the headquarters' network, retain the existing configuration, and add configuration to disable R5 and R7 from participating in BGP route selection.
BGP can use the command peer ignore to suspend the neighbor relationship with other BGP routers.
BGP establishes neighbors with three-hands mechanism, one side has to initiate TCP connection. Otherwise, TCP connection will fail.
Peer listen-only command is passive to TCP connection, so both sides must be enabled at the same time.
After completing this task, run the display bgp peer command on R4 and R6 to view
BGP peer information. Only key information is displayed, while other information is omitted.
<R4>display bgp peer
BGP local router ID : 10.0.4.4
Local AS number : 400
Total number of peers : 3 Peers in established state : 2
Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv
10.0.5.5 4 400 0 0 0 00:59:43 Idle(Admin) 0
10.0.6.6 4 400 65 69 0 00:53:18 Established 6
10.0.14.1 4 100 253 206 0 03:00:59 Established 6
<R6>display bgp peer
BGP local router ID : 10.0.6.6
Local AS number : 400
Total number of peers : 3 Peers in established state : 2
Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv
10.0.4.4 4 400 69 66 0 00:53:28 Established 6
10.0.7.7 4 400 0 0 0 00:54:00 Idle 0
10.0.36.3 4 300 88 65 0 00:53:29 Established 6
Questions
Why BGP routes to service network segments on the devices in AS 400 have two routing entries with the same next hop?
Since R5 and R7 in AS400 are both router reflector, they don’t modify the next hop adds when reflecting routers, that is, the router is all the same.
Are there multiple methods to meet requirement 6 and which method is the best one?
Imported from BGP to OSPF can be cancelled, after which BGP will have no need to modify the router preference, and only the next hop adds is needed to modified, so that the suboptimal route can b avoided. Comparatively, Cancelling importing BGP to OSPF is better.
What problems occur on the network after requirement 7 is met and why do these problems occur?
When R5 and R7 are not involved in election, Business B must transfer traffic via AS200 other than AS200 if the connection between R4 and R6 is broken down.
Configuration List
<R1>display current-configuration
#
sysname R1
#
interface GigabitEthernet0/0/0
ip address 10.0.14.1 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 10.0.12.1 255.255.255.0
#
interface LoopBack0
ip address 10.0.1.1 255.255.255.255
#
interface LoopBack1
ip address 192.168.10.1 255.255.255.0
#
interface LoopBack2
ip address 192.168.20.1 255.255.255.0
#
bgp 100
router-id 10.0.1.1
peer 10.0.12.2 as-number 200
peer 10.0.14.4 as-number 400
#
ipv4-family unicast
undo synchronization
network 10.0.1.1 255.255.255.255
network 192.168.10.0
network 192.168.20.0
peer 10.0.12.2 enable
peer 10.0.14.4 enable
#
return
<R2>display current-configuration
#
sysname R2
#
acl number 2000
rule 5 permit source 172.16.20.0 0.0.0.255
acl number 2001
rule 5 permit source 192.168.20.0 0.0.0.255
#
interface GigabitEthernet0/0/0
ip address 10.0.12.2 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 10.0.23.2 255.255.255.0
#
interface LoopBack0
ip address 10.0.2.2 255.255.255.255
#
bgp 200
router-id 10.0.2.2
peer 10.0.12.1 as-number 100
peer 10.0.12.1 timer keepalive 30 hold 90
peer 10.0.23.3 as-number 300
peer 10.0.23.3 timer keepalive 30 hold 90
#
ipv4-family unicast
undo synchronization
network 10.0.2.2 255.255.255.255
peer 10.0.12.1 enable
peer 10.0.12.1 route-policy AS export
peer 10.0.23.3 enable
peer 10.0.23.3 route-policy MED export
#
route-policy AS permit node 10
if-match acl 2000
apply as-path 200 200 additive
#
route-policy AS permit node 20
#
route-policy MED permit node 10
if-match acl 2001
apply cost 200
#
route-policy MED permit node 20
#
return
<R3>display current-configuration
#
sysname R3
#
interface GigabitEthernet0/0/0
ip address 10.0.23.3 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 10.0.36.3 255.255.255.0
#
interface LoopBack0
ip address 10.0.3.3 255.255.255.255
#
interface LoopBack1
ip address 172.16.10.1 255.255.255.0
#
interface LoopBack2
ip address 172.16.20.1 255.255.255.0
#
bgp 300
router-id 10.0.3.3
peer 10.0.23.2 as-number 200
peer 10.0.36.6 as-number 400
#
ipv4-family unicast
undo synchronization
compare-different-as-med
network 10.0.3.3 255.255.255.255
network 172.16.10.0 255.255.255.0
network 172.16.20.0 255.255.255.0
peer 10.0.23.2 enable
peer 10.0.36.6 enable
#
return
<R4>display current-configuration
#
sysname R4
#
acl number 2000
rule 5 permit source 10.0.5.5 0
acl number 2001
rule 5 permit source 192.168.20.0 0.0.0.255
#
interface GigabitEthernet0/0/0
ip address 10.0.45.4 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 10.0.14.4 255.255.255.0
#
interface GigabitEthernet0/0/2
ip address 10.0.46.4 255.255.255.0
ospf cost 100
#
interface LoopBack0
ip address 10.0.4.4 255.255.255.255
#
bgp 400
router-id 10.0.4.4
peer 10.0.5.5 as-number 400
peer 10.0.5.5 ignore
peer 10.0.5.5 connect-interface LoopBack0
peer 10.0.6.6 as-number 400
peer 10.0.6.6 connect-interface LoopBack0
peer 10.0.14.1 as-number 100
#
ipv4-family unicast
undo synchronization
preference 255 100 255
network 10.0.4.4 255.255.255.255
import-route ospf 1 route-policy O2B
peer 10.0.5.5 enable
peer 10.0.5.5 next-hop-local
peer 10.0.6.6 enable
peer 10.0.6.6 route-policy local export
peer 10.0.6.6 next-hop-local
peer 10.0.14.1 enable
#
ospf 1 router-id 10.0.4.4
import-route bgp route-policy B2O
area 0.0.0.0
network 10.0.4.4 0.0.0.0
network 10.0.45.4 0.0.0.0
network 10.0.46.4 0.0.0.0
#
route-policy O2B permit node 10
if-match acl 2000
#
route-policy local permit node 10
if-match acl 2001
apply ip-address next-hop 10.0.46.4
#
route-policy local permit node 20
#
route-policy B2O permit node 10
if-match acl 2001
#
return
<R5>display current-configuration
#
sysname R5
#
interface GigabitEthernet0/0/0
ip address 10.0.57.5 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 10.0.45.5 255.255.255.0
#
interface LoopBack0
ip address 10.0.5.5 255.255.255.255
#
bgp 400
router-id 10.0.5.5
peer 10.0.4.4 as-number 400
peer 10.0.4.4 connect-interface LoopBack0
peer 10.0.7.7 as-number 400
peer 10.0.7.7 connect-interface LoopBack0
#
ipv4-family unicast
undo synchronization
reflector cluster-id 1
network 10.0.5.5 255.255.255.255
peer 10.0.4.4 enable
peer 10.0.4.4 reflect-client
peer 10.0.7.7 enable
peer 10.0.7.7 reflect-client
#
ospf 1 router-id 10.0.5.5
area 0.0.0.0
network 10.0.5.5 0.0.0.0
network 10.0.45.5 0.0.0.0
network 10.0.57.5 0.0.0.0
#
return
<R6>display current-configuration
#
sysname R6
#
acl number 2000
rule 5 permit source 10.0.7.7 0
acl number 2001
rule 5 permit source 172.16.20.0 0.0.0.255
#
interface GigabitEthernet0/0/0
ip address 10.0.36.6 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 10.0.67.6 255.255.255.0
#
interface GigabitEthernet0/0/2
ip address 10.0.46.6 255.255.255.0
ospf cost 100
#
interface LoopBack0
ip address 10.0.6.6 255.255.255.255
#
bgp 400
router-id 10.0.6.6
peer 10.0.4.4 as-number 400
peer 10.0.4.4 connect-interface LoopBack0
peer 10.0.7.7 as-number 400
peer 10.0.7.7 connect-interface LoopBack0
peer 10.0.7.7 listen-only
peer 10.0.36.3 as-number 300
#
ipv4-family unicast
undo synchronization
preference 255 100 255
network 10.0.6.6 255.255.255.255
import-route ospf 1 route-policy O2B
peer 10.0.4.4 enable
peer 10.0.4.4 next-hop-local
peer 10.0.4.4 route-policy local export
peer 10.0.7.7 enable
peer 10.0.7.7 next-hop-local
peer 10.0.36.3 enable
#
ospf 1 router-id 10.0.6.6
import-route bgp route-policy B2O
area 0.0.0.0
network 10.0.6.6 0.0.0.0
network 10.0.46.6 0.0.0.0
network 10.0.67.6 0.0.0.0
#
route-policy O2B permit node 10
if-match acl 2000
#
route-policy B2O permit node 10
if-match acl 2001
#
route-policy local permit node 10
if-match acl 2001
apply ip-address next-hop 10.0.46.6
#
route-policy local permit node 20
#
return
<R7>display current-configuration
#
sysname R7
#
acl number 2000
rule 5 permit source 192.168.20.0 0.0.0.255
#
interface GigabitEthernet0/0/0
ip address 10.0.67.7 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 10.0.57.7 255.255.255.0
#
interface LoopBack0
ip address 10.0.7.7 255.255.255.255
#
bgp 400
router-id 10.0.7.7
peer 10.0.5.5 as-number 400
peer 10.0.5.5 connect-interface LoopBack0
peer 10.0.6.6 as-number 400
peer 10.0.6.6 connect-interface LoopBack0
peer 10.0.6.6 listen-only
peer 10.0.6.6 listen-only