ubuntu20 修改IP sudo -i ifconfig 查询到你的服务名,如图 服务up ifconfig ens33 up 配置IP ifconfig ens33 192.168.1.5 netmask 255.255.255.0 ifconfig [服务名] [要改的IP] netmask [掩码] 配置网关 route add default gw 192.168.1.6 route add default gw 【网关IP】 ping 192.168.1.6 ping网关IP