Redhat6 -- configure the IP address

Source: Internet
Author: User
Tags nameserver

A machine cannot access the Internet, just like a banned person. It is impossible to get out and know the world. According to relevant sources, if the IP address is not properly configured during the rhce test, you cannot even get the question-Your money is doomed to be spent ~~~

IP settings are the basis of network configuration. Most network services are based on IP addresses (currently IPv4 addresses ). Familiar with DHCP, DNS, FTP, and other applications based on these services, IP support is indispensable. There is no big difference between the IP Address Configuration of redhat6 and the previous version, except for the four files. (If you need more advanced features, you need more IP addresses)

I, File to be configured: 1./etc/sysconfig/network-script/ifcfg-eth0

The change file is the NIC configuration file. You can configure Nic parameters. Required configurations include: device name, IP type (DHCP or static), and enable Nic switch (onboot), IP address, subnet mask, and default gateway (put the gateway in the network file according to my habits ).

Device = "  Eth0  "  Bootproto = "  Static "### If it is dynamic, DHCP can be used, or none can be used for static purposes.  Hwaddr = "  00: 0C: 29: D3: 0C: dd  "  Ipv6init = "  Yes  "  Ipaddr = 192.168 . 1.169  Netmask = 255.255 . 255.0 Gateway = 192.168 . 1.1  Nm_controlled = "  Yes  "  Onboot = "  Yes  " 
2./etc/sysconfig/Network

It mainly sets the networking, hostname, and subnet mask (which can be set in Nic configuration) for network operations)

 
Networking =Yeshostname= Picaso. localhost
3./etc/resolv. conf

Configure the DNS address in either of the following ways: nameserver 10.1.4.100 and dns1 = 10.1.5.64 in the document. The following message is displayed: nameserver is certainly usable, my environment here cannot access the DNS server, so it cannot be tested. In addition, after the DNS address is changed, the NetworkManager service (NetworkManager stop) must be stopped in Versions later than 6.0. Otherwise, the DNS cannot be changed.

 
# Generated by NetworkManager # No nameservers found; try putting DNS servers into your # ifcfg filesIn/Etc/sysconfig/network-Scripts like so :## Dns1= XXX. XXX # dns2 =XXX. XXX# Domain=Lab.foo.com bar.foo.com~
4./etc/hosts

Similar to Windows hosts files, the functions are similar. You do not need to modify them. The default value is enough.

127.0.0.1Localhost. localdomain localhost4 localhost4.localdomain4 ::1Localhost. localdomain localhost6 localhost6.localdomain6
Ii. Related Services

Network: After configuring the NIC settings, you must restart the service.

NetworkManager: When configuring DNS for redhat6, you must stop this service first.

Iii. Related commands

1,Hostname: Displays the current Hostname Information when there is no name later. When a value is added, it indicates that the current hostname is set to the later name, which is only written to the memory and not saved.

2,Ip addr show eth0: Display Nic Interface Information

3,Ifconfig: Displays the configuration information of all NICs, including IP addresses and other related information. to display the information of a specified Nic, add the NIC name (ifconfig eth0)

4. Nic switch command:/Sbin/IFUP eth0(Open)/Sbin/ifdown eth0(Close)

Iv. Advanced Nic settings

To be continued ~~~~

 

Reprinted please indicate the source: http://www.cnblogs.com/picaso/

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.