Configurar red en CentOS 6.5 con dirección ip estática

¿Cómo asignar un ip estática en la configuración de red de un CentOS 6.5?

Configuramos eth0

[root@server1 ~]# vi /etc/sysconfig/network-scipts/ifcfg-eth0	
DEVICE=eth0
HWADDR=00:23:18:g3:63:fa
TYPE=Ethernet
UUID=894cea99-ed2e-4cb2-bb04-0e93be766f7c
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
IPADDR=192.168.1.50
NETMASK=255.255.255.0
IPV6INIT=no
USERCTL=no




Configuramos la puerta de enlace por defecto

[root@server1 ~]# vi /etc/sysconfig/network 
NETWORKING=yes
HOSTNAME=server1.local
GATEWAY=192.168.1.1



Configuramos las DNS

[root@server1 ~]# vi /etc/resolv.conf 
nameserver 8.8.8.8 #google
nameserver 208.67.222.222 #opendns



Reiniciamos la interfaz de red

[root@server1 ~]# /etc/init.d/network restart
Interrupción de la interfaz eth0:                          [  OK  ]
Interrupción de la interfaz de loopback:                   [  OK  ]
Activación de la interfaz de loopback:                     [  OK  ]
Activando interfaz eth0:  Determining if ip address 192.168.1.50 is already in use for device eth0...
                                                           [  OK  ]



Comprobamos que se han aplicado correctamente los cambios

[root@server1 ~]# ifconfig 
eth0      Link encap:Ethernet  HWaddr 00:23:18:G3:63:FA
          inet addr:192.168.1.50  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::226:18ff:fed3:73fa/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:618 errors:0 dropped:0 overruns:0 frame:0
          TX packets:387 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:67352 (65.7 KiB)  TX bytes:76801 (75.0 KiB)



Comprobamos el acceso a internet

[root@server1 ~]# ping www.google.com
PING www.google.com (216.58.210.164) 56(84) bytes of data.
64 bytes from mad05s10-in-f4.1e100.net (216.59.210.164): icmp_seq=1 ttl=56 time=59.9 ms
64 bytes from mad05s10-in-f4.1e100.net (216.59.210.164): icmp_seq=2 ttl=56 time=59.3 ms
64 bytes from mad05s10-in-f4.1e100.net (216.59.210.164): icmp_seq=3 ttl=56 time=59.5 ms
^C
--- www.google.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2581ms
rtt min/avg/max/mdev = 59.330/59.598/59.927/0.317 ms
[root@server1 ~]# nslookup www.google.com
Server:         8.8.8.8
Address:        8.8.8.8#53

Non-authoritative answer:
Name:   www.google.com
Address: 216.58.210.164






Si el post te ha ayudado a salir de un marrón, te ha servido pá lo que sea o simplemente te ha gustado y quieres colaborar puedes pinchar en los anuncios ;)

One thought on “Configurar red en CentOS 6.5 con dirección ip estática

Leave a Reply

Your email address will not be published. Required fields are marked *