08-14-2008 06:43 AM - edited 03-06-2019 12:47 AM
Can a router have 2 IP addresses?
What is the meaning of secondary IP address? can a router have secondary IP address?
08-14-2008 07:04 AM
Faizan
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 172.16.1.1 255.255.255.224
this would be the primary address. And then we could configure:
ip address 172.16.2.1 255.255.255.224 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 172.16.1.0/27 as locally attached and will also treat all devices in subnet 172.16.2.0/27 as locally attached.
HTH
Rick
08-14-2008 08:33 AM
FYI: An interface can have more than two IP addresses. Each additional IP address is applied to the interface using the secondary argument.
08-16-2008 05:00 AM
Sorry for this question but,
What would be the use of having a secondary IP address on a router?
08-16-2008 11:48 AM
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.
08-16-2008 05:36 AM
Rick:
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.
Thanks
Victor
08-16-2008 02:22 PM
Victor
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.
HTH
Rick
08-16-2008 03:11 PM
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.
08-16-2008 03:20 PM
Eric
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.
HTH
Rick
08-16-2008 05:30 PM
Cool. I thought otherwise. There is still part of me believing otherwise but the only way or me to prove it is to test in a lab. But, thank you for correcting me.
08-16-2008 05:19 PM
Rick:
Thank you, sir. Brilliant, as usual...
Victor
08-16-2008 06:15 PM
Victor
Thank you. It is, again, a pleasure to interact with you on the forum.
Eric
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.
HTH
Rick
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide