| INSTALACIÓN FÍSICA Y LÓGICA DE UNA RED CABLEADA E INALÁMBRICA EN UN AULA: | ||
|---|---|---|
| Anterior | Capítulo 17. Instalación y configuración de la tarjeta de red cableada en Linux | Siguiente |
El protocolo TCP/IP se va a encargar de implementar las funciones del nivel 3 (de red) y nivel 4 (transporte) de la arquitectura de niveles. Su función es la de implementar el medio de transporte que permita a dos procesos, de nivel superior (aplicación), de distintas máquinas comunicarse entre sí sea cual sea su localización física.
Para configurar dicho protocolo y poder tener acceso a Internet es necesario configurar los siguientes pasos:
Vamos a configurar una dirección IP de 3 formas posibles, por comando, por fichero, y gráficamente.
En principio tenemos una tarjeta de red sin ip. Si hacemos ifconfig
[root@morgado-laptop]$ ifconfig eth0 Link encap:Ethernet HWaddr 00:40:45:0A:BC:B1 inet6 addr: fe80::240:45ff:fe0a:bcb1/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:12497 errors:0 dropped:0 overruns:0 frame:0 TX packets:6348 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:7997196 (7.6 MiB) TX bytes:927638 (905.8 KiB) Interrupt:9 Base address:0x1800 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:544 errors:0 dropped:0 overruns:0 frame:0 TX packets:544 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:65539 (64.0 KiB) TX bytes:65539 (64.0 KiB) |
[root@morgado-laptop]$ ifconfig interface netmask mascara broadcast dbroadcast up|down [root@morgado-laptop]$ ifconfig eth0 172.26.32.0 netmask 255.255.224.0 up |
Editamos el fichero /etc/networks/interfaces
[root@morgado-laptop]$ gedit /etc/networks/interfaces auto lo iface lo inet loopback auto eth0 iface eth0 inet static address 192.168.4.2 netmask 255.255.255.0 gateway 192.168.4.1 |
Por comando dhclient
[root@morgado-laptop]$ dhclient eth0 Internet Systems Consortium DHCP Client V3.0.3 Copyright 2004-2005 Internet Systems Consortium. All rights reserved. For info, please visit http://www.isc.org/products/DHCP Listening on LPF/eth0/00:40:45:0a:bc:b1 Sending on LPF/eth0/00:40:45:0a:bc:b1 Sending on Socket/fallback DHCPREQUEST on eth0 to 255.255.255.255 port 67 DHCPACK from 192.168.1.45 bound to 192.168.1.189 -- renewal in 694 seconds. |
Editamos el fichero /etc/networks/interfaces
[root@morgado-laptop]$ gedit /etc/networks/interfaces auto eth0 iface eth0 inet dhcp |
Para Configurar una ip estaticamente nos vamos a Sistema/Administración/Red o ejecutamos desde la terminal el comando network-admin
[root@morgado-laptop]$ network-admin |
Seleccionamos la interfaz y pulsamos propiedades. En el botón de configuración seleccionamos ip estática o por DHCP.
Una vez rellenados la configuración ip, activamos la interfaz.
Para comprobar la asignación de la ip hacemos ifconfig
[root@morgado-laptop]$ ifconfig eth0 Link encap:Ethernet HWaddr 00:40:45:0A:BC:B1 inet addr:192.168.4.2 Bcast:192.168.4.255 Mask:255.255.255.0 inet6 addr: fe80::240:45ff:fe0a:bcb1/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:6323 errors:0 dropped:0 overruns:0 frame:0 TX packets:5085 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:4928062 (4.6 MiB) TX bytes:867612 (847.2 KiB) Interrupt:9 Base address:0x1800 |
Para comprobar los DNS miramos el fichero /etc/resolv.conf
[root@morgado-laptop]$ gedit /etc/resolv.conf search "esi.es" nameserver 192.168.4.1 nameserver 80.58.61.254 |
Para comprobar el orden de búsqueda editamos el fichero /etc/nsswitch
[root@morgado-laptop]$ gedit /etc/nsswitch hosts: files dns ldap |
Por último comprobar la tabla de ruteo del host. En ella debe de haber la ruta de loopback, la red directa a la 192.168.4.0 y la puerta de enlace 192.168.4.1. Ejecutamos el comando route
[root@morgado-laptop]$ route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 127.0.0.0 * 255.0.0.0 U 0 0 0 lo 192.168.4.0 * 255.255.255.0 U 0 0 0 eth0 default 192.168.4.1 0.0.0.0 UG 0 0 0 eth0 |