Example for Configuring Prefix-based BGP ORF
Networking Requirements
As shown in Figure 9-31, PE1 and PE2 belong to AS 100. PE2 needs to advertise only the routes that match the import policy of PE1 without having to maintain export policies.
Configuration Roadmap
The configuration roadmap is as follows:
Configure prefix-based BGP ORF so that PE2 can advertise only the routes that match the import policy of PE1 without having to maintain export policies.
Procedure
- Configure the VLANs to which interfaces belong and assign IP addresses to VLANIF interfaces.
# Configure PE1.
<HUAWEI> system-view
[~HUAWEI] sysname PE1
[*HUAWEI] commit
[~PE1] vlan 10
[*PE1-vlan10] quit
[*PE1] interface 10ge 1/0/1
[*PE1-10GE1/0/1] port link-type trunk
[*PE1-10GE1/0/1] port trunk allow-pass vlan 10
[*PE1-10GE1/0/1] quit
[*PE1] interface vlanif 10
[*PE1-Vlanif10] ip address 172.16.1.1 255.255.255.0
[*PE1-Vlanif10] quit
[*PE1] commit
The configuration of PE2 is similar to that of PE1 and is not mentioned here.
- Configure IPv4 unicast neighbors.
# Configure PE1.
[~PE1] bgp 100
[*PE1-bgp] peer 172.16.1.2 as-number 100
[*PE1-bgp] commit
[~PE1-bgp] quit
The configuration of PE2 is similar to that of PE1 and is not mentioned here.
- Apply the prefix-based import policy on PE1.
# Configure PE1.
[~PE1] ip ip-prefix 1 permit 10.4.4.0 24 greater-equal 32
[*PE1] bgp 100
[*PE1-bgp] peer 172.16.1.2 ip-prefix 1 import
[*PE1-bgp] commit
[~PE1-bgp] quit
# Configure PE2.
[~PE2] ip route-static 10.3.3.3 255.255.255.255 NULL0
[*PE2] ip route-static 10.4.4.4 255.255.255.255 NULL0
[*PE2] ip route-static 10.5.5.5 255.255.255.255 NULL0
[*PE2] bgp 100
[*PE2-bgp] import-route static
[*PE2-bgp] commit
[~PE2-bgp] quit
# View the routes sent by PE2.
[~PE2] display bgp routing-table peer 172.16.1.1 advertised-routes BGP Local router ID is 172.16.1.2 Status codes: * - valid, > - best, d - damped, h - history, i - internal, s - suppressed, S - Stale Origin : i - IGP, e - EGP, ? - incomplete Total Number of Routes: 3 Network NextHop MED LocPrf PrefVal Path/Ogn *> 10.3.3.3/32 0.0.0.0 0 0 ? *> 10.4.4.4/32 0.0.0.0 0 0 ? *> 10.5.5.5/32 0.0.0.0 0 0 ?
# View the routes received on PE1.
[~PE1] display bgp routing-table peer 172.16.1.2 received-routes BGP Local router ID is 172.16.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: 1 Network NextHop MED LocPrf PrefVal Path/Ogn *>i 10.4.4.4/32 172.16.1.2 0 100 0 ?
When prefix-based BGP ORF is disabled, PE2 sends three routes 10.3.3.3, 10.4.4.4, and 10.5.5.5, but PE1 accepts only one route 10.4.4.4 because PE1 applies the prefix-based import policy to the three routes.
- Enable prefix-based BGP ORF.
# Configure PE1.
[~PE1] bgp 100
[~PE1-bgp] peer 172.16.1.2 capability-advertise orf ip-prefix both
[*PE1-bgp] commit
[~PE1-bgp] quit
# Configure PE2.
[~PE2] bgp 100
[~PE2-bgp] peer 172.16.1.1 capability-advertise orf ip-prefix both
[*PE2-bgp] commit
[~PE2-bgp] quit
- Verify the configuration.
# View prefix-based BGP ORF negotiation information.
<PE1> display bgp peer 172.16.1.2 verbose BGP Peer is 172.16.1.2, remote AS 100 Type: IBGP link BGP version 4, Remote router ID 172.16.1.2 Update-group ID: 2 BGP current state: Established, Up for 00h01m22s BGP current event: KATimerExpired BGP last state: OpenConfirm BGP Peer Up count: 8 Received total routes: 1 Received active routes total: 1 Advertised total routes: 0 Port: Local - 54845 Remote - 179 Configured: Connect-retry Time: 32 sec Configured: Active Hold Time: 180 sec Keepalive Time:60 sec Received : Active Hold Time: 180 sec Negotiated: Active Hold Time: 180 sec Keepalive Time:60 sec Peer optional capabilities: Peer supports bgp multi-protocol extension Peer supports bgp route refresh capability Peer supports bgp outbound route filter capability Support Address-Prefix: IPv4-UNC address-family, rfc-compatible, both Peer supports bgp 4-byte-as capability Address family IPv4 Unicast: advertised and received Received Total messages 5 Update messages 1 Open messages 1 KeepAlive messages 2 Notification messages 0 Refresh messages 1 Sent Total messages 4 Update messages 0 Open messages 1 KeepAlive messages 2 Notification messages 0 Refresh messages 1 Authentication type configured: None Last keepalive received: 2013-09-21 18:54:57+00:00 Last keepalive sent:2013-09-21 18:54:57 Last update received:2013-09-21 18:54:57 Last update sent:2013-09-21 18:54:57 Last refresh received:2013-09-21 18:54:57 Last refresh sended:2013-09-21 18:54:57 Minimum route advertisement interval is 15 seconds Optional capabilities: Route refresh capability has been enabled Outbound route filter capability has been enabled Enable Address-Prefix: IPv4-UNC address-family, rfc-compatible, both 4-byte-as capability has been enabled Peer Preferred Value: 0 Routing policy configured: No import update filter list No export update filter list Import prefix list is: 1 No export prefix list No import route policy No export route policy No import distribute policy No export distribute policy
# View the routes sent by PE2.
<PE2> display bgp routing-table peer 172.16.1.1 advertised-routes BGP Local router ID is 172.16.1.2 Status codes: * - valid, > - best, d - damped, h - history, i - internal, s - suppressed, S - Stale Origin : i - IGP, e - EGP, ? - incomplete Total Number of Routes: 1 Network NextHop MED LocPrf PrefVal Path/Ogn *> 10.4.4.4/32 0.0.0.0 0 0 ?
# View the routes accepted by PE1.
<PE1> display bgp routing-table peer 172.16.1.2 received-routes BGP Local router ID is 172.16.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: 1 Network NextHop MED LocPrf PrefVal Path/Ogn *>i 10.4.4.4/32 172.16.1.2 0 100 0 ?
After prefix-based BGP ORF is enabled, PE2 sends only one route 10.4.4.4 based on the prefix-based import policy provided by PE1.
Configuration Files
Configuration file of PE1
# sysname PE1 # vlan batch 10 # interface Vlanif10 ip address 172.16.1.1 255.255.255.0 # interface 10GE1/0/1 port link-type trunk port trunk allow-pass vlan 10 # bgp 100 peer 172.16.1.2 as-number 100 # ipv4-family unicast peer 172.16.1.2 enable peer 172.16.1.2 ip-prefix 1 import peer 172.16.1.2 capability-advertise orf ip-prefix both # ip ip-prefix 1 index 10 permit 10.4.4.0 24 greater-equal 32 less-equal 32 # return
Configuration file of PE2
# sysname PE2 # vlan batch 10 # interface Vlanif10 ip address 172.16.1.2 255.255.255.0 # interface 10GE1/0/1 port link-type trunk port trunk allow-pass vlan 10 # bgp 100 peer 172.16.1.1 as-number 100 # ipv4-family unicast import-route static peer 172.16.1.1 enable peer 172.16.1.1 capability-advertise orf ip-prefix both # ip route-static 10.3.3.3 255.255.255.255 NULL0 ip route-static 10.4.4.4 255.255.255.255 NULL0 ip route-static 10.5.5.5 255.255.255.255 NULL0 # return