03-13-2019 07:12 PM
Is the custom VLAN on layer 2 switch only work when the same VLAN ID already setup in the router?
My C2960x has 1 interface direct connected to a router interface. I set this switch port to trunk mode. And set Vlan 1 to has a IP address. This configuration allow me to ping the IP and ssh to the console from the intranet.
I remove the IP address and shutdown VLAN 1 then create another VLAN with IP address. Ping and ssh to the switch is not work anymore.
Do I need to create the same VLAN ID on the router sub-interface to make this work?
Solved! Go to Solution.
03-13-2019 07:26 PM
Hi @j9678 ,
An L2 switch is a device, so it needs an IP address, a mask and a gateway.
If you change the vlan interface and, therefore, there is more than one vlan on your switch, you must route those two networks through a layer 3 device, such as a router or an L3 switch.
If it is through a router, you must create subinterfaces for the routing.
In addition, you must make sure that the IP address, the mask and the gateway correspond to the network configured in the corresponding subinterface.
Remember to mark the correct answers as solved, since that helps other users with similar doubts
Regards
03-14-2019 02:13 AM - edited 03-14-2019 02:20 AM
Hello
@j9678 wrote:
Is the custom VLAN on layer 2 switch only work when the same VLAN ID already setup in the router?
My C2960x has 1 interface direct connected to a router interface. I set this switch port to trunk mode. And set Vlan 1 to has a IP address. This configuration allow me to ping the IP and ssh to the console from the intranet.
I remove the IP address and shutdown VLAN 1 then create another VLAN with IP address. Ping and ssh to the switch is not work anymore.
Do I need to create the same VLAN ID on the router sub-interface to make this work?
If the router is to carry more than one vlan then yes you will require sub-interfaces however if you just want use one vlan then NO as by default the physical interface of a router is just a routed port, So you dont need to have any sub-interfaces on the router or a trunk port on the switch.
So if you keep the same addressing on the router port but remove the addressing from the SVI vlan 1 on the switch and say create VLAN 2 with the same addressing then all you need to do is create the L2 vlan on the switch and assign the access port connecting to the router to vlan 2
Now if you want the router to carry multiple vlans then you will need sub-interfaces on the router and a trunk port on the switch, but bare in mind that by default the physical port on the router that has an ip address and is also associated with sub-interfaces is by default assigned to vlan1 and carry's untagged traffic ( that is the native vlan).
03-13-2019 07:26 PM
Hi @j9678 ,
An L2 switch is a device, so it needs an IP address, a mask and a gateway.
If you change the vlan interface and, therefore, there is more than one vlan on your switch, you must route those two networks through a layer 3 device, such as a router or an L3 switch.
If it is through a router, you must create subinterfaces for the routing.
In addition, you must make sure that the IP address, the mask and the gateway correspond to the network configured in the corresponding subinterface.
Remember to mark the correct answers as solved, since that helps other users with similar doubts
Regards
03-14-2019 02:13 AM - edited 03-14-2019 02:20 AM
Hello
@j9678 wrote:
Is the custom VLAN on layer 2 switch only work when the same VLAN ID already setup in the router?
My C2960x has 1 interface direct connected to a router interface. I set this switch port to trunk mode. And set Vlan 1 to has a IP address. This configuration allow me to ping the IP and ssh to the console from the intranet.
I remove the IP address and shutdown VLAN 1 then create another VLAN with IP address. Ping and ssh to the switch is not work anymore.
Do I need to create the same VLAN ID on the router sub-interface to make this work?
If the router is to carry more than one vlan then yes you will require sub-interfaces however if you just want use one vlan then NO as by default the physical interface of a router is just a routed port, So you dont need to have any sub-interfaces on the router or a trunk port on the switch.
So if you keep the same addressing on the router port but remove the addressing from the SVI vlan 1 on the switch and say create VLAN 2 with the same addressing then all you need to do is create the L2 vlan on the switch and assign the access port connecting to the router to vlan 2
Now if you want the router to carry multiple vlans then you will need sub-interfaces on the router and a trunk port on the switch, but bare in mind that by default the physical port on the router that has an ip address and is also associated with sub-interfaces is by default assigned to vlan1 and carry's untagged traffic ( that is the native vlan).
03-14-2019 07:43 PM
Thanks for the explanation. As I have no intention to change any settings on the router. I got no choice but must stick with the default VLAN 1.
03-15-2019 03:30 AM
Hello
@j9678 wrote:
Thanks for the explanation. As I have no intention to change any settings on the router. I got no choice but must stick with the default VLAN 1.
Is you router using sub-interfaces or does it just have one ip address applied to its physical interface? - if the latter then then can change the switch vlan to whatever you wish it to be
03-17-2019 08:26 PM
The router port which connected to C2960X has sub-interfaces.
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