Please follow this example.
#### Define Interface to Trunk
IOS# show run interface Ethernet0/0
Building configuration...
Current configuration : 57 bytes
!
interface Ethernet0/0
no ip address
duplex auto
end
IOS# conf t
Enter configuration commands, one per line. End with CNTL/Z.
IOS(config)# interface Ethernet0/0
IOS(config-if)# switchport
IOS(config-if)# switchport trunk encapsulation dot1q
#### Add VLANs to Trunk with 'add'
IOS(config-if)# switchport trunk allowed vlan ?
WORD VLAN IDs of the allowed VLANs when this port is in trunking mode
add add VLANs to the current list
all all VLANs
except all VLANs except the following
none no VLANs
remove remove VLANs from the current list
IOS(config-if)# switchport trunk allowed vlan add 11,12,13
IOS(config-if)# switchport trunk allowed vlan add 14,16,18
IOS(config-if)# do show run interface Ethernet0/0
Building configuration...
Current configuration : 135 bytes
!
interface Ethernet0/0
switchport
switchport trunk encapsulation dot1q
switchport trunk allowed vlan 11-14,16,18
duplex auto
end
#### Add VLANs to Trunk without 'add', this mean replace
IOS(config-if)# switchport trunk allowed vlan 19
IOS(config-if)# do show run interface Ethernet0/0
Building configuration...
Current configuration : 126 bytes
!
interface Ethernet0/0
switchport
switchport trunk encapsulation dot1q
switchport trunk allowed vlan 19
duplex auto
end
No comments:
Post a Comment