# Creating Trunks

## In this guide we will cover how to create a static trunk between switches and filter the VLANs across the link.

<figure><img src="https://2373667134-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8zF1bBBRr6t1PCyfuXHu%2Fuploads%2FHFEsdjsWK4uUyUjyx55m%2Fswitchingfundamentals.png?alt=media&#x26;token=141bc022-9b07-41e4-a61c-8caf47285ca2" alt=""><figcaption></figcaption></figure>

* We must create a static trunk on **Ethernet0/3** between **SW1** and **SW2**.

## Configuration

* To create a trunk, we must go into the sub-configuration mode of **ETH 0/3**

`SW1#conf t` # This command puts us in Global Config mode

`SW1(config)#interface ethernet 0/3` # This command puts us into the interface sub-configuration mode

`SW1(config-if)#switchport trunk encapsulation dot1q` # This command will set the trunk to use the IEEE **802.1q** Encapsulation standard

`SW1(config-if)#switchport mode trunk` # This command will statically set the interface to **trunking** mode.

* The complete configuration for both switches is shown below &#x20;

<figure><img src="https://2373667134-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8zF1bBBRr6t1PCyfuXHu%2Fuploads%2F12OKt7PmT8MlbKTcGH1I%2Fsw1%20trunk%20configuration.png?alt=media&#x26;token=4c9d2e1a-2e65-44b3-8ebb-c156b1718a5f" alt=""><figcaption><p>Creating a static trunk on our SW1</p></figcaption></figure>

<figure><img src="https://2373667134-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8zF1bBBRr6t1PCyfuXHu%2Fuploads%2Fle479PZqcTVRvTgpKefZ%2Fsw2%20static%20trunk.png?alt=media&#x26;token=008768bf-4be2-413f-924c-5b631650ad6e" alt=""><figcaption><p>Creating a static trunk on our SW1</p></figcaption></figure>

### Filtering VLANs on trunk ports

* To filter the VLANs and add or remove the VLANs allowed across a trunk, we use the commands below.

`SW1(config-if)#switchport trunk allowed vlan 1,10,20,30` # This command will only VLANs 1,10,20,30 across the trunk

`SW1(config-if)#switchport trunk allows [add | remove] vlan 40` # This command allows you to add or remove VLANs from the trunk port.

* The complete configuration is shown below&#x20;

<figure><img src="https://2373667134-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8zF1bBBRr6t1PCyfuXHu%2Fuploads%2F4xe8HuizfTGjPPGsBPfJ%2Ffiltering%20vlans%20on%20trunk.png?alt=media&#x26;token=9ace55e9-4f1d-4b3b-bbb9-1116bb5b65b1" alt=""><figcaption><p>Filtering the VLANs allowed across a trunk</p></figcaption></figure>

## Verification

* The following commands will show and verify the trunks, how they formed and what VLANs are allowed across the trunks.

`SW1#show interface trunk` # This command will show us the active trunks on our switch.

<figure><img src="https://2373667134-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8zF1bBBRr6t1PCyfuXHu%2Fuploads%2FDCoRAvKaz9M48pWugOnP%2Fshow%20interface%20trunk.png?alt=media&#x26;token=ce1c6010-0ba5-4cf5-b715-73f2d8cf6134" alt=""><figcaption><p>Show interface trunk command on SW1</p></figcaption></figure>
