Cisco – Configuring vlans on Cisco SG200 series switch with Ubuntu server

cisconetworkingubuntu-10.04vlan

I created a vlan on Ubuntu with vconfig tool with 21 as id and eth1 as the host port. I connected eth1 to one of the ports on the swtich (GE23) as all ports trunk by default. In the webgui I created a vlan named test with the id 21 and I made GE2 are port as an access port. In port to vlan mapping I selected vlan 21 and added it port GE2 by selecting untagged option. I have assigned 192.168.1.1/24 as the ip of eth1.21 on Ubuntu. If I connect another cleint pc to GE2 port with a ip of 192.168.1.2/24 I cannot ping the server ip (192.168.1.1/24). Ping from server to client also does not work. I inspected packets that are sent out eth1 on the server and I could see the vlan 21 tag. And I connect the other end of the cable to a different Linux pc and inspected the packets but no vlan tags can be seen. What could be preventing me from getting vlans working?

Edit 1 screenshots:

Interface Settings

Port to vlan mapping

Port to vlan membership

Best Answer

After my initial comments and Mike's suggestion (see above) I did a bit of fact checking. (I was going from memory.) We have several dozen of SG200 switches lying around here. They have been causing issues in the past.

We found the following:
- Upgrade the SG200 to the latest firmware.
- For any port on the switch that you need to have as Trunk: Set it to Access and then back to Trunk.
Even though the web-gui shows "Trunk" the port will initially (or after factory-default reset) be in "General".
This is an auto-negotiate mode that often only works properly if the other end of the connection is also a Cisco switch in "General" mode. The setting to Access and then back to Trunk will insure it is really working as Trunk.

Disabling spanning-tree (STP) on the port is in this case probably also a good idea as the server is certainly not going to participate in STP elections.