Results 1 to 8 of 8

Thread: How to permanently disable network adapter?

  1. #1
    Join Date
    Aug 2006
    Location
    USA
    Beans
    131
    Distro
    Lubuntu

    Question How to permanently disable network adapter?

    Using the command line, how can I permanently disable network adapters?

    I can disable the network adapters via GUI (see screenshot).
    How can I do the same via command line (CLI)?
    Is there a file I can edit?

    Network.jpg

    Thanks in advance,
    Jake

  2. #2
    Join Date
    Nov 2008
    Location
    Boston MetroWest
    Beans
    16,326

    Re: How to permanently disable network adapter?

    sudo ifconfig eth0 down

    will disable the primary Ethernet interface. Apply the same logic to any other interfaces you wish to disable.

    If you want to permanently disable it so it doesn't come up at the next reboot, you'll have to "blacklist" the network driver in /etc/modprobe.d/. It's probably easier to add the ifconfig command (without the "sudo") to /etc/rc.local, the last script that runs when the machine boots.
    Last edited by SeijiSensei; May 20th, 2015 at 04:55 PM.
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  3. #3
    Join Date
    Aug 2006
    Location
    USA
    Beans
    131
    Distro
    Lubuntu

    Re: How to permanently disable network adapter?

    I think I'm running into a problem adding to the rc.local. I'm guessing I have services running and using the network adapter, and then the rc.local shuts the adapter down. If this is true, I need the solution the disable the adapter before rc.local, init.d, etc.

    I need something that will disable the adapter at the beginning.

    I have two network adapters (eth0 and wlan0). I don't want to use wlan0 for anything.
    Last edited by snakyjake; May 20th, 2015 at 11:41 PM.

  4. #4
    Join Date
    Oct 2011
    Location
    Galiza
    Beans
    3,380
    Distro
    Ubuntu Development Release

    Re: How to permanently disable network adapter?

    Quote Originally Posted by snakyjake View Post
    I need something that will disable the adapter at the beginning.
    Answer in post #2 (blacklist driver).

    I have two network adapters (eth0 and wlan0). I don't want to use wlan0 for anything.
    Wouldn't NOT connecting to any WiFi network and/or use an hardware switch (if available) or simply removing the card/USB you "don't want to use for anything" be a way simpler and effective solution?
    Galiza Nação!

  5. #5
    Join Date
    Aug 2006
    Location
    USA
    Beans
    131
    Distro
    Lubuntu

    Re: How to permanently disable network adapter?

    Where's the setting to disable "Automatically connect to this netowork when it is available"?

    I need this setting, and the adapter, disabled at boot before some services start. I don't want the services (apps) mapping my router to the wlan0 IP address.

    Network2.jpg

  6. #6
    Join Date
    Aug 2006
    Location
    USA
    Beans
    131
    Distro
    Lubuntu

    Re: How to permanently disable network adapter?

    Quote Originally Posted by SeijiSensei View Post
    "blacklist" the network driver in /etc/modprobe.d
    I'm not able to see modprobe.d

  7. #7
    Join Date
    Oct 2011
    Location
    Galiza
    Beans
    3,380
    Distro
    Ubuntu Development Release

    Re: How to permanently disable network adapter?

    Quote Originally Posted by snakyjake View Post
    I don't want the services (apps) mapping my router to the wlan0 IP address.
    If you never connect to a WiFi network, nothing will be mapped; likewise if there's no adaptor at all (removed).
    I'm still confused: Why are you complicating things so much?
    Galiza Nação!

  8. #8
    Join Date
    Oct 2011
    Location
    Galiza
    Beans
    3,380
    Distro
    Ubuntu Development Release

    Re: How to permanently disable network adapter?

    Quote Originally Posted by snakyjake View Post
    I'm not able to see modprobe.d
    Everybody has /etc/modprobe.d so i also don't understand why you don't "see" it.
    Galiza Nação!

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •