Linux network settings-general Linux technology-Linux technology and application information. For details, refer to the following section. 1. ifconfig is used to display the network interface information in the active status of the current host. Ifconfig-a shows all.
2. route displays route information
3. netstat-r displays route information.
4. nslookup queries domain name servers and interactions.
5. Configure the dynamic IP Address
/Etc/network/interfaces
Auto eth0
Iface eth0 inet dhcp is used to set the network interface eth0 to automatically obtain the Ip address through the DHCP protocol;
To reconfigure the network, restart the network service. For example,/etc/init. d/networking restart
6. Configure the static IP Address
Iface eth0 inet static
Address 192.
Netmask 255.255.255.0
Gateway
If the configuration takes effect: ifdown eth0
Ifup eth0 is mainly used to restart the network interface
Ifconfig eth0 192.168.0.1 netmask 255.255.255.0
Ifconfig eth0
Temporary IP Address Configuration
Manually set the Default Gateway
Ruote-del default gw 192.168.1.1
Route-add default gw 192.168.1.1
Set DNS server address
/Etc/resolv. conv
A maximum of three DNS Service addresses can be specified.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service