2020-06-29

InterVLAN Routing on Layer 3 Cisco Switch

1. Enable IP routing on the switch.

Switch#conf t
Switch(config)# ip routing


2. Create a VLAN.

Switch(config)#vlan 10
Switch(config-vlan)#name MARKETING
Switch(config-vlan)#exit
Switch(config)#vlan 20
Switch(config-vlan)#name HR
Switch(config-vlan)#exit


3. Configure VLAN interface with IP Address.

Switch(config)#int vlan 10
Switch(config-if)#ip address 10.0.10.250 255.255.255.0
Switch(config-if)#no shutdown
Switch(config-if)#exit
Switch(config)#int vlan 20
Switch(config-if)#ip address 10.0.20.250 255.255.255.0
Switch(config-if)#no shutdown
Switch(config-if)#exit
Switch(config)#


4. Configure one interface of the switch to become default router.

Switch(config)#int gigabitEthernet 2/0/1
Switch(config-if)#no switchport
Switch(config-if)#no shutdown
Switch(config-if)#ip address 10.0.1.1 255.255.255.0
Switch(config-if)#exit
Switch(config)#exit
Switch#copy run start


5. Configure DHCP for each VLAN.

Switch#conf t
Switch(config)#ip dhcp pool MARKETING
Switch(dhcp-config)#network 10.0.10.0 255.255.255.0
Switch(dhcp-config)#default-router 10.0.10.250
Switch(dhcp-config)#dns-server 8.8.8.8
Switch(dhcp-config)#ip dhcp excluded-address 10.0.10.250 10.0.10.254
Switch(dhcp-config)#exit
Switch(config)#ip dhcp pool HR
Switch(dhcp-config)#network 10.0.20.250 255.255.255.0
Switch(dhcp-config)#default-router 10.0.20.250
Switch(dhcp-config)#dns-server 8.8.8.8
Switch(dhcp-config)#ip dhcp excluded-address 10.0.20.250 10.0.20.254
Switch(dhcp-config)#exit
Switch(config)#exit
Switch#copy run start


6. Assign VLAN to an interface.

Switch#conf t
Switch(config)#int range gigabitEthernet 20/0/2-10
Switch(config-if-range)#switchport mode access
Switch(config-if-range)#switchport access vlan 10
Switch(config-if-range)#no shutdown
Switch(config-if-range)#exit
Switch(config)#
Switch(config)#int range gigabitEthernet 2/0/11-22
Switch(config-if-range)#switchport mode access
Switch(config-if-range)#switchport access vlan 20
Switch(config-if-range)#no shutdown
Switch(config-if-range)#exit
Switch(config)#



Reactions:

0 comments:

Post a Comment