Networking in Linux involves configuring and managing network connections, devices, and services on a Linux-based system.
Here's an overview of key networking concepts and tasks in Linux:
Network Interfaces:
IP Addresses:
/etc/network/interfaces
(Debian/Ubuntu) or /etc/sysconfig/network-scripts/ifcfg-*
(Red Hat/CentOS).Subnetting and CIDR:
Routing:
ip route
command.Firewalls:
iptables
(legacy) and nftables
(modern) for controlling network traffic. Configure firewall rules to allow or block specific ports and IP addresses.Network Services:
NetworkManager:
nmcli
command-line tool or the graphical interface to manage network connections, including Wi-Fi and VPN settings.Proxy Servers:
VPN Configuration:
OpenVPN
or strongSwan
to set up VPN connections.DNS Configuration:
/etc/resolv.conf
or use tools like systemd-resolved
or NetworkManager
for DNS management.Network Diagnostics:
ping
, traceroute
, and netstat
are used for network troubleshooting. tcpdump
and Wireshark
can capture and analyze network packets.Monitoring and Logging:
iftop
, nload
, and iftop
help monitor network usage. Network-related logs are stored in /var/log/
.Network Time Protocol (NTP):
ntpd
or chronyd
service.Network Bonding and Teaming:
Network Bridges:
brctl
or ip
.IPv6:
Remember that network configuration tasks often require administrative privileges. Use sudo
or become the root user using su
or sudo -i
when making network changes. Networking configuration can vary between Linux distributions, so consult your distribution's documentation for specific instructions.