总而言之就是ip default-gateway只在设备配置了no ip routing时才生效
enable ip routing的情况下ip default-gateway即使配置了也会被忽略
参考: https://community.cisco.com/t5/switching/ip-default-gateway-problem/td-p/2977086
The reason why you need the “ip route” statement to reach 192.168.20.1 is because you have ip routing enabled, as per the first line of configuration in your post above. We use the ip route command set to tell the switch where to route traffic when ip routing is enabled, as with this enabled the switch essentially then becomes a router. The ip default-gateway command is only used if the device is in a layer 2 state and cannot route itself so it needs to be told its gateway just like a PC does.
In summary:
If ip routing is enabled then the ip default-gateway command is ignored.
If ip routing is disabled then the ip route 0.0.0.0 0.0.0.0 command is not effective.