PRÁCTICA - Comandos de red en Linux
A continuación vamos a describir un conjunto de herramientas de comandos de Linux que nos pueden ayudar a configurar y resolver incidencias en redes
Última actualización
A continuación vamos a describir un conjunto de herramientas de comandos de Linux que nos pueden ayudar a configurar y resolver incidencias en redes
Última actualización
Displays network interface configuration. For example,
Muestra los detalles de configuración de las interfaces de Ethernet
ifup/ifdown: Activates or deactivates a network interface.
E.g., ifdown eth0
disables the Ethernet interface.
ip: Versatile command to manage network interfaces, addresses, and routes.
For instance, ip addr show
displays IP addresses assigned to all interfaces.
ping: Checks connectivity to a host by sending ICMP echo requests. E.g., ping verifies if you can reach Google's servers.
traceroute: Determines the path packets take to reach a destination. Example: traceroute shows the network hops to Google.
netstat: Shows network connections, open ports, and routing table.
netstat -tuln
displays listening TCP/UDP ports.
ss: Similar to netstat, provides socket-level details.
For eg. ss -tunap
to view all TCP and UDP sockets with associated processes.
Route
route: Manages IP routing table.
Example: route -n
shows the routing table with network destinations and gateways.
iptables: Powerful firewall tool.
E.g., iptables -A INPUT -p tcp --dport 22 -j ACCEPT
allows SSH traffic
nslookup: Queries DNS servers.
nslookup http://google.com
retrieves the IP address of Google's domain.
Manages ARP cache.
displays the ARP table with MAC and IP address mappings.
Puertos populares en Linux:
HTTP – TCP 80
HTTPS – TCP 443
POP3 – TCP 110
SMTP – TCP 25
SSH – TCP 22
DNS/DOMAIN – TCP/UDP 53
iwconfig: Configures wireless network interfaces.
Example: iwconfig wlan0 essid "MyNetwork"
sets the wireless network.
netcat (nc): Versatile networking utility.
nc -vz google.com 80
checks if port 80 on Google is reachable.
Use the /// or / to query port numbers as follows using the /etc/services file:
vivek@nixcraft:$ cat /etc/services
vivek@nixcraft:$ grep -w 80 /etc/services
vivek@nixcraft:$ grep -E -w '53/(tcp|udp)' /etc/services
Más info: