Using layer 3 switch to realize Inter-VLAN routing
Step 1: configure the hostname of the layer 3 switch
Ruijie#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Ruijie (config) # hostname switch
Step 2: divide the VLAN add ports on the layer 3 switch and set up Trunk
Switch (config) # vlan 10
Switch (config-vlan) # name xiaoshou
Switch (config-vlan) # vlan 20
Switch (config-vlan) # name jishu
Switch (config-vlan) # exit
Switch (config) # int range fa0/6-10
Switch (config-if-range) # sw mode acc
Switch (config-if-range) # sw acc vlan 10
Switch (config-if-range) # exit
Switch (config) # int range fa0/11-15
Switch (config-if-range) # sw acc vlan 20
Switch (config-if-range) # exit add
Switch (config) # int fa 0amp 1
Switch (config-if-FastEthernet 0bat 1) # sw mode trunk
Switch (config-if-FastEthernet 0bat 1) # exit
Switch (config) # exit
Step 3: view VLAN
Switch#show vlan
Step 4: configure the SVI port on the layer 3 switch
Switch#conf t
Enter configuration commands, one perline. End with CNTL/Z.
Switch (config) # interface vlan 10
Switch (config-if-VLAN 10) # Dec
% Unknown command.
Switch (config-if-VLAN 10) # ip add192.168.10.1 255.255.255.0
Switch (config-if-VLAN 10) # no shutdown
Switch (config-if-VLAN 10) # exit
Switch (config) # int vlan 20
Switch (config-if-VLAN 20) # ip add192.168.20.1 255.255.255.0
Switch (config-if-VLAN 20) # no shutdown
Switch (config-if-VLAN 20) # exit
Switch (config) # exit
Switch#*Sep 27 17:27:07:% SYS-5-CONFIG_I:Configured from console by conso
Step 5: verify the configuration
Configure PC1 and PC2 with IP addresses in the network segments 192.168.10.1 and 192.168.20.0, respectively, and use 192.168.10.1 and 192.168.20.1 as gateways, for example, the IP address of PC1 is configured as shown in the figure.
At this point, the host PC2 of different VLAN can be connected from PC1 to ping, as shown in the figure