Restarting a network interface in Linux helps recover from transient connectivity problems, apply new IP settings, or test changes to routing and firewall rules without rebooting the system. Bringing an interface down and back up clears its link state and usually triggers a fresh negotiation with switches, access points, or DHCP servers.
Under the hood, the kernel exposes logical network interfaces such as enp0s3, eth0, or wlp2s0, and the iproute2 tools manage their link state and addresses. Commands like ip link set and ip addr interact directly with the kernel’s networking stack, while higher-level services such as NetworkManager or legacy scripts in /etc/network may monitor and reconfigure interfaces in response to these changes.
Restarting an in-use interface can immediately drop active SSH sessions or break connectivity to remote services, so changes are safest from a local console, out-of-band management, or a secondary interface. On systems using NetworkManager, additional tools like nmcli may also adjust connections when an interface is toggled, and some environments apply firewall or VLAN policies as soon as the link returns.
$ whoami user
$ ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 02:00:00:00:00:10 brd ff:ff:ff:ff:ff:ff
inet 192.0.2.40/24 metric 100 brd 192.0.2.255 scope global dynamic eth0
valid_lft 1766sec preferred_lft 1766sec
##### snipped #####
The interface name appears at the start of each block, for example eth0 or wlp2s0.
Common wired names include enp0s3 or eth0, while wireless interfaces often appear as wlp2s0 or wlan0.
$ sudo ip link set dev eth0 down
Bringing down the interface that carries an active SSH session immediately disconnects that session and may require physical or out-of-band access to recover.
$ ip link show dev eth0
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,DOWN> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000
link/ether 02:00:00:00:00:10 brd ff:ff:ff:ff:ff:ff
$ sudo ip link set dev eth0 up
No output from ip link set usually indicates success; any error message points to permission or naming issues.
$ ip link show dev eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
link/ether 02:00:00:00:00:10 brd ff:ff:ff:ff:ff:ff
$ sudo dhclient eth0 DHCPREQUEST for 192.0.2.40 on eth0 to 255.255.255.255 port 67 DHCPOFFER of 192.0.2.40 from 192.0.2.1 DHCPACK of 192.0.2.40 from 192.0.2.1 bound to 192.0.2.40 -- renewal in 1800 seconds.
Some distributions use other DHCP clients such as systemd-networkd or NetworkManager, which may renew leases automatically when the interface comes back up.
$ ip addr show dev eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 02:00:00:00:00:10 brd ff:ff:ff:ff:ff:ff
inet 192.0.2.40/24 metric 100 brd 192.0.2.255 scope global dynamic eth0
valid_lft 1800sec preferred_lft 1800sec
$ ping -c 4 203.0.113.50 PING 203.0.113.50 (203.0.113.50) 56(84) bytes of data. 64 bytes from 203.0.113.50: icmp_seq=1 ttl=128 time=5.01 ms 64 bytes from 203.0.113.50: icmp_seq=2 ttl=128 time=13.9 ms 64 bytes from 203.0.113.50: icmp_seq=3 ttl=128 time=8.70 ms 64 bytes from 203.0.113.50: icmp_seq=4 ttl=128 time=5.32 ms --- 203.0.113.50 ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 3014ms rtt min/avg/max/mdev = 5.011/8.241/13.941/3.594 ms