Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Secondary IP on subinterface

Status
Not open for further replies.

pbxnkey

Programmer
Aug 15, 2006
191
US
I have a router that has 2 IP's on the fastethernet with different subnets. I need to change the interface to a subinterface . I don't see an option to create a secondary IP on the subinterface. Is there a way around this other than creating a subinterface for each subnet?
 
I was having a chat about secondary IP addresses with a colleague just this morning: they used to be quite common in the past, people would have multiple subnets on the same broadcast segment. It was a carry over from times when network infrastructure didn't support VLANs. Now, you have 1 subnet = 1 VLAN, so no secondary IP addresses. On routers, each VLAN/subnet is therefore hanging off its own subinterface.
In your situation, you essentially need to redesign your network in terms of where that second subnet is deployed.
 
Secondary IP address capability is quite alive and used when needed. You can put it on a physical interface or sub-interface, does not matter. Below is the example of 2 routers with IOS 15.1 and IOS 12.4 and how to make sub-ifs with 2 addresses each. I also have had it working on IOS 12.1, 12.2 and 12.3. Bear in mind that this is typically done for transition purposes. A healthier design would be VLAN carrying a single subnet. However, techically, NOTHING prevents one from sticking >1 subnet into a VLAN, except for design considerations, or course.
Let me know if this is not clear and I hope this helps.

ROUTER 1 (7200)
----
cre-gw1-in#sh ver | i IOS
Cisco IOS Software, 7200 Software (C7200-ADVENTERPRISEK9-M), Version 15.1(4)M3a, RELEASE SOFTWARE (fc1)
...........

cre-gw1-in#sh run | sec interface
interface FastEthernet0/0
no ip address
duplex full
interface FastEthernet0/0.1
encapsulation dot1Q 1 native <-----------------------FOR THE TRUNK TO COME UP
interface FastEthernet0/0.10
encapsulation dot1Q 10
ip address 10.10.2.1 255.255.255.0 secondary
ip address 10.10.1.1 255.255.255.0
interface FastEthernet0/0.20
encapsulation dot1Q 20
ip address 10.20.2.1 255.255.255.0 secondary
ip address 10.20.1.1 255.255.255.0
...........
The below will only show ONE address per if/subif:

cre-gw1-in#sh ip int b
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 unassigned YES unset up up
FastEthernet0/0.1 unassigned YES unset up up
FastEthernet0/0.10 10.10.1.1 YES manual up up
FastEthernet0/0.20 10.20.1.1 YES manual up up
====================

ROUTER 2 (3660)
-----
cre-gw5-in#sh ver | i IOS
Cisco IOS Software, 3600 Software (C3660-IS-M), Version 12.4(16), RELEASE SOFTWARE (fc1)
...........

cre-gw5-in#sh run | sec interface
interface FastEthernet0/0
no ip address
duplex auto
speed auto
interface FastEthernet0/0.1
encapsulation dot1Q 1 native
interface FastEthernet0/0.10
encapsulation dot1Q 10
ip address 10.10.2.2 255.255.255.0 secondary
ip address 10.10.1.2 255.255.255.0
interface FastEthernet0/0.20
encapsulation dot1Q 20
ip address 10.20.2.2 255.255.255.0 secondary
ip address 10.20.1.2 255.255.255.0
...........

cre-gw5-in#sh ip int b
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 unassigned YES unset up up
FastEthernet0/0.1 unassigned YES manual up up
FastEthernet0/0.10 10.10.1.2 YES manual up up
FastEthernet0/0.20 10.20.1.2 YES manual up up
FastEthernet0/1 unassigned YES unset administratively down down
...........
From the 1st router:

cre-gw1-in#ping 10.10.1.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 24/29/32 ms
cre-gw1-in#ping 10.10.2.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.2.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/28/36 ms
cre-gw1-in#ping 10.20.1.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.20.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 24/32/40 ms
cre-gw1-in#ping 10.20.2.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.20.2.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 24/27/28 ms
 
Actually it does help. I did not have a spare router to test so I was using Packet Tracer and it did not allow me to add a secondary address on a subinterface. I will have to see if I can dig up a spare router.
 
My laptop is too slow and it slows even more when I use gns3
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top