Configuring BGP AS-PATH_FILTER on Huawei Routers.

Configuring BGP AS-PATH_FILTER on Huawei Routers.

Configuration Steps

Step 1: Configure Interface IPs on R1, R2, and R3.

***************************R1
sys
sysname R1
#
#
interface LoopBack0
 ip address 1.1.1.1 255.255.255.255
#
interface GigabitEthernet0/0/0
 ip address 10.10.10.4 255.255.255.254
#
interface GigabitEthernet0/0/1
 ip address 10.10.10.2 255.255.255.254
#
***************************R2
sys
sysname R2
#
#
interface LoopBack0
 ip address 2.2.2.2 255.255.255.255
#
interface GigabitEthernet0/0/0
 ip address 10.10.10.5 255.255.255.254
#
interface GigabitEthernet0/0/1
 ip address 10.10.10.1 255.255.255.254
#
***************************R3
sys
sysname R3
#
#
interface LoopBack0
 ip address 3.3.3.3 255.255.255.255
#
interface GigabitEthernet0/0/0
 ip address 10.10.10.0 255.255.255.254
#
interface GigabitEthernet0/0/1
 ip address 10.10.10.3 255.255.255.254
#

Step 2: Configure EBGP peering between routers in AS 100, AS 200, and AS 300. Advertise Loopback 0 networks on all routers.

*****************************R1
bgp 100
 router-id 1.1.1.1
 peer 10.10.10.3 as-number 200
 peer 10.10.10.5 as-number 300
 #
 ipv4-family unicast
  network 1.1.1.1 255.255.255.255
  peer 10.10.10.3 enable
  peer 10.10.10.5 enable
#
*****************************R2
bgp 300
 router-id 2.2.2.2
 peer 10.10.10.0 as-number 200
 peer 10.10.10.4 as-number 100
 #
 ipv4-family unicast
  network 2.2.2.2 255.255.255.255
  peer 10.10.10.0 enable
  peer 10.10.10.4 enable
#
*****************************R3
bgp 200
 router-id 3.3.3.3
 peer 10.10.10.1 as-number 300
 peer 10.10.10.2 as-number 100
 #
 ipv4-family unicast
  network 3.3.3.3 255.255.255.255
  peer 10.10.10.1 enable
  peer 10.10.10.2 enable
#

Step 3: Verify BGP peering Status on all routers.

Step 4: Verify the BGP routing table on R1, R2, and R3.

R1, R2, and R3 are learning from each other correctly. The objective of this lab is to prevent R1 advertising routes learned from AS 200 to AS 300 and vice versa using AS_PATH filters.

Step 5: Configure AS_PATH filters on R1 to control router advertised from R1 to R2 and R3.

*****************************R1
#
ip as-path-filter FILTER_AS_200 deny _200_
ip as-path-filter FILTER_AS_200 permit .*
ip as-path-filter FILTER_AS_300 deny _300_
ip as-path-filter FILTER_AS_300 permit .*
#
bgp 100
  peer 10.10.10.3 as-path-filter FILTER_AS_300 export
  peer 10.10.10.5 as-path-filter FILTER_AS_200 export
#

Step 6: Verify that R1 does not advertise routes learned from R2 and R3 to each other.

R1 only advertises its own routes to R2 and R3. Other routes are not advertised.

Thank You for reading our article. Check out other related posts on our website:

Related Posts

Check out our YouTube channel for more content. Lyfey Technologies Channel



Leave a Reply

This website uses cookies and asks your personal data to enhance your browsing experience.