Connecting linux machine on cisco catalyst trunk port with vlan tagging

I have an XCP-NG server with multiple VMs running on it. I want to move the server to a different place in the house, and I only have one ethernet cable running from that location to my home office. I want to be able to access multiple different networks from my home office. I have a catalyst switch and have set up a VLAN trunk port in order to accomplish this. This is my configuration:

Gi0/1

switchport trunk encapsulation dot1q
switchport mode trunk
switchport trunk allowed vlan all

I have other ports on the switch configured with vlans 10, 20 and 30.

I was able to get connectivity when plugging devices into access ports on the switch with the same vlans assigned, as expected.

But as a test, I created a VLAN interface on my linux box and set it to 30. Assigned an IP to that interface, and I can’t ping it.

My assumption is that if I tag the VLAN from within linux, the catalyst switch is going to route it to the correct access ports on the switch. Am I wrong? Or did I configure my trunk port incorrectly?

Any help would be appreciated.

doggone it, it was my fault. For some reason I still had the same ip address assigned to the original network interface. I turned the interface off and just kept the vlan one on, and now it is working fine.

1 Like