05-29-2011 10:41 AM - edited 03-06-2019 05:15 PM
Hi --
I have a cat 3560 switch with VLANS. I would like to setup a VLAN port to be able to have 2 ip address ranges on it.
192.168.4.1 and 192.168.2.1. I am not sure how to configure the Gig E port to do this.
Do I setup two sub interfaces? Any assistance would be greatly appreciated.
Thank you
Joe
05-29-2011 12:28 PM
Joe,
Usually you correspond one vlan to one subnet, so for example
vlan 20 192.168.2.1/.24
vlan 40 192.168.4.1/24
You create an svi for each vlan
config t
inter vlan 20
ip add 192.168.2.1 255.255.255.0
inter vlan 40
ip add 192.168.4.1 255.255.255.0
then you assign what ever ports you want to each vlan
example
config t
inter gi1/0/10
switchport mode access
switchport access vlan 20
inter gi1/0/20
switchport mode access
switchport access vlan 40
HTH
Reza
05-29-2011 01:20 PM
The reply from Reza is a good explanation of how it is usually done. But it fails to address the point in the original post where Joe was quite clear that he wanted 2 subnets on the same interface.
The way that it is usually done makes an assumption that there is a one to one correspondence between VLAN and subnet. Joe says he needs a 2 to 1 correspondence. He can get that by configuring a secondary address on the VLAN interface.
HTH
Rick
Sent from Cisco Technical Support iPhone App
05-29-2011 06:39 PM
HI,
You use "secondary" keyword and can have multiple IP subnets under the same interface. However, there is a limitation depending on the device as how many secondary subnets you can have.
inter vlan 10
ip add 192.168.2.1 255.255.255.0
ip add 192.168.4.1 255.255.255.0 secondary.
Also just be mindful of secondary ip address limitations.
HTH
Regards
Kishore
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