InterVlan and Trunking
Inter-VLAN routing and trunking are essential aspects of network configuration, especially in environments where multiple VLANs need to communicate with each other. Below are some common Cisco commands and their descriptions for configuring inter-VLAN routing and trunking:
1. Create VLANs and Assign Them to Ports:
Description: Before configuring inter-VLAN routing and trunking, you need to create the VLANs and assign them to the appropriate switch ports.
Commands:
bashSwitch(config)# vlan 10 Switch(config-vlan)# name VLAN10 Switch(config-vlan)# exit Switch(config)# interface GigabitEthernet0/1 Switch(config-if)# switchport mode access Switch(config-if)# switchport access vlan 10Description: In the above commands, we create VLAN 10 and assign it to GigabitEthernet0/1 as an access port.
2. Configure Inter-VLAN Routing with a Layer 3 Switch:
Description: Inter-VLAN routing can be achieved with a Layer 3 switch. You configure an SVI (Switched Virtual Interface) for each VLAN to route traffic between them.
Commands:
bashSwitch(config)# interface Vlan10 Switch(config-if)# ip address 192.168.10.1 255.255.255.0 Switch(config-if)# no shutdown Switch(config)# interface Vlan20 Switch(config-if)# ip address 192.168.20.1 255.255.255.0 Switch(config-if)# no shutdownDescription: In this example, we configure SVIs for VLANs 10 and 20 with their respective IP addresses.
3. Enable Routing on the Layer 3 Switch:
Description: You need to enable routing on the Layer 3 switch to allow it to route traffic between VLANs.
Commands:
bashSwitch(config)# ip routingDescription: This command globally enables routing on the switch.
4. Configure Trunk Ports:
Description: To allow multiple VLANs to traverse a single link between switches or between a switch and a router, you configure trunk ports.
Commands:
bashSwitch(config)# interface GigabitEthernet0/24 Switch(config-if)# switchport mode trunkDescription: In this example, GigabitEthernet0/24 is configured as a trunk port.
5. Allow VLANs on Trunk Ports:
Description: Specify which VLANs are allowed to pass over a trunk link. This is useful for controlling which VLANs can communicate over the trunk.
Commands:
bashSwitch(config-if)# switchport trunk allowed vlan 10,20Description: This command allows VLANs 10 and 20 to traverse the trunk.
6. Verify Inter-VLAN Routing and Trunking:
Description: You can use various show commands to verify your inter-VLAN routing and trunking configuration, such as
show vlan,show ip route, andshow interfaces trunk.Commands:
bashSwitch# show vlan Switch# show ip route Switch# show interfaces trunkDescription: These commands provide information about VLANs, routing tables, and trunk ports for verification.
============================================================
Comments
Post a Comment