2. Configure a Layer 3 switch

The purpose of configuring a Layer 3 routing switch is to communicate between different switches and different vlan hosts

On the basis of (1. Configuring a two-layer switch) replace the building switch with a three-layer routable switch

To configure a two-layer switch, you can find " 1. Configuring a two-layer switch "

 

1. Directly configure the Layer 3 routing switch:

Click on the switch to select the CLI tab and enter:

switch>enable   //Enter privileged mode

 switch#configure terminal   //configure terminal

switch(config)#vlan 10

switch(config-vlan)#vlan 20   //Create vlan 10 and 20

switch(config-vlan)#exit

switch(config)#interface vlan 10   //进入vlan 10

switch(config-vlan)#ip address 202.206.79.100 255.255.255.0    //Specify port for vlan 10

switch(config-vlan)#exit

switch(config)#interface vlan 20   //进入vlan 20

switch(config-vlan)#ip address 202.206.78.100 255.255.255.0    //Specify port for vlan 20

switch(config-vlan)#no shutdown    //Do not close port activation

switch(config-vlan)#ip routing    //Enable the ip routing function, the default is closed, now it is open

switch(config-vlan)#do show ip route    //View routing table

 As shown above, 202.206.78.0/24 is directly connected to vlan 20

                202.206.79.0/24 is directly connected vlan 10

The configuration is complete here, and the following is tested

2. Test ping gateways between different vlans

Ping on PC0 in vlan 10 of the switch on the first floor, the gateway of vlan 20

      ping 202.206.78.100

 As shown above, it is passed. If it fails, check whether the configuration information of each IP, gateway, and switch is correct.

3. Test ping hosts between different vlans and different switches

Ping PC0 on the first-floor switch vlan 10, and PC6 on the second-floor switch vlan20

        ping 202.206.78.3

 

  As shown above, it is passed. If it fails, check whether the configuration information of each IP, gateway, and switch is correct.

If the gateway is connected, but the host is not connected, please check whether the ports of each switch are correct.

It's over!

Guess you like

Origin blog.csdn.net/m0_70295638/article/details/127203176