Manual IP address and DNS modification in Linux (Red Hat 5.5)

Source: Internet
Author: User

Edit the ifcfg-eth0 file under/etc/sysconfig/networking-scripts/(if not, determine whether the NIC driver is installed)

Cd/etc/sysconfig/network-scripts

Vi ifcfg-eth0

--------------------------------------------

DEVICE = eth0
BOOTPROTO = none
IPADDR = 192.168.110.20.
NETMASK = 255.255.255.0
GATEWAY = 192.168.110.20.
DNS1 = 8.8.8.8
ONBOOT = yes
HWADDR = 50: e5: 49: ce: 27: e8
TYPE = Ethernet

Save as needed

Restart the NIC: ifdown eth0

Ifup eth0

Notify the gateway to update the information if necessary.

/Etc/init. d/network restart

Bytes ------------------------------------------------------------------------------------------

Summary:

1. Temporary Dynamic ip address Modification

Terminal command: ifconfig eth0 10.10.21.149

The ip address of the eth0 Nic is changed to 10.10.21.149, which takes effect immediately after modification. However, the ip address becomes invalid after the machine is restarted.

2. static ip address Modification

Vi/etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE = eth0
# Physical device name

ONBOOT = yes
# [Yes | no] whether to activate the device during boot

BOOTPROTO = static # none: protocol not used during boot, static: static allocation, bootp: BOOTP protocol, dhcp: DHCP protocol

IPADDR = 192.168.0.3 # IP Address

NETMASK = 255.255.255.0 # mask

GATEWAY = 192.168.0.1 # GATEWAY address

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.