¡Esta es una revisión vieja del documento!
Tabla de Contenidos
205.3 Troubleshooting Network Issues
Pertenece a LPI Topic 205: Network Configuration
- Weight: 4
- Description: Candidates should be able to identify and correct common network setup issues, to include knowledge of locations for basic configuration files and commands.
- Key Knowledge Areas:
- Location and content of access restriction files
- Utilities to configure and manipulate ethernet network interfaces
- Utilities to manage routing tables
- Utilities to list network states.
- Utilities to gain information about the network configuration
- Methods of information about the recognized and used hardware devices
- System initialization files and their contents (SysV init process)
- Awareness of NetworkManager and its impact on network configuration
- Terms and Utilities:
ipifconfigroutessnetstat/etc/network/,/etc/sysconfig/network-scripts/ping,ping6traceroute,traceroute6mtrhostname- System log files such as
/var/log/syslog,/var/log/messagesand the systemd journal dmesg/etc/resolv.conf/etc/hosts/etc/hostname,/etc/HOSTNAME/etc/hosts.allow,/etc/hosts.deny
hostname
El comando hostname asigna dinámicamente el nombre a un host o permite consultar el nombre del host.
Para establecer el nombre del host estáticamente es necesario establecerlo en el fichero de configuración. Dicho fichero difiere en función de la distribución utilizada:
- Debian:
/etc/hostname. - Red Hat:
/etc/sysconfig/networkjunto con otros parámetros de configuración de red.
hostname
debian10
También podemos consultar la información del hostname desde /proc/sys/kernel/hostname y hacer el cambio en dicho fichero. Este cambio se perderá en el siguiente arranque.
Configuración de interfaces
Red Hat
Los ficheros de configuración de las interfaces están presentes en el directorio /etc/sysconfig/network-scripts/.
Dichos ficheros son llamados ifcfg-xxx, donde xxx es el nombre de la interfaz de red.
Ejemplo de /etc/sysconfig/network-scripts/ifcfg-eth0:
DEVICE="eth0" BOOTPROTO="dhcp" IPV6INIT="yes" NM_CONTROLLED="yes" ONBOOT="yes" TYPE="Ethernet"
En una configuración estática:
DEVICE="eth0" ONBOOT="yes" BOOTPROTO="static" IPADDR=10.0.2.152 NETMASK=255.255.255.0 GATEWAY=10.0.2.1
Debian
En debian la configuración de las interfaces se agrupan en un único fichero /etc/network/interfaces:
# Interfaces que se activarán al arranque
auto lo eth0 eth1
iface lo inet loopback
# Configuración estática
iface eth0 inet static
address 192.168.3.2
netmask 255.255.255.0
gateway 192.168.3.1
# Configuración por DHCP
iface eth1 inet dhcp
Depuración de errores
dmesg
Comando que lista el buffer de mensajes del núcleo (kernel ring buffer) desde el arranque. Entre ellos los posibles errores de una tarjeta de red.
Los eventos asociados a la red son registrado en los siguientes ficheros de logs:
- Debian:
/var/log/syslog - Red Hat:
/var/log/messages
(...) [11097.907564] device eth0 entered promiscuous mode [11101.758363] device eth0 left promiscuous mode [11108.651928] device eth0 entered promiscuous mode [11120.785132] device eth0 left promiscuous mode
205.3 Solución de Problemas de Red (4) RESOLUCIÓN DE NOMBRES /etc/resolv.conf: se utiliza para indicar al sistema que servidores de nombres y que dominios hay que consultar para resolver las peticiones DNS. domain fhf.com search fhf.com nameserver 192.168.3.5 nameserver 192.168.3.6 205.3 Solución de Problemas de Red (4) RESOLUCIÓN DE NOMBRES /etc/hosts: permite establecer una correspondencia entre las direcciones IP y los nombre de las máquinas. #IP HOSTNAME 192.168.3.24 www 192.168.3.45 dns-server 205.3 Solución de Problemas de Red (4) RESOLUCIÓN DE NOMBRES host: herramienta que nos permite hacer consultas al servidor DNS de la red host factorhumanoformacion.com dig: herramienta que nos permite hacer consultas al servidor DNS de la red , obteniendo información muchos más detallada dig factorhumanoformacion.com 205.3 Solución de Problemas de Red (4) TCP WRAPPERS • Permite el bloqueo de determinados servicios a través de la red • Utiliza la librería libwrap. • Los ficheros de configuración son: /etc/hosts.allow /etc/hosts.deny •Durante la comprobación de reglas primero se verifica el /etc/hosts.allowy después /etc/hosts.deny • tcpd: demonio que lee los ficheros de configuración. 205.3 Solución de Problemas de Red (4) TCP WRAPPERS Formato: servicio: clientes servicio: servicio a comprobar (ALL para todos) clientes: clientes autorizados o prohibidos. ALL: Todos los hosts. LOCAL: Todos los host de la red local. UNKNOWN: Host con nombre sin resolver. KNOWN: Host con nombre conocido. EXCEPT: Permite la exclusion de hosts. 205.3 Solución de Problemas de Red (4) TCP WRAPPERS /etc/hosts.allow vsftpd: 192.168.2.5 telnet: ALL /etc/hosts.deny ALL: .baddomain.org EXCEPT trusted.baddomain.org 205.3 Solución de Problemas de Red (4) PREGUNTA DE EXAMEN: A DNS server has the IP address 192.168.0.1. Which TWO of the following need to be done on a client machine to use this DNS server? A. Add nameserver 192.168.0.1 to /etc/resolv.conf B. Run route add nameserver 192.168.0.1 C. Run ifconfig eth0 nameserver 192.168.0.1 D. Ensure that the dns service is listed in the hosts entry in the /etc/nsswitch.conf file E. Run bind add nameserver 192.168.0.1 205.3 Solución de Problemas de Red (4) PREGUNTA DE EXAMEN: Considering the following kernel IP routing table now, which of the following commands must be remove the route to the network 10.10.1.0/24? Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 200.207.199.162 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0 172.16.87.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 192.168.246.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1 10.10.1.0 192.168.246.11 255.255.255.0 UG 0 0 0 eth1 127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo 0.0.0.0 200.207.199.162 0.0.0.0 UG 0 0 0 ppp0 A.route del 10.10.1.0 B.route del 10.10.1.0/24 C.route del -net 10.10.1.0/24 D.route del 10.10.1.0/24 gw 192.168.246.11 E.route del -net 10.10.1.0 </code>
