Contents
if you want to disable for example the eth0 (ethernet port), you can sudo ifconfig eth0 down which will disable (down) the port. changing down to up will re-enable it. use ifconfig to view your ports.
How do I turn off Ethernet in Linux?
Two methods can be used to bring interfaces up or down.
- 2.1. Using “ip” Usage: # ip link set dev <interface> up # ip link set dev <interface> down. Example: # ip link set dev eth0 up # ip link set dev eth0 down.
- 2.2. Using “ifconfig” Usage: # /sbin/ifconfig <interface> up # /sbin/ifconfig <interface> down.
How do I stop and restart eth0 in Linux?
How to Restart Network Interface in Linux
- Debian / Ubuntu Linux restart network interface. To restart network interface, enter: …
- Redhat (RHEL) / CentOS / Fedora / Suse / OpenSuse Linux – Restart network interface in Linux. To restart network interface, enter: …
- Slackware Linux restart commands. Type the following command: