CatOS
sw> enable
sw> set trunk {port to trunk on} on dot1q {vlans to allow}
EXAMPLE
set trunk 4/48 on dot1q 2-3,10,20,30,69,96-99
(This example sets port 4/48 to the 802.1q standard, and only allows VLANs 2-3,10,20,30,69,96 to 99)
IOS
sw> enable
sw> config t
sw> interface GigabitEthernet0/1
sw-if> switchport trunk encapsulation dot1q
sw-if> switchport mode trunk
sw-if> end
sw> write mem