cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1239
Views
0
Helpful
5
Replies

Custom VLAN on layer 2 switch (C2960x)

j9678
Level 1
Level 1

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?

2 Accepted Solutions

Accepted Solutions

luis_cordova
VIP Alumni
VIP Alumni

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

View solution in original post

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).

 


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

View solution in original post

5 Replies 5

luis_cordova
VIP Alumni
VIP Alumni

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

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).

 


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

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.

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

 


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

The router port which connected to C2960X has sub-interfaces.