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

OSPF - denying specific static routes

GW M
Level 1
Level 1

I have a router (I will call it router A) that is communicating with OSPF to other routers over the WAN. Router A also has an LAN interface where I have a static route 192.168.3.0/24 with a next hop to a router B. The following config below is:

router ospf 1

router-id 10.1.6.6

log-adjacency-changes

area 0.0.0.0 authentication

redistribute connected subnets

redistribute static subnets

network 32.1.19.251 0.0.0.0 area 0.0.0.0 

default-information originate

Is it possible to have router A know about the static route 192.168.3.0/24 with a next hop to router B but suppress the 192.168.3.0/24 subnet from being propagating into OSPF over the WAN? I would like to keep the static route 192.168.3.0/24 to only Router A while still allowing all other static routes to be propagated into OSPF.

Thanks

GM

1 Accepted Solution

Accepted Solutions

premkumarjm
Level 1
Level 1

Hi,

Hope, you want a specific static route has to be deny to advertise in the OSPF running routers. By configuring route-map and specifying in the OSPF configuration. It may help to achieve your needs.

Please find the below configuration:

Here I used route-map to block the 132.147.0.0 to be advertise in the R1.

R2#sh run | sec ip route
ip route 132.147.0.0 255.255.0.0 FastEthernet0/1
ip route 172.26.8.100 255.255.255.252 FastEthernet0/1

R2#sh run | sec ospf|route-map|access
router ospf 20
 log-adjacency-changes
 redistribute connected subnets
 redistribute static subnets route-map OSPF-DENY
 network 10.10.100.148 0.0.0.3 area 1
 network 223.31.71.112 0.0.0.3 area 1


access-list 10 deny   132.147.0.0 log


route-map OSPF-DENY deny 10
 match ip address 10

R1 routing table:

R1#sh ip route | begin Gate
Gateway of last resort is not set

     223.31.70.0/30 is subnetted, 1 subnets
C       223.31.70.68 is directly connected, FastEthernet0/1
     223.31.71.0/30 is subnetted, 1 subnets
C       223.31.71.112 is directly connected, FastEthernet0/0
O E2 192.168.15.0/24 [110/20] via 223.31.71.113, 01:04:08, FastEthernet0/0
     172.26.0.0/30 is subnetted, 1 subnets
O E2    172.26.8.100 [110/20] via 223.31.70.69, 00:56:04, FastEthernet0/1
     10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C       10.10.2.0/24 is directly connected, Loopback1
O       10.10.100.148/30 [110/20] via 223.31.71.113, 01:02:48, FastEthernet0/0

BR

Prem

View solution in original post

3 Replies 3

Ciscomania
Level 1
Level 1

Bro,
Can you jsut draw very clear topology,cuz I did not get you correctly what exactly you want to do.
Did I get you correctly from my picture?


premkumarjm
Level 1
Level 1

Hi,

Hope, you want a specific static route has to be deny to advertise in the OSPF running routers. By configuring route-map and specifying in the OSPF configuration. It may help to achieve your needs.

Please find the below configuration:

Here I used route-map to block the 132.147.0.0 to be advertise in the R1.

R2#sh run | sec ip route
ip route 132.147.0.0 255.255.0.0 FastEthernet0/1
ip route 172.26.8.100 255.255.255.252 FastEthernet0/1

R2#sh run | sec ospf|route-map|access
router ospf 20
 log-adjacency-changes
 redistribute connected subnets
 redistribute static subnets route-map OSPF-DENY
 network 10.10.100.148 0.0.0.3 area 1
 network 223.31.71.112 0.0.0.3 area 1


access-list 10 deny   132.147.0.0 log


route-map OSPF-DENY deny 10
 match ip address 10

R1 routing table:

R1#sh ip route | begin Gate
Gateway of last resort is not set

     223.31.70.0/30 is subnetted, 1 subnets
C       223.31.70.68 is directly connected, FastEthernet0/1
     223.31.71.0/30 is subnetted, 1 subnets
C       223.31.71.112 is directly connected, FastEthernet0/0
O E2 192.168.15.0/24 [110/20] via 223.31.71.113, 01:04:08, FastEthernet0/0
     172.26.0.0/30 is subnetted, 1 subnets
O E2    172.26.8.100 [110/20] via 223.31.70.69, 00:56:04, FastEthernet0/1
     10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C       10.10.2.0/24 is directly connected, Loopback1
O       10.10.100.148/30 [110/20] via 223.31.71.113, 01:02:48, FastEthernet0/0

BR

Prem

GW M
Level 1
Level 1

Thank you

GM

Review Cisco Networking products for a $25 gift card