Prefix list configuration
A common requirement for BGP configurations is to filter inbound routing announcements from a BGP peer. On the vRouter, this is accomplished using routing policies that are then applied to the BGP process as “import” policies. In this instance we use prefix lists in conjunction with route maps to accomplish this.
Creating an import policy creates the following inbound filtering policies:
- R1 should only accept network 12.0.0.0/8 from its eBGP peer, and reject everything else.
- R4 should allow all Internet routes, but reject all RFC 1918 networks from its eBGP peer.
This import policy is shown in following figure.
To create this inbound route filter, perform the following steps in configuration mode.
Router |
Step |
Command(s) |
---|---|---|
R1 |
Create a list of prefixes to allow. In this case we just have one - 12.0.0.0/8. |
|
R1 |
Create a route map rule to permit all prefixes in our list. |
|
R1 |
Create a route map rule to deny all other prefixes. |
|
R1 |
Assign the route map policy created as the import route map policy for AS 200. |
|
R1 |
Commit the configuration. |
|
R1 |
Reset the BGP session to the peer so that the new policies are enabled. |
|
R1 |
Display the policy configuration. |
|
R1 |
Display the BGP configuration for eBGP neighbor 88.88.88.2. |
|
R4 |
Create a rule to match any prefix from 10.0.0.0/8 to 32. |
|
R4 |
Commit the configuration. |
|
R4 |
Create a route map rule to deny all prefixes in our list. |
|
R4 |
Create a route map rule to permit all other prefixes. |
|
R4 |
Commit the configuration. |
|
R4 |
Assign the route map policy created as the import route map policy for AS 300. |
|
R4 |
Commit the configuration. |
|
R4 |
Reset the BGP session to the peer so that the new policies are enabled. |
|
R4 |
Display the policy configuration. |
|
R4 |
Display the BGP configuration for eBGP neighbor 99.99.99.2. |
|