Linux System network Basic configuration

Source: Internet
Author: User

1. Use of the ifconfig command:

(1) View all NIC basic information:ifconfig

(2) View specific network card information:ifconfig (network card name, such as:eht0)

(3) Stop the network card device service:ifconfig (NIC name, such as:eht0) down

(You cannot see the NIC information by using the ifconfig command after stopping the network card service)

only temporarily stop the network card service through the Ifconfig command, you can restart the network card via local login, or you can

Reboot the operating system to restart the NIC.

(4) Start the network card service:ifconfig (network card name, such as:eht0) up

(5) Change the network card IP address:ifconfig (network card name, such as:eht0 ) New IP Address

Ifconfig (NIC name, such as:eht0) New IP address netmask Subnet Mask

Note: The configuration of the network through the ifconfig is temporary, and the configuration fails when the system restarts. If you want to permanently configure,

You can modify the configuration file /etc/sysconfig/network-scripts/ifcfg-eth0and then use the Command service network

Restart to restart the network service for the configuration to take effect.

Note: The IP address of the virtual machine system cannot coincide with the IP address of the local host .

2. Local Host name modification:

(1) View Local host name:hostname

(2) Modify the local host name:hostname new host name

(You need to re-login to see the effect)

Note: The host name modification is only temporary by the host command, and the modification fails when the system restarts. If you want to permanently repair

Change the configuration file /etc/sysconfig/network, and then restart the system by changing the host name.

3. DNS Information modification:

The DNS information is stored in the configuration file /etc/resolv.conf and can be modified by modifying the contents of the file.

Information.

Specify DNS server:nameserver 219.141.136.10(China Telecom)

NameServer 202.106.0.20(China Unicom)

Linux System network Basic configuration

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.