How to modify IP address, gateway, and DNS in Linux Command Line
This article will briefly describe how to use Linux Command lines to modify IP addresses, gateways, and DNS.
Change the IP address of eth0 to 102.160.1.
Ifconfig eth0 102.160.1 netmask 255.255.255.0
Change gateway to 102.160.254
Route add default gw 102.160.254
Linux Command Line DNS Modification
Echo "nameserver 202.202.202.20">/etc/resolv. conf
Restart network service command
Service network restart # or/etc/rc. d/init. d/network restrart
Articles you may be interested in
- Mysql command to change the table structure: add, delete, modify fields, adjust the field order
- Run commands on the Linux background (run without hanging up)
- How to run php files in the command line in windows
- Yii database addition, modification, and deletion operations Summary
- Linux Command file directory management cat command
- Linux File Content statistics command wc command usage details
- How does one modify the default homepage of a website through. htaccess?
- Graphic tutorial on common basic commands in Unix/Linux