Configure the RedHat static IP Address

Source: Internet
Author: User
Tags nameserver

Assume that the NIC to be configured is eth0

1. edit the file:/etc/sysconfig/network-scripts/ifcfg-eth0, modify the values of the following items

Bootproto = static # If the IP address is obtained dynamically, the value of bootproto is DHCP.

Ipaddr = 192.168.1.100 # static address based on your network settings

Netmask = 255.255.255.0
# Subnet mask, set according to Network

Gateway = 192.168.1.1 # set according to Network

Dns1 = xx. xx # DNS address.

The other values remain unchanged.

2. a dns address is configured above. You can also configure the RedHat DNS address to edit the file:/etc/resolv. conf and add:

Nameserver xx. xx

If there are more than one, add multiple lines!

/Etc/resolv. the conf file will be overwritten when the network is restarted, and the added nameserver will be deleted. You can modify chattr + I/etc/resolv. conf to add attributes to the file and cannot be modified (I do not know what else to ensure
Files are not modified)

3. ifdown eth0, IFUP eth0 restart Nic

/Etc/init. d/network restart the network

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.