Centos 6.3 command line network settings

Source: Internet
Author: User

Centos 6.3 command line network settings

In centos 6, no network configuration is set by default. You need to configure the network after startup:
Dynamic Address mode (DHCP)
1. Check network ip address
Ip
 

2. Modify ifcfg-eth0 under/etc/sysconfig/networking-scripts
Java code DEVICE = "eth0"
HWADDR = "00: 22: 19: 09: 4D: 3C"
NM_CONTROLLED = "yes"
ONBOOT = "no:
Java code DEVICE = "eth0"
HWADDR = "00: 22: 19: 09: 4D: 3C"
NM_CONTROLLED = "yes"
ONBOOT = "yes" # Interface enabled
BOOTPROTO = "dhcp" # Assigning IP from DHCP restart NETWORK SERVICE
Service network restart

STATIC address mode)
1. view existing network ip address
 

2. Modify eth0 in/etc/sysconfig/networking-scripts
DEVICE = "eth0" Java code HWADDR = "00: 22: 19: 09: 4D: 3C"
NM_CONTROLLED = "yes"
ONBOOT = "no:
Java code DEVICE = eth0
BOOTPROTO = static
HWADDR = 00: 0c: 29: 20: 23: 72
NM_CONTROLLED = yes
ONBOOT = yes
TYPE = Ethernet
UUID = "78457eda-3132-401099637-e770306b6315"
IPADDR = 172.16.80.15
NETMASK = 255.255.192.0
GATEWAY = 172.16.64.1
DNS1 = 172.16.2.129 3. Restart the network service.
Service network restart
Check the network
Ip a: If eth0 is normal, everything is OK.

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.