[linux修改ip地址]Linux中快速修改IP、网关、DNS的方法

更新时间:2019-05-13    来源:linux    手机版     字体:

【www.bbyears.com--linux】


网卡eth0    IP修改为 102.168.0.1 
 
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

重启网络服务

service network restart

/etc/rc.d/init.d/network restrart

本文来源:http://www.bbyears.com/caozuoxitong/50926.html

猜你感兴趣