Excuse me, can't the vlan of the Layer 3 switch ping the router? Why?
Point out the error in the network connection. The 0/2 port of your switch belongs to VLAN20. The address of VLAN 20 is192.168.20.1. The 0/0 port address of your router is192.168.30.1,and you put VLAN 2. The part where the switch and router are connected should belong to the same network segment. Either change the address of VLAN20 to 192. 168.30.2, or change the address of router 0/0 to 192.438+068.20.2, so that the network environment is correct. Let's configure switches and routers. We assume that the ip of VLAN20 is still192.168.20.1,and the IP of router 0/0 is 192. 168.20.2. Write the route on the Layer 3 switch first, because you don't know the brand of your router and switch. So I take Cisco's example switch # IP routing192.168.40.0 255.255.0192.168.20.2 (target segment 40.0, next hop address router 0/0 port address) as a router reference. Similarly, if your PC 1 is connected to VLAN20 and your router is connected to VLAN 10, then the address of port 0/0 of your router should be in the same network segment as VLAN 10, for example, 192. 10.