Network card eth0 IP is modified to 102.168.0.1
Copy code The code is as follows:
ifconfig eth0 102.168.0.1 netmask 255.255.255.0
The gateway is modified to 102.168 .0.254
Copy code The code is as follows:
route add default gw 102.168.0.254
linux command line to modify dns
Copy Code The code is as follows:
echo "nameserver 202.202.202.20 ">> /etc/resolv.conf
Restart the network service
Copy code The code is as follows:
service network restart
or
Copy code The code is as follows:
/etc/rc.d/init.d/network restrart
The above is the detailed content of How to modify IP, gateway and DNS in Linux. For more information, please follow other related articles on the PHP Chinese website!