TrunkTo configure a port, follow these steps:
One Networking requirement:
1. SwitchA and SwitchB are interconnected with trunk. Mutual access is allowed between PCs with the same VLAN. Mutual access is prohibited between PCs with different VLANs;
2. PC1 and PC2 are located in different VLANs. You can set the IP address of VLAN Interface 10 of the SwitchB layer-3 Switch to 10.1.1.254/24, when the IP address of VLAN 20 is 255.1.1.254/24, mutual access between VLANs can be achieved.
2. Networking diagram:
1. Mutual access within a VLAN and inter-VLAN access prohibited
2. layer-3 Switch for mutual VLAN access
Step 3:
Enable intercommunication between VLANs in a VLAN
SwitchA configurations:
- 1. Create and enter) VLAN10, Add E0/1 to VLAN10
-
- [SwitchA] vlan 10
-
- A [SwitchA-vlan10] port Ethernet 0/1
-
- 2. Create and enter) VLAN20, Add E0/2 To VLAN20
-
- [SwitchA] vlan 20
-
- A [SwitchA-vlan20] port Ethernet 0/2
-
- 3. Configure port G1/1 as the Trunk port and allow VLAN10 and VLAN20 to pass through
-
- [SwitchA] interface GigabitEthernet 1/1
-
- [SwitchA-GigabitEthernet1/1] port link-type trunk
-
- [SwitchA-GigabitEthernet1/1] port trunk permit vlan 10 20
SwitchB configurations:
- 1. Create and enter) VLAN10, Add E0/10 to VLAN10
- [SwitchB] vlan 10
- A [SwitchB-vlan10] port Ethernet 0/10
- 2. Create and enter) VLAN20, Add E0/20 to VLAN20
- [SwitchB] vlan 20
- A [SwitchB-vlan20] port Ethernet 0/20
- 3. Configure port G1/1 as the Trunk port and allow VLAN10 and VLAN20 to pass [SwitchB] interface GigabitEthernet 1/1
- [SwitchB-GigabitEthernet1/1] port link-type trunk [SwitchB-GigabitEthernet1/1] port trunk permit vlan 10 20
- Configure layer-3 switches for intercommunication between VLANs
SwitchA configurations:
- 1. Create and enter) VLAN10, Add E0/1 to VLAN10
- [SwitchA] vlan 10
- A [SwitchA-vlan10] port Ethernet 0/1
- 2. Create and enter) VLAN20, Add E0/2 To VLAN20
- [SwitchA] vlan 20
- A [SwitchA-vlan20] port Ethernet 0/2
- 3. Configure port G1/1 as the Trunk port and allow VLAN10 and VLAN20 to pass [SwitchA] interface GigabitEthernet 1/1
- [SwitchA-GigabitEthernet1/1] port link-type trunk [SwitchA-GigabitEthernet1/1] port trunk permit vlan 10 20
SwitchB configurations:
- 1. Create VLAN10
-
- [SwitchB] vlan 10
-
- 2. Set the Virtual Interface address of VLAN10
-
- [SwitchB] interface vlan 10
-
- [SwitchB-int-vlan10] ip address 10.1.1.254 255.255.255.0
-
- 3. Create VLAN20
-
- [SwitchB] vlan 20
-
- 4. Set the Virtual Interface address of VLAN20
-
- [SwitchB] interface vlan 20
-
- [SwitchB-int-vlan20] ip address 255.1.1.254 255.255.255.0
-
- 5. Configure port G1/1 as the Trunk port and allow VLAN10 and VLAN20 to pass through
-
- [SwitchA] interface GigabitEthernet 1/1
-
- [SwitchA-GigabitEthernet1/1] port link-type trunk
-
- [SwitchA-GigabitEthernet1/1] port trunk permit vlan 10 20
The configuration of the Trunk port in the VLAN is over. I hope you can understand it.