linux临时修改网关和DNS
临时修改ip命令:
#修改网卡eth0 IP修改为102.168.0.1,子网掩码修改为255.255.255.0
ifconfig eth0 102.168.0.1 netmask 255.255.255.0
#网关修改为102.168.0.254
route add default gw 102.168.0.254
#Linux命令行修改dns
echo "nameserver 202.202.202.20 ">> /etc/resolv.conf
临时修改ip命令:
#修改网卡eth0 IP修改为102.168.0.1,子网掩码修改为255.255.255.0
ifconfig eth0 102.168.0.1 netmask 255.255.255.0
#网关修改为102.168.0.254
route add default gw 102.168.0.254
#Linux命令行修改dns
echo "nameserver 202.202.202.20 ">> /etc/resolv.conf