Estos son los archivos y las configuraciones que hay que modificar en CentOS 6 para que funcione la red como queramos:
IP estática
Archivo a editar: /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"BOOTPROTO="dhcp"
HWADDR="00:0C:29:A6:70:B8"
IPV6INIT="no"
NM_CONTROLLED="yes"
ONBOOT="yes"
TYPE="Ethernet"
UUID="5305a615-765e-413c-9b49-88aa7d45c370"
IP dinámica
Archivo a editar: /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"BOOTPROTO="none"
HWADDR="00:0C:29:A6:70:B8"
IPV6INIT="no"
NM_CONTROLLED="yes"
ONBOOT="yes"
TYPE="Ethernet"
UUID="5305a615-765e-413c-9b49-88aa7d45c370"
IPADDR=192.168.150.21
NETMASK=255.255.255.0
GATEWAY=192.168.150.2
DNS1=192.168.150.2
DNS2=80.58.61.254
DOMAIN=localdomain
#domain domain.name
#search domain.name
Cambiar de nombre y el dominio del equipo en la red
Archivo a editar: /etc/sysconfig/network
NETWORKING=yesHOSTNAME=centos6virtual.localdomain
Archivo a editar: /etc/hosts
127.0.0.1 centos6virtual centos6virtual.localdomain localhost localhost.localdomain localhost4 localhost4.localdomain4::1 centos6virtual centos6virtual.localdomain localhost
Ver el gateway usado
Ejecutamos ip route show y obtendremos alguna línea como ésta:default via 192.168.150.2 dev eth0 proto staticHe puesto en verde negrita las líneas que hay que modificar o añadir y subrayado en amarillo lo que es opcional.
Después de hacer el cambio hay que reiniciar el servicio.