cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1427
Views
0
Helpful
6
Replies

Allowing specific networks through OSPF interfaces

rwharris13
Level 1
Level 1

I'm not sure what I'm even looking to do can even be done but here's the scenario.

Router A advertises a default route to all ospf nodes with the "default-information-originate always" command

Router B connects to router A and to Router D

Router C connects to router A and to Router D

Router D has many networks advertised but we will say these are the pertinent ones:

Network 1 - 192.168.10.0/30

and

Network 2 - 192.168.11.0/30

And as previously mentioned, Router D has a connection to Router B and C on their own indivudual link.

All routers are part of the same area.

Is there a way to make it so that router A, see's Network 1 and prefers the path through Router B instead of Router C, and that Network 2 has a prefered path through Router C instead of B while also having default traffic take the same path it came from?

If this were EIGRP, I would easily make a distribute list for each of the interfaces on Router D that connect to B and C but distribute lists won't work in OSPF, is there an alternative?

1 Accepted Solution

Accepted Solutions

ashirkar
Level 7
Level 7

Hello Ron,

Hope your doing well,

First i would  like to tell you that OSPF doesn't support unequal load balancing like  eigrp does so it is difficult to do prefix link load balancing with  using cost.In your case if all of your link are having same bandwidth  you might be having 2 equal cost for each network i.e for net1 and  net2.rest of packet forwarding is done on data plane that is your cef is  doing packet forwarding depending on per destination/per packet.

You can verify your packet forwarding for specific subnet using this command and check on which interface packets going

sh ip cef 192.168.1.0 255.255.255.252

sh ip cef exact-route

In your case you can use policy-base routing.


for net 1 you match in Access-list and set next hop of router B and for net 2 you can use normal routing.

Here is doc link for PBR

https://supportforums.cisco.com/docs/DOC-1634

Hope it helps

Regards,

Ashish

View solution in original post

6 Replies 6

acampbell
VIP Alumni
VIP Alumni

Hi,

May be this link will help:-

http://www.cisco.com/en/US/docs/ios/12_0s/feature/guide/routmap.html

Regards,
Alex.
Please rate useful posts.

Regards, Alex. Please rate useful posts.

ashirkar
Level 7
Level 7

Hello Ron,

Hope your doing well,

First i would  like to tell you that OSPF doesn't support unequal load balancing like  eigrp does so it is difficult to do prefix link load balancing with  using cost.In your case if all of your link are having same bandwidth  you might be having 2 equal cost for each network i.e for net1 and  net2.rest of packet forwarding is done on data plane that is your cef is  doing packet forwarding depending on per destination/per packet.

You can verify your packet forwarding for specific subnet using this command and check on which interface packets going

sh ip cef 192.168.1.0 255.255.255.252

sh ip cef exact-route

In your case you can use policy-base routing.


for net 1 you match in Access-list and set next hop of router B and for net 2 you can use normal routing.

Here is doc link for PBR

https://supportforums.cisco.com/docs/DOC-1634

Hope it helps

Regards,

Ashish

Hi,

One way is to go as Ashish suggest of PBR.

Another way is to use of Distribute list and Distribute list work very well with OSPF.

Distribute-list prevent route getting installed in routing table, they would be there in topology table.

Probably, you can share your config with distribute-list which you  tried, so that we can figure out whats missing.

Regards,

Smitesh

Hi,

I tried simulating it in LAB..

Can you check below config and output to verify, is this what you wanted...

Route Table before Distribute-list

R1#sh ip ro ospf

     2.0.0.0/24 is subnetted, 1 subnets

O       2.2.2.0 [110/2] via 10.10.12.2, 00:02:04, FastEthernet0/1

     3.0.0.0/24 is subnetted, 1 subnets

O       3.3.3.0 [110/2] via 10.10.13.3, 00:01:35, FastEthernet0/0

     192.168.10.0/30 is subnetted, 1 subnets

O       192.168.10.0 [110/3] via 10.10.13.3, 00:00:13, FastEthernet0/0

                     [110/3] via 10.10.12.2, 00:00:13, FastEthernet0/1

     192.168.11.0/30 is subnetted, 1 subnets

O       192.168.11.0 [110/3] via 10.10.13.3, 00:00:03, FastEthernet0/0

                     [110/3] via 10.10.12.2, 00:00:03, FastEthernet0/1

     10.0.0.0/24 is subnetted, 4 subnets

O       10.10.24.0 [110/2] via 10.10.12.2, 00:02:04, FastEthernet0/1

O       10.10.34.0 [110/2] via 10.10.13.3, 00:01:35, FastEthernet0/0

Now we will apply distribute list as below

R1#sh run | sec ospf

ip ospf network point-to-point

ip ospf 1 area 0

ip ospf 1 area 0

ip ospf 1 area 0

router ospf 1

log-adjacency-changes

default-information originate always

distribute-list prefix NET1 in FastEthernet0/0

distribute-list prefix NET2 in FastEthernet0/1

R1#

R1#sh ip prefix-list

ip prefix-list NET1: 2 entries

   seq 5 deny 192.168.11.0/30

   seq 10 permit 0.0.0.0/0 le 32

ip prefix-list NET2: 2 entries

   seq 5 deny 192.168.10.0/30

   seq 10 permit 0.0.0.0/0 le 32

R1#

R1#sh ip route ospf  | i 192.168

     192.168.10.0/30 is subnetted, 1 subnets

O       192.168.10.0 [110/3] via 10.10.13.3, 00:02:15, FastEthernet0/0

     192.168.11.0/30 is subnetted, 1 subnets

O       192.168.11.0 [110/3] via 10.10.12.2, 00:02:15, FastEthernet0/1

Regards,

Smitesh Kharecha


PS: Please rate helpful posts

Smitesh, I forgot to add I cannot edit R1's OSPF config, it must stay as it is.

rwharris13
Level 1
Level 1

Ashish thank you, I did get this working with some PBR

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: