Configuring VLAN Trunk Links Between Switches
Q: How would you configure a trunk link between two switches while ensuring that only specific VLANs are allowed on that trunk?
- VLAN Configuration and Inter-VLAN Routing
- Senior level question
Explore all the latest VLAN Configuration and Inter-VLAN Routing interview questions and answers
ExploreMost Recent & up-to date
100% Actual interview focused
Create VLAN Configuration and Inter-VLAN Routing interview for FREE!
To configure a trunk link between two switches while ensuring that only specific VLANs are allowed on that trunk, I would follow these steps:
1. Set the switch ports to trunk mode: On both switches, I would configure the appropriate interfaces to operate in trunk mode, allowing them to carry traffic for multiple VLANs. The command for this on Cisco devices would be:
```
SwitchA(config)# interface GigabitEthernet0/1
SwitchA(config-if)# switchport mode trunk
SwitchA(config-if)# switchport trunk allowed vlan
```
2. Specify allowed VLANs: To restrict which VLANs are allowed on the trunk, I would use the `switchport trunk allowed vlan` command followed by the VLAN numbers that should be permitted. For example, if I want to allow VLANs 10, 20, and 30, the command would be:
```
SwitchA(config-if)# switchport trunk allowed vlan 10,20,30
```
3. Configure the same settings on the other switch: I would then replicate these configurations on the corresponding trunk port of the other switch (SwitchB) to ensure they match. The configuration would be identical:
```
SwitchB(config)# interface GigabitEthernet0/1
SwitchB(config-if)# switchport mode trunk
SwitchB(config-if)# switchport trunk allowed vlan 10,20,30
```
4. Verify the configuration: After configuring the trunk, I would verify that the VLANs are correctly configured using the command:
```
SwitchA# show interfaces trunk
```
This should show the allowed VLANs on the trunk link.
5. Testing: Finally, I would test to ensure that devices on the specified VLANs can communicate across the trunk and that devices on VLANs not specified cannot communicate.
By using the `switchport trunk allowed vlan` command, I ensure only specified VLANs traverse the trunk, enhancing network security and efficiency.
1. Set the switch ports to trunk mode: On both switches, I would configure the appropriate interfaces to operate in trunk mode, allowing them to carry traffic for multiple VLANs. The command for this on Cisco devices would be:
```
SwitchA(config)# interface GigabitEthernet0/1
SwitchA(config-if)# switchport mode trunk
SwitchA(config-if)# switchport trunk allowed vlan
```
2. Specify allowed VLANs: To restrict which VLANs are allowed on the trunk, I would use the `switchport trunk allowed vlan` command followed by the VLAN numbers that should be permitted. For example, if I want to allow VLANs 10, 20, and 30, the command would be:
```
SwitchA(config-if)# switchport trunk allowed vlan 10,20,30
```
3. Configure the same settings on the other switch: I would then replicate these configurations on the corresponding trunk port of the other switch (SwitchB) to ensure they match. The configuration would be identical:
```
SwitchB(config)# interface GigabitEthernet0/1
SwitchB(config-if)# switchport mode trunk
SwitchB(config-if)# switchport trunk allowed vlan 10,20,30
```
4. Verify the configuration: After configuring the trunk, I would verify that the VLANs are correctly configured using the command:
```
SwitchA# show interfaces trunk
```
This should show the allowed VLANs on the trunk link.
5. Testing: Finally, I would test to ensure that devices on the specified VLANs can communicate across the trunk and that devices on VLANs not specified cannot communicate.
By using the `switchport trunk allowed vlan` command, I ensure only specified VLANs traverse the trunk, enhancing network security and efficiency.


