Linux Networking Commands
Posted on June 1, 2024 (Last modified on June 8, 2024) • 1 min read • 198 wordsLearn essential networking commands in Linux, including configuring network interfaces, monitoring network traffic, and troubleshooting connectivity issues.
Networking is a critical aspect of system administration. This guide covers essential networking commands in Linux, including configuring network interfaces, monitoring network traffic, and troubleshooting connectivity issues.
Use ifconfig
to configure network interfaces.
ifconfig eth0 up
Assign an IP address.
ifconfig eth0 192.168.1.100
Use ip
for more advanced network configuration.
ip addr show
ip addr add 192.168.1.100/24 dev eth0
ip link set eth0 up
Use netstat
to display network connections and routing tables.
netstat -tuln
Use ss
as a modern alternative to netstat
.
ss -tuln
Use tcpdump
to capture network packets.
tcpdump -i eth0
Filter packets by port.
tcpdump -i eth0 port 80
Use ping
to test network connectivity.
ping google.com
Use traceroute
to trace the path to a network host.
traceroute google.com
Use nslookup
to query DNS records.
nslookup google.com
Mastering networking commands in Linux is essential for troubleshooting and maintaining network connectivity. Practice configuring network interfaces, monitoring traffic, and using diagnostic tools to enhance your networking skills.