DEV Community

Cover image for Linux Networking Commands />
Mphiliseni
Mphiliseni

Posted on

Linux Networking Commands />

ifconfig - Display network interface information.

ping - Send ICMP ECHO_REQUEST to network hosts.

ping amazon.com
Enter fullscreen mode Exit fullscreen mode

route - Display or manipulate the IP routing table.

route -n
Enter fullscreen mode Exit fullscreen mode

ip - Show/manipulate routing, devices, policy routing,
and tunnels.

ip address show
Enter fullscreen mode Exit fullscreen mode

traceroute - Print the route packets trace to network host.

traceroute amazon.com
Enter fullscreen mode Exit fullscreen mode

netstat - Print network connections, routing tables, interface
statistics, masquerade connections, and multicast
memberships.

netstat -an
Enter fullscreen mode Exit fullscreen mode

hostname - Show or set the system's host name.

hostname -[option] [file]
Enter fullscreen mode Exit fullscreen mode

Socket Statistics(SS) - Display socket statistics.

ss [options]
Enter fullscreen mode Exit fullscreen mode

Domain Information Groper(dig) - DNS lookup utility.

dig [server] [name] [type]
Enter fullscreen mode Exit fullscreen mode

route - Manipulate routing tables.

route add default gw 192.168.1.1
Enter fullscreen mode Exit fullscreen mode

iptables - Administration tool for IPv4 packet filtering and
NAT.

iptables -L
Enter fullscreen mode Exit fullscreen mode

tcpdump - Dump traffic on a network.

tcpdump -i eth0
Enter fullscreen mode Exit fullscreen mode

sshd- OpenSSH daemon.

service sshd restart
Enter fullscreen mode Exit fullscreen mode

telnet- User interface to the TELNET protocol.

telnet google.com 80
Enter fullscreen mode Exit fullscreen mode

scp- Secure copy (remote file copy program).

scp file.txt user@remote:/path/to/destination
Enter fullscreen mode Exit fullscreen mode

wget - Non-interactive network downloader.

wget http://example.com/file.zip

Enter fullscreen mode Exit fullscreen mode

curl - Command line tool for transferring data with URL
syntax.

curl http://example.com/api
Enter fullscreen mode Exit fullscreen mode

iptraf- Interactive color IP LAN monitor.

Iptraf
Enter fullscreen mode Exit fullscreen mode

iftop

- Display bandwidth usage on an interface.
Iftop
Enter fullscreen mode Exit fullscreen mode

nmap- Network exploration tool and security scanner.

nmap -sP 192.168.1.0/24
Enter fullscreen mode Exit fullscreen mode

lsof- List open files.

lsof -i :80
Enter fullscreen mode Exit fullscreen mode

ethtool- Display or change ethernet card settings.

ethtool eth0
Enter fullscreen mode Exit fullscreen mode

arp - Display or modify the ARP cache.

arp -a
Enter fullscreen mode Exit fullscreen mode

route- Display or modify the IP routing table.

Route
Enter fullscreen mode Exit fullscreen mode

hostnamectl- Control the system hostname and related settings.

hostnamectl status

Enter fullscreen mode Exit fullscreen mode

resolvconf- Manage DNS information.

resolvconf -u

Enter fullscreen mode Exit fullscreen mode

mtr- Network diagnostic tool.

mtr google.com

Enter fullscreen mode Exit fullscreen mode

iwconfig- Configure a wireless network interface.

Iwconfig
Enter fullscreen mode Exit fullscreen mode

nc- Arbitrary TCP and UDP connections and listens.

nc -l 8080
Enter fullscreen mode Exit fullscreen mode

scp- Copy files between hosts on a network.

scp file.txt user@host:/path/to/destination

Enter fullscreen mode Exit fullscreen mode

ssh-keygen- Generate, manage, and convert authentication keys
for ssh.

ssh-keygen -t rsa

Enter fullscreen mode Exit fullscreen mode

tcpdump- Capture and display packets on a network.

tcpdump -i eth0 tcp port 80

Enter fullscreen mode Exit fullscreen mode

nmcli- Command-line client for NetworkManager.

nmcli connection show

Enter fullscreen mode Exit fullscreen mode

nload- Visual representation of incoming and outgoing
traffic.

Nload
Enter fullscreen mode Exit fullscreen mode

iperf- Tool for measuring TCP and UDP bandwidth
performance.

iperf -c server_ip

Enter fullscreen mode Exit fullscreen mode

fping- Quickly ping multiple hosts.

fping -a -g 192.168.1.1 192.168.1.254

Enter fullscreen mode Exit fullscreen mode

iftop- Real-time console-based network bandwidth
monitoring tool.

iftop -n

Enter fullscreen mode Exit fullscreen mode

route- Delete a route.

route del -net 192.168.2.0 netmask
255.255.255.0

Enter fullscreen mode Exit fullscreen mode

tcpdump- Capture and display packets in ASCII.

tcpdump -A -i eth0

Enter fullscreen mode Exit fullscreen mode

netcat- Utility for reading from and writing to network
connections.

nc -zv 192.168.1.1 22

Enter fullscreen mode Exit fullscreen mode

nmtui- Text User Interface for controlling NetworkManager.

Nmtui
Enter fullscreen mode Exit fullscreen mode

ethtool- Change the speed/duplex settings of an Ethernet
device.

ethtool -s eth0 speed 100 duplex full

Enter fullscreen mode Exit fullscreen mode

ss- Show listening sockets.

ss -l
Enter fullscreen mode Exit fullscreen mode

nmcli- List available Wi-Fi networks.

nmcli device wifi list
Enter fullscreen mode Exit fullscreen mode

Top comments (1)

Collapse
 
cappe987 profile image
Casper

ifconfig is deprecated. Anything it could do you can and should use ip command for.