cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2888
Views
4
Helpful
12
Replies

OSPF on interface with primary and secondary address

rachelhor
Level 1
Level 1

Hi,

I need advice urgently.

Q1) Is it possible to configure 2 OSPF process, one for primary ip address and one for secondary ip address?

Q2) What about both the 2 OSPF processes for same ip address (secondary)?

Q3) I understand that OSPF does not work for secondary ip address. How and what should I do if I need to configure ospf process for secondary ip address?

Both primary and secondary ip addresses are configured on same FE port.

Will there be any conflicts?

Do I need to configure split-horizon?

Thank you.

12 Replies 12

Hello,

OSPF does not build adjacencies over secondary addresses, and you can only advertise the secondary address if you also advertise the primary address. Also, both primary and secondary address have to be in the same area.

What exactly is your situation ? Do you have two customers on the same interface that need separate routing processes ?

As with regard to split horizon, that is not an issue with OSPF (it would be in the case of e.g. EIGRP).

Regards,

GP

Hi,

Pls advice me how and what to do.

I read somewhere about OSPFv2 configure on interface "ip ospf area" can allow ospf to run over secondary addresses of this interface.

Q1) Does this method really help?

The version I use is 12.3,but there is no "ip ospf area" command available for my interface.

Q2) Why is this so?

Q3) If I am ok to advertise both the primary and secondary addresses and make them both in same area, how do I configure to make ospf build adjacencies over the secondary address?

Q4) In addition to Q3 above, if primary address is NOT connected to its respective network, will the primary address still be advertised out the secondary address?

Q5) In addition to Q3 above, is it possible to set route maps or access list to prevent primary from being advertised?

Pls help .... I need a solution fast.

Thank you.

Rgds,

Rachel

Hi,

I managed to configure "ip ospf area 0" on the interface.

I make both primary and secondary in same area.

But, when I check the router connected to this interface, the secondary address route is not advertised.

Then I configured "redistribute connected subnets" on the router that has secondary address.

But when I go to the other router, the secondary address route is still not advertised.

OSPF is still not associating adjacency via the secondary address.

Pls HELP!!!

I am desperate for solution.

Thank you.

Regards,

Rachel

Hello Rachel,

can you post the configuration of your router ?

Regards,

GP

Hi GP,

Here's my config on Router1

interface FastEthernet0/0

description to Router2

ip address 172.16.1.2 255.255.0.0 secondary

ip address 192.168.1.2 255.255.0.0

duplex auto

speed auto

!

interface FastEthernet0/1

description to Internal Network

ip address 10.66.1.1 255.255.0.0

duplex auto

speed auto

!

router ospf 1

log-adjacency-changes

network 10.66.0.0 0.0.255.255 area 0

network 172.16.0.0 0.0.255.255 area 0

network 192.168.0.0 0.0.255.255 area 0

Configuration of Router2

interface FastEthernet0/0

description to Router1

ip address 172.16.1.1 255.255.0.0

duplex auto

speed auto

!

interface FastEthernet0/1

description to Internal Network

ip address 1.1.1.1 255.255.0.0

duplex auto

speed auto

router ospf 1

log-adjacency-changes

network 1.1.0.0 0.0.255.255 area 0

network 172.16.0.0 0.0.255.255 area 0

Pls advice.

Thank you.

Rgds,

Rachel

Rachel

The problem in your config is that router1 defines 192.168.1.2 as the primary address. OSPF hello messages will use this as the source address. However router2 defines 172.16.1.1 as the primary address. Its OSPF hello messages will use that address as the source. So each router is receiving hello messages with a source address that do not match its primary address. Therefore they do not become neighbors.

The configs suggest that the routers are connected over their FastEthernet0/0 interfaces. Is that the case? If so there is an issue about the usage of secondary addresses. It is the best practice when routers are on a common segment and secondary addresses are being used to configure primary and secondary addresses on each router and it is imperative that both routers use the same subnet as the primary address.

HTH

Rick

HTH

Rick

Hi Rick,

If I change the config on Router1 FE0/0 to the following, does it help?

interface FastEthernet0/0

description to Router2 and Router3

ip address 172.16.1.2 255.255.0.0 secondary

ip address 192.168.1.2 255.255.0.0

ip ospf 1 area 0

duplex auto

speed auto

Yes, I need to configure Router1 with 2 ip addresses on FE and use this single FE to connect to 2 separate routers, router2 and router3 of different networks.

Router3 is not mentioned in my mail because router3 is connected to primary address so it has no problem.

But router2 is connected to the secondary address so it has problem.

With reference to my above usage, is there no way to resolve this?

Is using sub-interfaces instead of secondary address the only solution?

Thank you.

Rgds,

Rachel

T

Rachel

The changes that you have made are to change the description (which is a comment and does not affect how the router behaves) and to add the ip ospf area 0. Neither of these addresses the fundamental problem. I do not see that they help at all (except that the change in the description helps me understand a little better what is happening).

As long as router1 believes that 192.168.1.2 is the primary address and router 2 believes that 172.16.1.1 is the primary address they will never become neighbors. The only way to fix this is to resolve the mismatch in addressing.

It might help if you could explain a bit more about what is going on. The fact that you have router 1 and router3 using the 192.168.0.0 network (do you really mean to use the 255.255.0.0 mask?) and have router1 and router2 using 172.16.0.0 (the 255.255.0.0 mask makes slightly more sense here but I wonder if you really mean it) seems to imply that you are trying to separate router2 and router3 as if they can not communicate with each other. However the way that you have it set up (both addresses on the physical interface of router1) indicates that they are both in the same broadcast domain and in the same layer 2 network. If they are in the same layer 2 network there will not really be effective separation at layer 3.

It would help if you explain what the physical topology is. If they are connected by a switch are they in the same VLAN or in different VLANs? If they are not connected by a switch then how are they connected? Once we have a better understanding of the topology we can determine what the best solution would be. (subinterfaces are appropriate if you are connected by a switch which defines multiple VLANs and secondary addresses may be appropriate if connected to a switch with a single VLAN or connected by something other than a switch).

Help us understand what you are really trying to accomplish and we can find a solution that works for that.

HTH

Rick

HTH

Rick

Hi Rick,

My idea is very simple, actually.

Router2 and router3 will be directly connected, but they should NOT communicate via Router1.

At any point in time, Router1 is connected to only 1 router, in other words, if Router1 is connected to Router2, it is then NOT connected to Router3.

For example, when router1 is connected to router3, router2 communicates with router1 via router3 and vice versa.

But at all times, router2 and router3 will be connected and should not be affected by router1.

So, no switch will be used at Router1.

I find that if I do not use ospf, it can work.

But I want to use OSPF so that router2 and router3 knows who is now connected to router1 and has the route.

My objective:

1) Do not need to buy additional switch

2) Router1 is like a portable router, when I go to location where router3 is connected, I can connect router1 connected router3 without the need for re-configuration. Likewise for router2.

3) Both router2 and router3 must know which router has the route to router1.

I have a question.

Q)If I change the primary address to 192.168.1.1 with mask 255.255.255.0, and change the secondary address and router2 ip addresses from 172.168.1.1 to 192.168.2.1 and 192.168.2.2 (on router2) mask 255.255.255.0, will it work?

Pls help and advice.

Thank you.

Regards,

Rachel

Rachel

There are still some things about your situation that I do not understand. Can you clarify these points for me.

- you say that router2 and router3 are directly connected and communicate with each other. But if router2 has its address in 172.16 and router3 has its address in 192.168 then how are they going to communicate with each other? There seems to be a mismatch between what we are saying at layer2 (they are connected) and what we are saying at layer3 (they are separate). The IP addresses indicate that they are remote from each other. Do you have a solution for that?

- I think that you are saying that router1 should communicate with router2 or with router3 but not both at the same time. If router1 has addresses in both networks I am not sure how you can accomplish that. You might be able to do it by assigning and changing an inbound access list that will permit traffic from only one of the neighbors. But you seem to have a restriction that this should happen with no configuration changes.

- you say this:"when I go to location where router3 is connected, I can connect router1 connected router3 without the need for re-configuration". But if router2 and router3 are directly connected how can they have different locations?

I still have difficulty understanding what you are trying to accomplish and how router2 and router3 can be directly connected, will connect to router1 on the same interface, and router1 will communicate only with one or the other router. If router2 and router3 connected to each other on one interface and connected to router1 on a different interface it might be achievable.

Or if the connection were over an interface with PPP where the PPP negotiation sould put a host route into the table there might be a way. But when the conditions say that router2 and router3 are connected and communicate directly but router1 will connect on the same interface but will communicate with only 1 of the routers, then I get confused.

HTH

Rick

HTH

Rick

Rachel

After posting this response I had a thought for an alternative that might work and might accomplish what you are trying to do. It involves running multiple routing protocols among the routers. My idea is that you configure the same network/subnet on the interfaces of all three routers. Configure a routing protocol (perhaps OSPF) to run between router2 and router3 and so that they can share information with each other. Do not configure OSPF on router1. Then configure some other protocol (perhaps EIGRP) on router1 and router2. On router2 redistribute EIGRP into OSPF so that when router2 discovers that it has a neighbor at router1 it will learn routes from router1 and will advertise them to router3. Then configure some other protocol (perhaps RIP) between router1 and router3. On router3 redistribute RIP into OSPF so that when router3 discovers that it has a neighbor at router1 it will learn routes from router1 and will advertise them to router2.

The flaw in this theory is that without some configuration change on router1 it will become neighbor to both router2 and router3. But if you connect router1 and make EIGRP passive interface then it will be actively running only RIP and will communicate with router3. And if you make EIGRP active interface and make RIP passive interface then router1 will become neighbor with rourer 2.

It is slightly convoluted and does require a configuration change on router1. But it is the closest thing I can figure that may achieve what you are trying to do.

HTH

Rick

HTH

Rick

Hi Rick,

Than you very much.

You are of great help.

:)