Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Community Member

OSPF and loopback interface

Hello,

When you set a loopback interface port, do you use the same ip address as the interface configured for the area number? Example, if the interface is 192.168.0.1, will your loopback ip address be 192.168.0.1?

Do you increment the ip address for example: 192.168.0.2

Thank you,

4 REPLIES
Hall of Fame Super Gold

Re: OSPF and loopback interface

Jason

I do not understand whether your question is asking how you configure a loopback interface or whether you are asking how you configure OSPF to process on the loopback interface.

A loopback interface is a virtual interface on a router. You assign an IP address to the loopback interface much as you would assign an address on a physical interface. The subnet mask for the loopback interface can be a normal subnet mask or it could be a host specific /32 mask (255.255.255.255). What mask to use depends on how your network is designed.

Once you have assigned an IP address on the loopback interface if you want to have OSPF include the interface then you would need a network statement under router ospf that would include the loopback interface address. If your loopback interface were assigned address 172.16.1.10 then any of these network statements could work:

network 172.16.1.10 0.0.0.0 area 10

network 172.16.1.0 0.0.0.31 area 10

network 172.16.0.0 0.0.255.255 area 10

If this does not explain what you want then perhaps you can clarify your question.

HTH

Rick

Community Member

Re: OSPF and loopback interface

Thank you for your help, and understand.

I guess I am a little confused. Here is what i have.

config t

router ospf 1

network 192.168.20.1 0.0.0.0 area 0

do i configure my loopback as the following

config t

int lo0

ip address 192.168.20.1 255.255.255.0

no shut

Thank you,

Jason

Hall of Fame Super Gold

Re: OSPF and loopback interface

Jason

This config looks ok. With the network statement of network 192.168.20.1 0.0.0.0 area 0 then the interface address must be 192.168.20.1. The subnet mask of 255.255.255.0 is fine (or it could use a subnetted mask if you wanted to use part of that network somewhere else).

HTH

Rick

Re: OSPF and loopback interface

Hi Jason,

I guess your confusion comes from the fact of how the wildcard mask of the network command of OSPF is related to the IP address under the interface, well the whole idea is that the network command matches which interface to run OSPF, for example if the network command is 192.168.20.0 0.0.0.255, thus any interface with an IP address falling between 192.168.20.1 and 192.168.20.254 will run OSPF, while if the network statement is 192.168.20.1 0.0.0.0, thus only an interface having an IP address of 192.168.20.1 will run OSPF, its clear now that the wildcard mask of the network command is not related to the subnet mask of the interface.

I hope that i've been informative.

HTH,

Mohammed Mahmoud.

603
Views
0
Helpful
4
Replies
CreatePlease to create content