Switchport trunk configuration ignores access commands
When you configure an interface using the
switchport mode trunk command, any
switchport access commands are ignored. For example:
Switch#show running-config | section interface GigabitEthernet0/1 interface GigabitEthernet0/1 switchport access vlan 10 switchport trunk encapsulation dot1q switchport mode trunk Switch#
In the above configuration, the interface is configured as a trunk. Thus the
switchport access VLAN 10 command is ignored and has no effect on the behavior of the interface.