cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
420
Views
0
Helpful
3
Replies

route-map assistance

saquib.tandel
Level 1
Level 1

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

2 Accepted Solutions

Accepted Solutions

Giuseppe Larosa
Hall of Fame
Hall of Fame

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


View solution in original post

cadet alain
VIP Alumni
VIP Alumni

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.

Don't forget to rate helpful posts.

View solution in original post

3 Replies 3

Giuseppe Larosa
Hall of Fame
Hall of Fame

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


cadet alain
VIP Alumni
VIP Alumni

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.

Don't forget to rate helpful posts.

Thank you both gentlemen

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card