COETZER OPTICALFIBER NETWORK SYSTEMS Technical Inquiry

Server connected to switch via trunk port

A server can be connected to a switch trunk port by configuring the switch port as a trunk and setting up VLAN subinterfaces on the server to handle multiple VLANs.

Switch Configuration for Trunk Ports

A trunk port on a switch carries traffic for multiple VLANs using IEEE 802.1Q tagging. To configure a switch port as a trunk:

  • Set the port mode to trunk: switchport mode trunk
  • Specify allowed VLANs: switchport trunk allowed vlan 10,20,30
  • Configure the native VLAN for untagged traffic: switchport trunk native vlan 1
  • If using EtherChannel, ensure the physical interfaces and the port-channel configuration match, and use channel-group xx mode on for static or mode active for LACP negotiation .

Trunk ports are typically used to connect network infrastructure devices, but servers can also act as trunk hosts if they are configured to handle multiple VLANs .

Server Configuration for VLAN Trunking

On a Linux server, VLAN trunking is implemented by creating tagged VLAN subinterfaces on the physical NIC connected to the trunk port:

  • The physical interface (e.g., eth0) does not need an IP address; it handles untagged traffic for the native VLAN.
  • Create subinterfaces for each VLAN: eth0.10, eth0.20, eth0.30, each with its own IP address and VLAN ID.
  • Example configuration snippet using networkd:

ethernets: eth0: dhcp4: falsevlans: eth0.10: id: 10 link: eth0 addresses: [10.10.0.1/24] eth0.20: id: 20 link: eth0 addresses: [10.20.0.1/24] eth0.30: id: 30 link: eth0 addresses: [10.30.0.1/24]

This allows the server to send and receive traffic for multiple VLANs over a single physical link .

Common Issues and Troubleshooting
  • Suspended ports: Often caused by misalignment between physical interfaces and port-channel configuration. Ensure the switch and server configurations match, especially for EtherChannel or LACP settings .
  • Native VLAN mismatch: The native VLAN must be the same on both ends of the trunk to avoid spanning-tree loops .
  • Trunk negotiation: If the server does not support DTP, use static trunking (switchport nonegotiate) on the switch .
  • Load sharing: For multiple trunk links, configure STP port priorities or path costs to control which trunk carries traffic for specific VLANs .
Key Takeaways
  • Trunk ports allow a single physical link to carry multiple VLANs.
  • Servers must be configured with VLAN subinterfaces to handle tagged traffic.
  • Ensure VLAN IDs, native VLAN, and EtherChannel settings are consistent between the switch and server.
  • Proper configuration prevents suspended ports, spanning-tree loops, and VLAN misrouting.
Server connected to switch via trunk port

VLAN Trunking Overview: Trunk Port vs. Access Port

This allows you to connect several switches with Ethernet ports and allocate traffic among all the ports, relieving switch

Related Video Reference

This video was associated with the source search result. Verify technical details against current product documentation and project requirements.

Technical note

This reference is intended for preliminary optical-network research. Compatibility, link budgets, installation methods, test limits and applicable standards must be verified for the specific project.

Still Have a Technical Question?

Use the inquiry form to describe a fiber link, component choice or testing question.

Start an Inquiry