02-04-2009 11:35 AM - edited 03-06-2019 03:51 AM
Can I assign multiple IP addresses to the same interface?
example _ I have about 5 /30 subnets that are plugged into a switch. Can I assign the gateway IP address for each of those subnets to my router so that it can the the gateway device for each subnet?
Or is there a smarter way to do this?
02-04-2009 11:43 AM
Adam
It would help us to give better answers if we knew a bit more about your environment. But in general it is possible to configure a port on the switch as a trunk and to carry multiple VLANs over the trunk. Then you would configure the router interface to participate in the trunk, and would configure subinterfaces on the router interface, one subinterface per VLAN, and the IP address on the subinterface would be the gateway for the VLAN.
It might also be possible to configure multiple addresses on the router interface without using trunking by configuring a primary IP address and then a series of secondary addresses on the router interface.
HTH
Rick
02-04-2009 11:49 AM
You really want to avoid using 'ip address secondary' if possible. Make the interface into a trunk, then make your virtual subinterfaces such as fa0.1 fa0.2 fa0.3 etc and assign them an IP address. I'll post some example code in a second.
My example:
interface FastEthernet0/1
no ip address
no ip redirects
no ip proxy-arp
duplex auto
speed auto
no mop enabled
!
interface FastEthernet0/1.10
description Voice VLAN$FW_INSIDE$
encapsulation dot1Q 10
ip address 10.10.0.1 255.255.255.128
no ip redirects
no ip proxy-arp
ip nat inside
ip virtual-reassembly
!
interface FastEthernet0/1.20
description iSCSI VLAN$FW_INSIDE$
encapsulation dot1Q 20
ip address 10.20.0.1 255.255.255.128
no ip redirects
no ip proxy-arp
ip virtual-reassembly
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