By default, no network access configuration is available for CentOS6 installation. you need to configure the network interface. Solution: view the default interface configuration and save the interface configuration in the/etc/sysconfig/network-scripts directory. the default interface configuration is shown below. [Plain] for viewplaincopy & nbs, no network access configuration is available for CentOS 6 installation by default. you need to configure the network interface. Solution: view the default interface configuration and save the interface configuration in the/etc/sysconfig/network-scripts directory. the default interface configuration is shown below.
[Plain]View plaincopy
- [Root @ CentOS65 network-scripts] # more/etc/sysconfig/network-scripts/ifcfg-eth0
- DEVICE = eth0
- HWADDR = 00: 0C: 29: C1: 48: 03
- TYPE = Ethernet
- UUID = b2bbb718-caa6-46c3-ae12-587cbedfd5fa
- ONBOOT = no
- NM_CONTROLLED = yes
- BOOTPROTO = dhcp
Configure static interface addresses
[Plain]View plaincopy
- # Vi/etc/sysconfig/network-scripts/ifcfg-eth0
- DEVICE = "eth0"
- NM_CONTROLLED = "yes"
- ONBOOT = yes
- HWADDR = A4: BA: DB: 37: F1: 04
- TYPE = Ethernet
- BOOTPROTO = static
- UUID = 5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03
- IPADDR = 10.220.33.108
- NETMASK = 255.255.255.0
Configure Gateway
[Plain]View plaincopy
- # Vi/etc/sysconfig/network
- NETWORKING = yes
- HOSTNAME = centos6
- GATEWAY = 10.220.33.1
Restart network interface
[Plain]View plaincopy
- [Root @ CentOS65 network-scripts] #/etc/rc. d/init. d/network restart
- Shutting down interface eth0: [OK]
- Shutting down loopback interface: [OK]
- Bringing up loopback interface: [OK]
- Bringing up interface eth0: Determining if ip address 10.220.33.108 is already in use for device eth0...
- [OK]
Configure DNS server
[Plain]View plaincopy
- # Vi/etc/resolv. conf
- Nameserver x. x # Replace with your nameserver ip
- Nameserver y. y # Replace with your nameserver ip
View Interface configuration use the "ip a" or ifconfig command to view the current Interface configuration information reference 1. Centos: Interface configuration files