Red Hat 6/oel6 Network configuration

Source: Internet
Author: User

Modify IP address
[[email protected] ~] # cd / etc / sysconfig / network-scripts /

[[email protected] network-scripts] # ll ifcfg * #Switch to the network card configuration directory

-rw-r--r--. 1 root root 280 Dec 20 01:28 ifcfg-eth0 #View the configuration of the network card. Since only one network card is configured, there is only eth0

-rw-r--r--. 1 root root 254 Apr 12 2016 ifcfg-lo #Return test, system use

[[email protected] network-scripts] # gedit ifcfg-eth0 #Edit the configuration file of eth0

DEVICE = eth0 #device name

TYPE = Ethernet #Network type Ethernet

UUID = 849c2c0f-f685-4b85-8917-75e578d6ebc5 #HWADDR HardWare Address Hardware address MAC address

ONBOOT = yes # Whether to start with the system

NM_CONTROLLED = yes # Whether it is managed by the network program

BOOTPROTO = none #dhcp: Obtain IP address automatically none: Fixed IP address static: Fixed IP address

IPADDR = 192.168.56.88 #IP address

PREFIX = 24 #Subnet mask, a total of 32 IP addresses, 24 means the first 24 bits are 1, which is equivalent to 255.255.255.0

GATEWAY = 192.168.56.1 #Gateway

DEFROUTE = yes

IPV4_FAILURE_FATAL = yes

IPV6INIT = no

NAME = "System eth0"

HWADDR = 00: 0C: 29: 49: 9F: 0B

LAST_CONNECT = 1513702340

Restart network service after saving changes

[[email protected] network-scripts] # /etc/init.d/network restart

Shutting down interface eth0: Device state: 3 (disconnected)

                                                           [OK]

Shutting down loopback interface: [OK]

Bringing up loopback interface: [OK]

Bringing up interface eth0: Active connection state: activated

Active connection path: / org / freedesktop / NetworkManager / ActiveConnection / 4

                                                           [OK]

or

[[email protected] network-scripts] # service network restart

More settings can refer to

https://www.cnblogs.com/picaso/archive/2012/07/02/2572888.html


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.