05-23-2005 02:43 PM - edited 03-03-2019 09:39 AM
Hi All,
Can we have the primary and secondary IP address of the router interface on the same subnet. Like
interface FastEthernet0/0
ip address 192.168.1.2 255.255.255.0 secondary
ip address 192.168.1.251 255.255.255.0
router#ping 192.168.1.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms
router#ping 192.168.1.251
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.251, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms
I am able to ping both the IPs.Any ideas why this configuration exists ?
Thanx
Praful
05-23-2005 02:52 PM
Praful,
I was going to reply back and say you can't do that, but you've proven that you can. I can't think of a reason that you'd want to. Maybe to change the default gateway address but that doesn't make much sense either. I would've gone with a standby HSRP address if i was doing that. Which address is usesd as the default GW for systems on that subnet?
Tony
05-23-2005 03:06 PM
Default GW is 192.168.1.251 for the hosts in this subnet. And I have T1 configured on this router with serial interface (ip unnumbered fa0/0) uses 192.168.1.251
Praful
05-23-2005 07:32 PM
I can't think of a good reason to have it then,,,,, I'd reckon you could remove the line safely.
Tony
05-24-2005 05:41 AM
My first reaction was like Tony to think that you should not be able to do this. But I think we were thinking in terms of the restriction that IOS imposes of not being able to put two interfaces into the same subnet (you do get an error about overlapping addresses). But if both addresses are on the same interface I guess it is legitimate.
I have been wondering why one might want to do this. And it occurred to me that if one group of PC were configured with a 255.255.255.128 mask using the lower part of the address range and another group of PC were configured with a 255.255.255.128 mask using the higher part of the address range, then this router config might make sense. But if you say that all the PCs have the same gateway address then two address ranges would not be the case.
From a functionality standpoint I do not see anything that would be impacted by removing the secondary address.
HTH
Rick
05-24-2005 06:48 AM
I only have a flat /24 network and no /25 subnets in this range. But I have some devices pointing to 192.168.1.2 and some pointing to 192.168.1.251 as Default GW.I better not disturb it now.
Praful
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