Important network configuration files in linux

Source: Internet
Author: User
Tags nameserver
Important network configuration file in linux 1. etcsysconfignetwork file content; NETWORKING = yes & lt; = yes start network no close network HOSTNAME = hostname & lt; = host name GATEWAY = 19216811 & lt; = important network configuration files in linux for the default GATEWAY file
1./etc/sysconfig/network file content; NETWORKING = yes <= yes start network no close network HOSTNAME = hostname <= host name GATEWAY = 192.168.1.1 <= default GATEWAY the main function of this file is to set the host name (HostName) and whether or not to enable the Network to take effect after the host name is changed and the system is restarted. 2,/etc/sysconfig/network-scripts/ifcfg-eth0 file content; DEVICE = eth0 <= Nic code, need the ifcfg-eth0 corresponding to HWADDR = 00: 24: 8C: 79: 1A: 2B <= Nic address, that is, MAC address BOOTPROTO = static <= boot protocol, with none, static, dhcp, bootpIPADDR = 192.168.1.153 <= IP address NETMASK = 255.255.255.0 <= subnet mask NETWORK = 192.168.1.0 <= NETWORK segment, the first ipBROADCAST = 192.168.1.255 <= broadcast address GATEWAY = 192.128.1.1 <= default gateway onboot = yes <= start MTU = 1500 <= maximum transmission unit this file is used to set Nic parameters, all the settings in this file are basically B Ash variable setting rules, please note that each variable (English on the left) should be capitalized, otherwise our script will misjudge. DEVICE: The DEVICE code behind this setting value must be the same as the DEVICE number for the file name (ifcfg-eth0, otherwise, the device name cannot be found (the network device name is ethX, X starts from 0 and eth0 is the first network device, and so on) BOOTPROTO: the protocol used to start the network interface, none (no protocol used during boot), static (used for static allocation and manual IP address setting), dhcp (used for DHCP protocol and automatic IP address setting), and bootp (bootp protocol ). GATEWAY: the default GATEWAY of the entire host system. do not set it again. That is to say, when you have a ifcfg-eth0, ifcfg-eth1 multiple files (that is, multiple NICs), you just set the GATEWAY in one of the files. 3./etc/resolv. conf file content; nameserver 175.191.127.2 <= Primary DNS nameserver 175.191.127.6 <= This file is used to set the dns ip address (domain name resolution server), which is often mentioned, I have already pinged the public IP of the external computer. Why can't I enter the website address to connect to the machine? The reason for the error is that the settings in the file are incorrect. ------------------------------ The RHEL 6.0 DNS cannot be configured directly in this file, where the ifcfg-eth0 is to be configured. DNS1 = *. *. *. * 4./etc/hosts file content; 127.0.0.1 hostname (host name) localhost. domain. the domain localhost (alias) file can record the host name corresponding to the computer's IP address or the host's alias. 5. other/etc/protocols sets the protocol used by the host and the protocol number of each protocol/etc/services sets the network service of different ports on the host.
 
Related Article

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.