As an example, consider the following network diagram:
OSPF Area 0 includes switches SW1, SW3 and SW4. In SW3, a static route to network 10.8.0.0/16 is configured, and this static route is configured to be redistributed into OSPF. Also in SW3, subnet 192.168.13.0/24 (or VLAN 13) is connected and also configured to be redistributed into OSPF.
We will focus on SW1, where both OSPF and BGP are configured, and where OSPF routes are exported into BGP.
First, the routing table in SW1 will look like this:
Notice that SW1 learned 3 routes from OSPF:
- 10.12.30.0/24 (VLAN 30) generated from with OSPF, hence listed here as "IntrArea" and considered an internal route.
- 10.8.0.0/16 and 192.168.13.0/24 (VLAN 13) distributed into OSPF from "static" and "connected", hence listed here as "External2" and considered external routes.
Now let's look at the distribution of these OSPF routes into BGP in SW1. Below is how SW1 is configured under BGP router (Scenario 1):
router bgp 1200
enable
redistribute ospf
neighbor 192.168.20.2 remote-as 1300
exit
With the above configuration, the BGP routing table in SW1 will look like:
As seen in the screenshot above, only the OSPF route 10.12.30.0/24 appeared in the BGP routing table. The reason is that the command "redistribute ospf" under BGP only exports OSPF internal routes into BGP. All external routes are excluded from the redistribution.
Now consider another BGP configuration in SW1 (Senario 2):
router bgp 1200
enable
network 10.8.0.0 255.255.0.0
redistribute ospf
neighbor 192.168.20.2 remote-as 1300
exit
In this configuration, under BGP we have the command "network 10.8.0.0 255.255.0.0". The resulting BGP routing table will looks like:
In the screenshot above, in addition to the OSPF internal route of 10.12.30.0/24 (VLAN 30) which is exported into BGP by the command redistribute ospf, the route to subnet 10.8.0.0/16 also appears in the BGP table because in this scenario we have the command network 10.8.0.0 255.255.0.0 under BGP. In contrast, a route to subnet 192.168.13.0/24 (VLAN 13) is not present in the BGP routing table because this subnet is not configured with the network command under BGP.
The bottom line is that in the ProCurve, OSPF external routes cannot be exported into BGP using the redistribute command. They have to be specified using the network command under BGP to be present in the BGP routing table. This is different from Cisco IOS, which allows the export of OSPF external routes into BGP by the command redistribute ospf 1 match external.
My notes on networking technology. This will always be a continuing effort as I review old topics and learn new ones. Comments are more than welcome.
Showing posts with label BGP. Show all posts
Showing posts with label BGP. Show all posts
Saturday, September 5, 2015
Tuesday, April 28, 2015
Creating and Using Route Maps in ProCurve Switches
Creating route maps:
A route map consists of “match” statements to select the routes for the intended policy. Optionally, “set” statements can be included to modify route properties. Optional prefix lists can also be configured to select routes for the "match" statements.
Prefix lists can be configured as in the following example:
ip prefix-list TestList seq 5 permit 10.1.1.1/24 ge 24 le 24
As seen above, prefix lists can only select routes by IP addresses. The “match” statements can select traffic based on various criteria, not just IP addresses. First create a route map, then configuring “match” statements and optional “set” statements using the syntax in the following examples:
route-map TestMap permit seq 5
match interface vlan 200: match the specified VLAN
match ip address prefix-list TestList: match the specified IP prefix
match ip next-hop 10.1.1.1: match the next hop with the specified IP address or prefix
match ip route-source prefix-list TestList: match the advertising router with the specified IP address or prefix
match metric 120
match route-type external [type-1|type-2]
match source-protocol [connected|static|rip|ospf|ospfv3|bgp]
match tag 200 (Note: the tag value is typically set by a set command on a different router)
set ip next-hop 10.10.10.1
set metric 60
set metric-type external [type-1|type-2]
set tag 100
In addition, you can match some BGP-specific parameters such as as-path, community, local-preference, and set as-path, community, local-preference, origin, and weight.
Using route maps:
There are two ways to use route maps in the ProCurve as described below.
In Route Redistribution:
Below is an example in route redistribution using prefix lists and a route map. Here only routes from networks 10.1.11.0/24 and 10.1.13.0/24 can be redistributed from RIP into OSPF:
ip prefix-list “Odds” seq 5 permit 10.1.11.1 255.255.255.0 ge 24 le 24
ip prefix-list “Odds” seq 10 permit 10.1.13.1 255.255.255.0 ge 24 le 24
route-map “PermitOdds” permit seq 10
match ip address prefix-list “Odds”
exit
router ospf area backbone
redistributed connected
redistributed rip route-map “PermitOdds”
exit
In BGP Route Advertisement:
In another example, a route map is used to filter BGP routes. In this case only routes matching prefix 1.1.0.0/16 advertised by neighbor 20.20.20.20 are accepted:
ip prefix-list “One” seq 5 permit 1.1.0.0/16 ge 16 le 16
route-map “PermitOne” permit seq 10
match ip address prefix-list “One”
exit
router bgp 100
neighbor 20.20.20.20 route-map “PermitOne” in
exit
Another place to use route map in BGP is with the following command in the router BGP context. Here the route map filters out what routes to be advertised by the BGP routing process:
network 1.0.0.0/8 route-map PermitOne
Note: Unlike Cisco routers, route maps in the ProCurve as of K/KA/KB.15.16 cannot be used for policy-based routing (PBR) configuration.
A route map consists of “match” statements to select the routes for the intended policy. Optionally, “set” statements can be included to modify route properties. Optional prefix lists can also be configured to select routes for the "match" statements.
Prefix lists can be configured as in the following example:
ip prefix-list TestList seq 5 permit 10.1.1.1/24 ge 24 le 24
As seen above, prefix lists can only select routes by IP addresses. The “match” statements can select traffic based on various criteria, not just IP addresses. First create a route map, then configuring “match” statements and optional “set” statements using the syntax in the following examples:
route-map TestMap permit seq 5
match interface vlan 200: match the specified VLAN
match ip address prefix-list TestList: match the specified IP prefix
match ip next-hop 10.1.1.1: match the next hop with the specified IP address or prefix
match ip route-source prefix-list TestList: match the advertising router with the specified IP address or prefix
match metric 120
match route-type external [type-1|type-2]
match source-protocol [connected|static|rip|ospf|ospfv3|bgp]
match tag 200 (Note: the tag value is typically set by a set command on a different router)
set ip next-hop 10.10.10.1
set metric 60
set metric-type external [type-1|type-2]
set tag 100
In addition, you can match some BGP-specific parameters such as as-path, community, local-preference, and set as-path, community, local-preference, origin, and weight.
Using route maps:
There are two ways to use route maps in the ProCurve as described below.
In Route Redistribution:
Below is an example in route redistribution using prefix lists and a route map. Here only routes from networks 10.1.11.0/24 and 10.1.13.0/24 can be redistributed from RIP into OSPF:
ip prefix-list “Odds” seq 5 permit 10.1.11.1 255.255.255.0 ge 24 le 24
ip prefix-list “Odds” seq 10 permit 10.1.13.1 255.255.255.0 ge 24 le 24
route-map “PermitOdds” permit seq 10
match ip address prefix-list “Odds”
exit
router ospf area backbone
redistributed connected
redistributed rip route-map “PermitOdds”
exit
In BGP Route Advertisement:
In another example, a route map is used to filter BGP routes. In this case only routes matching prefix 1.1.0.0/16 advertised by neighbor 20.20.20.20 are accepted:
ip prefix-list “One” seq 5 permit 1.1.0.0/16 ge 16 le 16
route-map “PermitOne” permit seq 10
match ip address prefix-list “One”
exit
router bgp 100
neighbor 20.20.20.20 route-map “PermitOne” in
exit
Another place to use route map in BGP is with the following command in the router BGP context. Here the route map filters out what routes to be advertised by the BGP routing process:
network 1.0.0.0/8 route-map PermitOne
Note: Unlike Cisco routers, route maps in the ProCurve as of K/KA/KB.15.16 cannot be used for policy-based routing (PBR) configuration.
Subscribe to:
Posts (Atom)