[Linux] network settings

Source: Internet
Author: User

Linux network settings mainly involve the following configuration files:



The configuration file for setting IP-related parameters is/etc/sysconfig/network-scripts/ifcfg-eth0, as shown below:
DEVICE = eth0BOOTPROTO = staticBROADCAST = 10.10.100.255HWADDR = 90: B1: 1C: 12: E0: 61 IPADDR = 10.10.100.200NETMASK = 255.255.255.0NETWORK = 10.10.10020.onboot = yes
After the configuration is complete, restart the network service to make it take effect:/etc/init. d/network restart
DNS configuration file:/etc/resolv. conf
Nameserver 8.8.4.4nameserver 8.8.8.8

The configuration file for the host name configuration is/etc/sysconfig/network.
$ Cat/etc/sysconfig/networkNETWORKING = yesNETWORKING_IPV6 = yesHOSTNAME = lx200GATEWAY = 10.10.100.1
To modify the host name, you must restart the server because many system services need to read the file to read the host name. After the host name is modified, you also need to modify the ing between the host name and IP address in the/etc/hosts file.


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.