Networking
Use the ip
command to inspect network interfaces.
To show statistics about network performance:
To test connectivity use the ping command:
To show the IPv4 routing table:
Use traceroute
or tracepath
to trace network traffic takes to reach a remote host through multiple routers:
Use the ss
command to display socket statistics. The ss
command is meant to replace the older tool netstat
:
NetworkManager
is a daemon that monitors and manages network settings. Command-line and graphical tools talk to NetworkManager and save configuration files under /etc/sysconfig/network-scripts
.
Use the nmcli
utility to create and edit connection files from the command line.
Use the nmcli con add
command to add new network connections.
nmcli con add con-name enp10s0 type ethernet ifname enp10s0 ipv6.address fe80::b608:7af5:c9d3:fa66/64 ipv6.gateway 2001:1:1:1443::400 ipv4.address 192.168.122.120/24 ipv4.gateway 192.168.122.1
The nmcli con up name
command activates the connection, the nmcli con down name
and the nmcli dev dis device
to deactivate a network interface.
By default, changes made with nmcli con mod name
are automatically saved to /etc/sysconfig/network-scripts/ifcfg- name
. It is possible to configure the network by directly editing the connection configuration files.
Example:
DEVICE=enp1s0
NAME="enp1s0"
BOOTPROTO=none
IPADDR0=192.168.122.8
PREFIX0=24
GATEWAY0=192.168.122.254
DNS1=192.168.122.254
ONBOOT=yes
Summary
The TCP/IP network model is a simplified, four-layered set of abstractions that describes how different protocols interoperate for computers to send traffic from one machine to another over the Internet.
NetworkManager is a daemon that monitors and manages network configuration.
Use the nmcli
command for configuring network settings with NetworkManager.
Command References:
ip
, ping
, tracepath
, traceroute
, ss
, netstat
, NetworkManager
, nmcli
.