I present to you a compilation of the most useful Linux commands for Telecommunications and network operations
Download files from the Internet
Download a file from a webpage
To download a file from a specific URL.
wget www.paginaweb.com/archivo
Download a file with resumption
Allows pausing the download and resuming it later.
wget -c www.paginaweb.com/archivo
Download a complete webpage
Downloads the entire structure of a webpage.
wget -r www.paginaweb.com
Network operations
Show Ethernet configuration
Displays the network interface configuration.
ifconfig eth0
Activate the eth0 interface
Activates the specified network interface.
ifup eth0
Disable the eth0 interface
Deactivates the specified network interface.
ifdown eth0
Configure an IP address
Assigns an IP address to the network interface.
ifconfig eth0 192.168.1.1 netmask 255.255.255.0
Configure eth0 in promiscuous mode
Allows the interface to capture all packets on the network.
ifconfig eth0 promisc
Activate the eth0 interface in DHCP mode
Requests an IP address automatically from a DHCP server.
dhclient eth0
Show the routing table
Displays the configured routes in the system.
route -n
Configure default entry
Sets the default gateway.
route add -net 0/0 gw IP_Gateway
Configure static route
Adds a static route for a specific network.
route add -net 192.168.0.0 netmask 255.255.0.0 gw 192.168.1.1
Delete static route
Removes a specific static route.
route del 0/0 gw IP_gateway
Activate IP forwarding
Enables IP packet forwarding.
echo “1” > /proc/sys/net/ipv4/ip_forward
Show hostname
Displays the current hostname.
hostname
Resolve a name to an IP address
Looks up the IP address corresponding to a domain name.
host www.paginaweb.com
Resolve name and IP address
Provides information for both the name and the IP address.
nslookup www.paginaweb.com
Show link status of all interfaces
Displays the link status of the network interfaces.
ip link show
Show link status of eth0
Displays specific information about the eth0 interface.
mii-tool eth0
Show network card statistics
Provides detailed statistics for the network interface.
ethtool eth0
Show active network connections
Lists all active connections along with their PID.
netstat -tup
Show listening services on the system
Lists the network services that are listening.
netstat -tupl
Show HTTP traffic
Monitors HTTP traffic in real time.
tcpdump tcp port 80
Show available wireless networks
Scans and displays nearby Wi-Fi networks.
iwlist scan
Show configuration of a wireless network card
Displays the current configuration of a wireless interface.
iwconfig wlan0
Search in the Whois database
Obtains registration information for a domain.
whois www.paginaweb.com
SSH, SCP, and Tunneling
SSH login
Connects to a remote server using SSH.
ssh usuario@servidor.dominio.es
SSH login with X11 forwarding
Allows running graphical applications on the remote server.
ssh -X usuario@maquina
SSH login on a specific port
Connects to a server on a port different from the default.
ssh -p 15000 usuario@maquina
Copy files using SCP
Securely transfers files between systems.
scp /archivo usuario@servidor.dominio.es:/directorio
Create an SSH tunnel
Establishes an SSH tunnel to redirect ports.
ssh -f usuario@servidor.dominio.es -L 2000:servidor.dominio.es:25 -N
Port forwarding using tunneling
Configures port forwarding through SSH.
ssh -v -L4001:localhost:4001 usuario@servidor.dominio.es