LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-05-2010, 02:29 AM   #1
genogebot
Member
 
Registered: Jun 2010
Location: Brisbane, Australia
Distribution: Xubuntu 16.04.1 / Linux Mint 18 XFCE / Linux Mint 18 Mate / Ubuntu Server 16.04.1 / Lubuntu 16.04.1
Posts: 146

Rep: Reputation: 19
How to start with wireless interface disabled?


I'm trying to configure Linux Mint 9 so that the wireless interface wlan0 is disabled until I enable it.

I've hunted around and learned that I can disable the wireless after bootup with the command 'sudo ifconfig wlan0 down' and then restart it with 'sudo ifconfig wlan0 up', but I'd prefer to have it in the 'down' state from bootup.

I read up on the /etc/network/interfaces file, and it seemed that the 'auto' stanza was the relevant part that told the system to automatically start the interface, but when I tried commenting out the 'auto wlan0' line wlan0 still started automatically.

Can someone point me in the right direction to configure my system the way I want?

Thanks.
 
Old 08-05-2010, 03:44 AM   #2
saifkhan123
Member
 
Registered: Apr 2009
Distribution: Red Hat/CentOS
Posts: 108

Rep: Reputation: 19
can you paste your /etc/network/interfaces config file?
 
Old 08-05-2010, 03:52 AM   #3
sem007
Member
 
Registered: Nov 2006
Distribution: RHEL, CentOS, Debian Lenny, Ubuntu
Posts: 638

Rep: Reputation: 113Reputation: 113
how you configure your wlan0 through /etc/network/interface file or network-manager(graphics)?
 
Old 08-05-2010, 04:38 AM   #4
genogebot
Member
 
Registered: Jun 2010
Location: Brisbane, Australia
Distribution: Xubuntu 16.04.1 / Linux Mint 18 XFCE / Linux Mint 18 Mate / Ubuntu Server 16.04.1 / Lubuntu 16.04.1
Posts: 146

Original Poster
Rep: Reputation: 19
Thanks for the quick replies

Quote:
Originally Posted by saifkhan123 View Post
can you paste your /etc/network/interfaces config file?
auto lo
iface lo inet loopback

#auto wlan0
iface wlan0 inet static
address 192.168.1.3
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1

auto internet
iface internet inet manual
up ifconfig $IFACE 0.0.0.0 up
up ip link set $IFACE promisc on
down ip link set $IFACE promisc off
down ifconfig $IFACE down

auto backup
iface backup inet manual
up ifconfig $IFACE 0.0.0.0 up
up ip link set $IFACE promisc on
down ip link set $IFACE promisc off
down ifconfig $IFACE down

auto br0
iface br0 inet static
address 192.168.0.3
netmask 255.255.255.0
broadcast 192.168.0.255
network 192.168.0.0
gateway 192.168.0.1
bridge_ports internet backup
As you can see, I have two ethernet ports (renamed as 'internet' and 'backup' in /etc/udev/rules.d/70-persistent-net.rules) that are bridged into br0 so they can both be used on the same subnet - 'internet' goes to my Smoothwall box, and 'backup' goes to my Ubuntu server box that I use as a backup storage and file server.

Quote:
Originally Posted by sem007 View Post
how you configure your wlan0 through /etc/network/interface file or network-manager(graphics)?
I have completely removed Network-Manager (via 'sudo apt-get remove' rather than the Package Manager because I've read that Package Manager leaves parts of Network Manager on the system) and I configure the devices through /etc/network/interfaces. When I want to connect to my wireless access point on the 192.168.1.x subnet I use Wicd to make the connection. I've had to remove the wired interfaces from Wicd configuration because it only allows one type of interface to be connected at a time - until I did that Wicd would drop the wired connection when I made a wireless connection, and vice-versa.

Last edited by genogebot; 08-05-2010 at 04:42 AM. Reason: Typo (snd i hat typos)
 
Old 08-06-2010, 03:27 AM   #5
genogebot
Member
 
Registered: Jun 2010
Location: Brisbane, Australia
Distribution: Xubuntu 16.04.1 / Linux Mint 18 XFCE / Linux Mint 18 Mate / Ubuntu Server 16.04.1 / Lubuntu 16.04.1
Posts: 146

Original Poster
Rep: Reputation: 19
<bump>
 
Old 08-06-2010, 08:51 AM   #6
saifkhan123
Member
 
Registered: Apr 2009
Distribution: Red Hat/CentOS
Posts: 108

Rep: Reputation: 19
Comment out the whole stanza related to wlan0, that is
Code:
#auto wlan0
#iface wlan0 inet static
#address 192.168.1.3
#netmask 255.255.255.0
#network 192.168.1.0
#broadcast 192.168.1.255
#gateway 192.168.1.1
save and then try reboot, may be the problem is solved.
 
Old 08-06-2010, 03:35 PM   #7
genogebot
Member
 
Registered: Jun 2010
Location: Brisbane, Australia
Distribution: Xubuntu 16.04.1 / Linux Mint 18 XFCE / Linux Mint 18 Mate / Ubuntu Server 16.04.1 / Lubuntu 16.04.1
Posts: 146

Original Poster
Rep: Reputation: 19
Quote:
Originally Posted by saifkhan123 View Post
Comment out the whole stanza related to wlan0, that is
Code:
#auto wlan0
#iface wlan0 inet static
#address 192.168.1.3
#netmask 255.255.255.0
#network 192.168.1.0
#broadcast 192.168.1.255
#gateway 192.168.1.1
save and then try reboot, may be the problem is solved.
But then I will lose the static configuration of the wlan0 interface - how will the system know what ip address to assign the interface when I want to use it?
 
Old 08-06-2010, 07:06 PM   #8
zrdc28
Member
 
Registered: Dec 2007
Location: Alabama USA
Distribution: Slackware current
Posts: 300

Rep: Reputation: 53
wicd will do it for you instead of network manager. With wicd uncheck autoconnect and you are there.
 
Old 08-06-2010, 07:57 PM   #9
genogebot
Member
 
Registered: Jun 2010
Location: Brisbane, Australia
Distribution: Xubuntu 16.04.1 / Linux Mint 18 XFCE / Linux Mint 18 Mate / Ubuntu Server 16.04.1 / Lubuntu 16.04.1
Posts: 146

Original Poster
Rep: Reputation: 19
Quote:
Originally Posted by zrdc28 View Post
wicd will do it for you instead of network manager. With wicd uncheck autoconnect and you are there.
No it doesn't:

Quote:
Originally Posted by genogebot View Post
I have completely removed Network-Manager
Quote:
Originally Posted by genogebot View Post
When I want to connect to my wireless access point on the 192.168.1.x subnet I use Wicd to make the connection.
My question is not how to prevent automatic connection to my WAP; it is how to keep the wireless interface disabled until I want to enable it.

Quote:
Originally Posted by genogebot View Post
I can disable the wireless after bootup with the command 'sudo ifconfig wlan0 down' and then restart it with 'sudo ifconfig wlan0 up', but I'd prefer to have it in the 'down' state from bootup.
 
Old 08-07-2010, 06:55 AM   #10
genogebot
Member
 
Registered: Jun 2010
Location: Brisbane, Australia
Distribution: Xubuntu 16.04.1 / Linux Mint 18 XFCE / Linux Mint 18 Mate / Ubuntu Server 16.04.1 / Lubuntu 16.04.1
Posts: 146

Original Poster
Rep: Reputation: 19
Quote:
Originally Posted by saifkhan123 View Post
Comment out the whole stanza related to wlan0, that is
Code:
#auto wlan0
#iface wlan0 inet static
#address 192.168.1.3
#netmask 255.255.255.0
#network 192.168.1.0
#broadcast 192.168.1.255
#gateway 192.168.1.1
save and then try reboot, may be the problem is solved.
Out of curiousity, I tried this - commenting out every line in the wlan0 section in /etc/network/interfaces - and wlan0 was still enabled. The only difference was that it didn't have any ip address info assigned.

I also tried setting the wlan0 interface to 'manual' but that didn't make any difference either.

I've hunted through every man page and document I can find about wireless networking in linux with no success. I've googled and found several other posts from people trying to achieve the same thing, but apparently without success.

I'm starting to come to the conclusion that this is impossible in linux - by comparison, in Windows XP all it takes is clicking on a 'Disable Wireless' menu item <sigh>. I suppose people have been so concerned with getting their wireless hardware to work that no-one considered the possibility that anyone would want to prevent it from working

Last edited by genogebot; 08-07-2010 at 06:59 AM.
 
Old 08-07-2010, 07:21 AM   #11
zrdc28
Member
 
Registered: Dec 2007
Location: Alabama USA
Distribution: Slackware current
Posts: 300

Rep: Reputation: 53
If you use wicd, at times you have to go to /etc/rc.d/rc.inet1.conf and comment out all items in it. This should turn over total control to wicd.
http://wicd.sourceforge.net/download.php
 
Old 08-07-2010, 05:59 PM   #12
genogebot
Member
 
Registered: Jun 2010
Location: Brisbane, Australia
Distribution: Xubuntu 16.04.1 / Linux Mint 18 XFCE / Linux Mint 18 Mate / Ubuntu Server 16.04.1 / Lubuntu 16.04.1
Posts: 146

Original Poster
Rep: Reputation: 19
Quote:
Originally Posted by zrdc28 View Post
If you use wicd, at times you have to go to /etc/rc.d/rc.inet1.conf and comment out all items in it. This should turn over total control to wicd.
http://wicd.sourceforge.net/download.php
On Linux Mint 9, there is no /etc/rc.d/ directory. There are rc0.d to rc6.d and rcS.d directories, each containing symbolic links whose targets are located in /etc/init.d/, and that folder doesn't contain any rc.inet1.conf file. Apparently your distro uses a different configuration to Mint 9. Thanks anyway.
 
Old 08-15-2010, 04:22 AM   #13
genogebot
Member
 
Registered: Jun 2010
Location: Brisbane, Australia
Distribution: Xubuntu 16.04.1 / Linux Mint 18 XFCE / Linux Mint 18 Mate / Ubuntu Server 16.04.1 / Lubuntu 16.04.1
Posts: 146

Original Poster
Rep: Reputation: 19
Got it!

Ok, it took a lot of reading and messing about and reading again, but I figured this one out by myself.

I used the iwconfig utility to switch off power to the wireless card at startup, and wrote a shell script to switch it back on again when I need to use it.

I added this line to the /etc/rc.local file:
/sbin/iwconfig wlan0 txpower off
and that powers off the wireless card at boot time.

The shell script just reverses that, and brings the card into the 'up' network state:
#!/bin/bash
sudo /sbin/iwconfig wlan0 txpower on
sleep 1
sudo /sbin/ifconfig wlan0 up
Finally! Now I can relax
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Start-up script to start wlan interface Bluefightingcat Linux - Networking 7 08-30-2009 05:09 PM
Problem Bridging Wired Interface to Wireless Interface. JivanAmara Linux - Networking 0 08-17-2009 02:25 AM
graphic interface disabled uxan Fedora 1 05-23-2008 10:42 AM
My Xserver Is Disabled - Cant Start Up GUI !!! taurusx5 Linux - Software 21 03-19-2008 09:13 PM
Wireless interface unable to start on dell laptop hyjalsoul Slackware 23 11-21-2007 05:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration