There are at least two possible ways to disable any network adaptor/interface at system startup. First, as @TunanGuo says, use the command ifconfig
to find the name of your interface. When the interface is disabled you can use ifconfig -a
to list all interfaces. Let's assume the interface name is wlx99wifi
.
First method. Edit /etc/rc.local
with root privileges (use sudo nano /etc/rc.local
or sudo -i gedit /etc/rc.local
) and add the following line before the last line in that file, which is exit 0
:
/sbin/ifconfig wlx99wifi down
On the next reboot the device will be disabled.
Second method. This method should be more correct. Edit /etc/network/interfaces
with root privileges (use sudo nano /etc/network/interfaces
or sudo -i gedit ...
) and add the following line to the bottom of this file:
iface wlx99wifi inet manual
On the next reboot the device will be disabled. You can run the next command to restart network-manager
and reload the settings without reboot:
sudo systemctl restart network-manager.service
Create custom shortcuts to up/down the interface. First install gksu
package to get a GUI prompt to enter your password when you need to gain root privileges:
sudo apt install gksu
Then go to System Settings
→ Keyboard
→ Shortcuts
→ Custom Shortcuts
and:
Create Interface UP shortcut: Click + to add a new keyboard shortcut.
For Name fill wlx99wifi UP, and for Command fill:
gksu ifconfig wlx99wifi up
Click Apply and then click on the Disabled label to assign shortcut key combination. For example, use the combination Crtl+Shift+↑ Arrow Up
Create Interface DOWN shortcut: Click + to add a new keyboard shortcut.
For Name fill wlx99wifi DOWN, and for Command fill:
gksu ifconfig wlx99wifi down
Click Apply and then click on the Disabled label to assign shortcut key combination. For example, use the combination Crtl+Shift+↓ Arrow Down
References and sources: