03-26-2013 07:40 AM - edited 03-07-2019 12:29 PM
Hi
seeking for support on route-map ;
we want to advertise certain static and certain connected subnets in ospf - how to have this control using route-map
How to restrict <vlan 5> subnet and restrict static route <ip route 192.168.50.0 255.255.255.0 10.10.25.10> from advertising in OSPF
int vlan 5
ip add 10.10.2.1 255.255.255.0
int vlan 6
ip add 10.10.3.1 255.255.255.0
router ospf 2
log-adjacency-changes
redistribute connected subnets
redistribute static subnets
redistribute network 192.168.1.0 0.0.0.255 area 0
network 10.10.1.0 0.0.1.255 area 0
ip route 0.0.0.0 0.0.0.0 192.168.100.10
ip route 192.168.40.0 255.255.255.0 10.10.20.250
ip route 192.168.41.0 255.255.255.0 10.10.20.250
ip route 192.168.50.0 255.255.255.0 10.10.25.10
thanks
ST
Solved! Go to Solution.
03-26-2013 07:55 AM
Hello Saquib,
you would need to add a route-map to the command for redistribute static
router ospf XX
redistribute static subnets route-map SELECTED-STATIC
route-map SELECTED-STATIC permit 10
match ip address 25
access-list 25 permit 192.168.50.0 0.0.0.255
CAUTION:
the ip next-hop of the static route has to be advertised as an internal OSPF network as it becomes the forwarding address in the LSA type 5 generated by above redistribution command
In the same way a different route-map can be invoked to redistribute only few connected routes
When possible use passive-interface + network area command instead of redistribute connected route-map NAME subnets as it will generate internal routes instead of external routes.
Edit:
see Alain's answer I have misunderstood your request
Hope to help
Giuseppe
03-26-2013 07:57 AM
Hi,
ip prefix-list CONNECTED_PREFIX deny x.x.x.x/xx where x.x.x.x/xx is the VLAN 5 subnet
ip prefix-list CONNECTED_PREFIX permit 0.0.0.0/0 le 32
ip prefix-list STATIC_PREFIX deny 192.168.50.0/24
ip prefix-list STATIC_PREFIX permit 0.0.0.0/0 le 32
route-map CONNECTED permit 10
match ip address prefix CONNECTED_PREFIX
route-map STATIC permit 10
match ip address prefix STATIC_PREFIX
router os 2
redistr connected subnets route-map CONNECTED
redistribute static subnets route-map STATIC
Regards
Alain
Don't forget to rate helpful posts.
03-26-2013 07:55 AM
Hello Saquib,
you would need to add a route-map to the command for redistribute static
router ospf XX
redistribute static subnets route-map SELECTED-STATIC
route-map SELECTED-STATIC permit 10
match ip address 25
access-list 25 permit 192.168.50.0 0.0.0.255
CAUTION:
the ip next-hop of the static route has to be advertised as an internal OSPF network as it becomes the forwarding address in the LSA type 5 generated by above redistribution command
In the same way a different route-map can be invoked to redistribute only few connected routes
When possible use passive-interface + network area command instead of redistribute connected route-map NAME subnets as it will generate internal routes instead of external routes.
Edit:
see Alain's answer I have misunderstood your request
Hope to help
Giuseppe
03-26-2013 07:57 AM
Hi,
ip prefix-list CONNECTED_PREFIX deny x.x.x.x/xx where x.x.x.x/xx is the VLAN 5 subnet
ip prefix-list CONNECTED_PREFIX permit 0.0.0.0/0 le 32
ip prefix-list STATIC_PREFIX deny 192.168.50.0/24
ip prefix-list STATIC_PREFIX permit 0.0.0.0/0 le 32
route-map CONNECTED permit 10
match ip address prefix CONNECTED_PREFIX
route-map STATIC permit 10
match ip address prefix STATIC_PREFIX
router os 2
redistr connected subnets route-map CONNECTED
redistribute static subnets route-map STATIC
Regards
Alain
Don't forget to rate helpful posts.
03-26-2013 10:24 PM
Thank you both gentlemen
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide