Overview
Access port use only one specific VLAN. On the access port frames will be sent untagged. In case the frame need to send out to trunk port the frame need to tags the VLAN ID.
Trunk port can have multiple VLAN. Frame are tagged with a VLAN ID when it come to trunk port except native VLAN. Then the switch strips the VLAN tag and sends it out on the appropriate access port.
Scenario:
We have SW1 & SW2 connect to each other. It’s trunk link between SW1 & SW2 and allow VLAN 10 & 20. On SW1 port2 configure as an access port vlan 10, and port 2 configure as an access port vlan 20.
Configuration on cisco:
Let’s say port 1 is interface fastethernet 0/0, port 2 interface fastethernet 0/1 and port 3 interface fastethernet 0/2
SW1#conf t SW2(config)#interface f0/0 SW2(config-if)#switchport mode trunk SW2(config-if)#switchport trunk encapsulation dot1q SW2(config-if)#interface f0/1 SW2(config-if)#switchport mode access SW2(config-if)#switchport access vlan 10 SW2(config-if)#interface f0/2 SW2(config-if)#switchport mode access SW2(config-if)#switchport access vlan 20
Configuration on MikroTik:
Add port to the same switch group
/interface ethernet set port2 master-port=port1 set port3 master-port=port1
Add initial VLAN assignments(PVID) to VLAN access ports. If frame incoming to port 2 , it’s will tage VLAN 10. If it incoming to port 3, it will tage VLAN 20
/interface ethernet switch ingress-vlan-translation add ports=port2 customer-vid=0 new-customer-vid=10 sa-learning=yes add ports=port3 customer-vid=0 new-customer-vid=20 sa-learning=yes
Add VLAN 10, and VLAN 20 tagging on Port 1 to create it as VLAN trunk port. Egress-VLAN-Tag entry is mandatory for every VLAN to make VLAN access ports work. If VLAN trunk port has not been chosen yet, Egress-VLAN-Tag entry has to be added with tagged-ports=””.
/interface ethernet switch egress-vlan-tag add tagged-ports=port1 vlan-id=10 add tagged-ports=port1 vlan-id=20
Define VLAN membership in a VLAN table
/interface ethernet switch vlan add ports=port1,port2 vlan-id=10 learn=yes add ports=port1,port3 vlan-id=20 learn=yes