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.