Set Network Configuration
Use cmd ifconfig to make sure the name representing network interface.
Basic setting details path
Path/Folder
# cd /etc/sysconfig/network-scripts/
ethernet setting, the configuration file:
# vim /etc/sysconfig/network-scripts/ifcfg-eth0
wireless LAN setting, the configuration file:
# vim /etc/sysconfig/network-scripts/ifcfg-wlan0
Wake up network interface
Restart the whole network interface:
# /etc/init.d/network restart
Wake up the ethernet, eth0, interface as an example:
# ifup eth0
Shut down the ethernet, eth0, interface as an example:
# ifdown eth0
Request a new IP address
Release IP address used now and take ethernet as an example:
# dhclient -v -r eth0
Request a new IP address with its relative network configuration and take ethernet as an example:
# dhclient -v eth0
Replace temporary network settings
Set (or replace the IP address):
# ifconfig eth0 192.168.1.20 netmask 255.255.255.0 up
Set gateway:
# route add default gw 192.168.1.1
Set DNSs
Add(or Set) the DNS server address into the network interface:
# vim /etc/resolv.conf
Add a new DNS server, 168.95.1.1 as a example, add the following information on the bottom of the file:
nameserver 168.95.1.1