2 IP Adresses for a Router.

Unanswered Question
Aug 14th, 2008

Can a router have 2 IP addresses?

What is the meaning of secondary IP address? can a router have secondary IP address?

I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (1 ratings)
Richard Burts Thu, 08/14/2008 - 07:04


The meaning of your first question is not clear. Yes a router can have 2 IP addresses. This can happen in several ways. If a router has 2 interfaces and each interface has an IP address then the router will have 2 IP addresses. Or a router can have 1 interface and on that interface can configure a primary IP address and a secondary IP address.

Your second question seems to indicate that your question is really about secondary addresses. Perhaps an example will help to explain what this is and how it works. So if we have an interface:

interface FastEthernet0/0

and on that interface we configure:

ip address

this would be the primary address. And then we could configure:

ip address secondary

and this would create the secondary address. When we do this it makes 2 different subnets to be active on that interface at the same time. So the router will treat all devices in subnet as locally attached and will also treat all devices in subnet as locally attached.



bmbreer Thu, 08/14/2008 - 08:33

FYI: An interface can have more than two IP addresses. Each additional IP address is applied to the interface using the secondary argument.

Faizan Shaikh Sat, 08/16/2008 - 05:00

Sorry for this question but,

What would be the use of having a secondary IP address on a router?

Joseph W. Doherty Sat, 08/16/2008 - 11:48

To enable to the router's (Ethernet) interface to particpate in multiple subnets. If you're wondering about VLANs, many of the older routers didn't support VLAN trunks.

lamav Sat, 08/16/2008 - 05:36


Since we're on the subject, if those subnets you mention were created as primary and secondary subnets on an SVI, would both those subnets be part of the same vlan/broadcast domain?

I think yes.



Richard Burts Sat, 08/16/2008 - 14:22


You are Spot on. By definition an SVI is a single broadcast domain.

While we typically think of subnets as providing isolation and that devices in one subnet need a layer 3 device to be able to communicate with devices in another subnet, that assumption is not true when there is a primary and a secondary subnet on an interface (including an SVI). Since they are in the same broadcast domain the devices in one subnet would be capable of communicating directly with devices on the other subnet.



Not meaning to be argumentative but I dont think it would be. If you have a secondary and a primary IP address of x.x.1.0/24 and x.x.2.0/24. If x.x.2.255 broadcasts out... it would not be forwarded to the 1.0/24 network. It would actually be dropped. Also, if you consider any traffic that you want to cross, for example you want 2.10 to talk to 1.10... the traffic would need to go to the router.

Richard Burts Sat, 08/16/2008 - 15:20


You are mistaken about this. Your opinion reflects the usual assumption that different subnets are in different broadcast domains. The question in this thread is specifically about what is the case when both subnets are in the same broadcast domain. By definition in a broadcast domain when a layer 2 broadcast is sent it is delivered to EVERY device in the broadcast domain. There is no need to forward from one subnet to the other for the broadcast. So in your suggestion if a broadcast is sent to x.x.2.255 then it becomes a layer 2 broadcast to every device in the broadcast domain, and every device in x.x.1.0 will receive the broadcast.



lamav Sat, 08/16/2008 - 17:19


Thank you, sir. Brilliant, as usual...


Richard Burts Sat, 08/16/2008 - 18:15


Thank you. It is, again, a pleasure to interact with you on the forum.


Thank you for your response. I understand your desire to understand the issue in the traditional framework. Most of us have been trained that x.x.1.0 is separate and distinct from x.x.2.0 and that a router is necessary for them to communicate (and the corresponding understanding that a broadcast in one subnet is not forwarded to other subnets). But these are founded on the basic assumption that a subnet is a broadcast domain and a broadcast domain is a subnet (which is how it usually is). But secondary addresses invalidate that assumption.

One of the lessons that I learned as I prepared for my CCIE was to be very careful about the assumptions that are made. I tested in the lab to come to an understanding of what happens when secondary addresses are configured. I hope that you will have a similar learning experience when you put into the lab the configuration of secondary addresses.




This Discussion