Loading...
Loading...
Essential networking commands for Linux system administration and security testing.
ifconfigDisplay network interface configuration
$ ifconfig eth0ip addrShow IP addresses (modern)
$ ip addr showip linkShow/manipulate network devices
$ ip link set eth0 upip routeShow/manipulate routing table
$ ip route showhostnameDisplay or set system hostname
$ hostname -InmcliNetworkManager CLI tool
$ nmcli device statusnslookupQuery DNS servers
$ nslookup google.comdigDNS lookup utility
$ dig google.com A +shorthostDNS lookup utility
$ host -t MX google.comwhoisDomain registration info
$ whois example.comresolvectlResolve DNS queries
$ resolvectl query google.compingTest network connectivity
$ ping -c 4 google.comtracerouteTrace packet route
$ traceroute google.commtrNetwork diagnostic tool
$ mtr google.comnetstatNetwork statistics
$ netstat -tulnssSocket statistics (modern)
$ ss -tulnlsof -iList open network files
$ lsof -i :80nmapNetwork exploration tool
$ nmap -sV 192.168.1.1nmap -sSTCP SYN scan (stealth)
$ nmap -sS 192.168.1.1nmap -sUUDP scan
$ nmap -sU 192.168.1.1nmap -OOS detection
$ nmap -O 192.168.1.1nmap -AAggressive scan
$ nmap -A 192.168.1.1masscanFast port scanner
$ masscan -p1-65535 192.168.1.0/24tcpdumpCapture network packets
$ tcpdump -i eth0 port 80wiresharkGUI packet analyzer
$ wireshark &tsharkCLI Wireshark
$ tshark -i eth0 -f "port 443"tcpflowCapture TCP connections
$ tcpflow -i eth0 port 80curlTransfer data from URL
$ curl -I https://example.comwgetDownload files
$ wget https://example.com/file.zipscpSecure copy over SSH
$ scp file.txt user@host:/path/rsyncRemote sync
$ rsync -avz src/ user@host:dest/ncNetcat - network Swiss army knife
$ nc -lvp 4444iptables -LList firewall rules
$ iptables -L -n -viptables -AAdd firewall rule
$ iptables -A INPUT -p tcp --dport 22 -j ACCEPTufw statusUFW firewall status
$ ufw status verboseufw allowAllow port/service
$ ufw allow 22/tcpfirewall-cmdFirewalld CLI
$ firewall-cmd --list-allarp -aDisplay ARP table
$ arp -aip neighShow ARP cache (modern)
$ ip neigh showarpingSend ARP requests
$ arping -I eth0 192.168.1.1macchangerChange MAC address
$ macchanger -r eth0