LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices

Reply
 
Search this Thread
Old 07-16-2009, 10:22 PM   #1
Skaperen
Senior Member
 
Registered: May 2009
Location: WV, USA
Distribution: Slackware, CentOS, Ubuntu, Fedora, Timesys, Linux From Scratch
Posts: 1,777
Blog Entries: 20

Rep: Reputation: 115Reputation: 115
How to start wireless system wide before a user logs in


I would like to configure the wireless networking under Ubuntu 9.04 to be automatically started when the computer reboots, before a user logs in on the console GUI. It would be preferred that the wireless network to be logged in to be fixed in that configuration so that it always tries the same network regardless of what network the last logged in user used. It would also be preferred that when a user logs in, their network choice is connected (disconnecting the previous network if different), AND reverting back to the system preference when they log out.

As mentioned in another thread, I'd like to be able to log in on the text mode console only to not have media automounting in effect (other solutions to that should be posted in that thread) but I do want to have wireless operating in this situation. One purpose (of many) for this is to transfer media device raw sector images over wireless (by some protocol such as SSH).

I would also like to do this to leave my netbook powered on when I am away, and be able to log in to it from remote. For the curious, how I would do that is an automatically initiated SSH session would be made to a dummy login on offsite server, with port forwarding from the server back to the SSH port on the netbook, so it would be SSH inside SSH.

So anyway, the ultimate issue is how to get wireless networking to be automatically started in much the same ways as wired ethernet networking can be started, but without using the ethernet port.
 
Old 07-17-2009, 03:40 AM   #2
tredegar
Guru
 
Registered: May 2003
Location: London, UK
Distribution: Ubuntu 10.04, mostly
Posts: 6,007

Rep: Reputation: 366Reputation: 366Reputation: 366Reputation: 366
Quote:
I would like to configure the wireless networking under Ubuntu 9.04 to be automatically started when the computer reboots
1] Uninstall "Network Manager", as it messes everything up. Use wicd if you need a GUI for your networks

2] Edit your /etc/network/interfaces file to bring up your wireless at boot.

Here's mine (eth1 is my wireless interface, 10.0.0.2 is my router's IP)

Static IP's:
Code:
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
broadcast 10.255.255.255
address 10.0.0.8
netmask 255.255.255.0
gateway 10.0.0.2


auto eth1
iface eth1 inet static
broadcast 10.255.255.255
address 10.0.0.8
netmask 255.255.255.0
gateway 10.0.0.2
wpa-passphrase itsasecret
wpa-ssid Netgear-12AF
For DHCP make it look like this:
Code:
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto eth1
iface eth1 inet dhcp
wpa-passphrase itsasecret
wpa-ssid Netgear-12AF
See man interfaces
 
Old 07-17-2009, 07:54 AM   #3
scheidel21
Senior Member
 
Registered: Feb 2003
Location: CT
Distribution: Debian PPC/i386/AMD64 6/7, Vista, XP , WIN7, Server 03/08
Posts: 1,278

Rep: Reputation: 91
As far as disconnecting and connecting to a network I can't think of a real easy way to do this, but I suppose you could look into wpa_supplicant and have ascript run for the users that brings down the if than changes the wpa_supplicant.conf file changing the values of network s so that their network has highest priority then bringing the if back up. And doinf the reverse when they log out.
 
Old 07-17-2009, 01:41 PM   #4
Skaperen
Senior Member
 
Registered: May 2009
Location: WV, USA
Distribution: Slackware, CentOS, Ubuntu, Fedora, Timesys, Linux From Scratch
Posts: 1,777
Blog Entries: 20

Original Poster
Rep: Reputation: 115Reputation: 115
Quote:
Originally Posted by scheidel21 View Post
As far as disconnecting and connecting to a network I can't think of a real easy way to do this, but I suppose you could look into wpa_supplicant and have ascript run for the users that brings down the if than changes the wpa_supplicant.conf file changing the values of network s so that their network has highest priority then bringing the if back up. And doinf the reverse when they log out.
Ideally, the developers of the wireless and/or network management tools should just realize this is one of the desired modes of operation, and integrate it into their project. One way to do that is to have a background daemon run all the time. The user tool communicates with it internally. When that communication starts, the user is authenticated for rights to change wireless settings (user rights vs. network administrator rights). The tool communicates the user's temporary preference to the daemon and receives status. If the connection breaks, the wireless will revert to the permanent/system setting after a certain time frame (the time frame is configured by network administrator and about 30 seconds seems a reasonable starting default). Anyway, this is something that really should be part of the presented tool. I'm not the only one that wants it.
 
Old 07-17-2009, 02:15 PM   #5
tredegar
Guru
 
Registered: May 2003
Location: London, UK
Distribution: Ubuntu 10.04, mostly
Posts: 6,007

Rep: Reputation: 366Reputation: 366Reputation: 366Reputation: 366
From your OP:
Quote:
I would like to configure the wireless networking under Ubuntu 9.04 to be automatically started when the computer reboots, before a user logs in on the console GUI. It would be preferred that the wireless network to be logged in to be fixed in that configuration so that it always tries the same network regardless of what network the last logged in user used. It would also be preferred that when a user logs in, their network choice is connected (disconnecting the previous network if different), AND reverting back to the system preference when they log out.
[...SNIP...]
So anyway, the ultimate issue is how to get wireless networking to be automatically started in much the same ways as wired ethernet networking can be started, but without using the ethernet port.
Unless I have misunderstood your OP that's what happens if you apply the changes as in my post #2
Did you try it?
If so, why no feedback?

Quote:
Ideally, the developers of the wireless and/or network management tools should just realize this is one of the desired modes of operation, and integrate it into their project.
Ideally everything would work for all users, however different their needs, and under all circumstances. But different users have very different requirements. One of the advantages of linux is that you can configure it to do exactly what you want. The tools are all there. But you need to learn to use them.

Quote:
Anyway, this is something that really should be part of the presented tool. I'm not the only one that wants it.
What "presented tool", exactly? As usual, there are many varieties that you could be using. Maybe one suits your requirements better than another ( Eg "Network Manager" versus "wicd" )
 
Old 07-17-2009, 02:31 PM   #6
scheidel21
Senior Member
 
Registered: Feb 2003
Location: CT
Distribution: Debian PPC/i386/AMD64 6/7, Vista, XP , WIN7, Server 03/08
Posts: 1,278

Rep: Reputation: 91
Well the Daemon end of things is sort of all ready in place. I never really used network manager, I prefer editing the config files, but really you have your networking daemon that works with your interfaces and then for wireless, like in the case of wpa_supplicant you have your wpa_supplicant Daemon running. In the case of Debian wpa_suppliucant is integrated with the network daemon, in such a way that the ifup script for the wireless interface calls the supplicant config file and wpa_supplicant daemon starts at boot time. So running ifdown wlan0 will kill the supplicant daemon, and ifup will restart it, the the config file holds network information in form of essid with network encrytion and keys, this will allow aoutomatic connection to any network listed, and you can also add a wildcard that will basically connect to the closest non-encrypted strongest wireless network.

I have an idea you could ponder though.

You can override the priority setting for networks with the wpa_supplicant front end (GUI or CLI) Why not write a script that runs and changes their wireless network on logon using the wpa_supplicant front end then hav a cleanup script or something if you will that reconnects to the system network on logout, or maybe when the logon screen comes backup.

As far as starting before a user logs on, I know in Debian it does as I explained above, Debian brings the interface up on boot time and then the ifup script starts the wpa_supplicant daemon and the connects to the highest priority network listed in the conf file.

PS I have not used wicd, however it looks like a GUI front end for wpa_supplicant, although if you don't need/want to manage wired connections with it too you could use the wpa_supplicant GUI, I think it is called wpa_gui, for a front end, this would allow a user to change their network that wpa_supplicant is connected to manually based on a list or they can add one that is scanned. For greater control, you might want to just write scripts that are executed by them or on login that connect to their approriate network, and have no GUI interface at all then they can't muck up setting or do something they shouldn't.

You might also see about how you can start wpa_supplicant on boot/startup with whatever distro you are using.
 
Old 07-18-2009, 07:20 PM   #7
Skaperen
Senior Member
 
Registered: May 2009
Location: WV, USA
Distribution: Slackware, CentOS, Ubuntu, Fedora, Timesys, Linux From Scratch
Posts: 1,777
Blog Entries: 20

Original Poster
Rep: Reputation: 115Reputation: 115
Quote:
Originally Posted by tredegar View Post
From your OP:


Unless I have misunderstood your OP that's what happens if you apply the changes as in my post #2
Did you try it?
If so, why no feedback?
I haven't gotten to try it, yet, because of other things. I want to focus on the GUI administrative methods, rather than editing config files. I've done things the editing way in the past. Part of why I am using Ubuntu is to experience it the way people who strictly use GUI (and those that claim GUI can do everything) do it.

And I've been delayed due to other issues.

Quote:
Originally Posted by tredegar View Post
Ideally everything would work for all users, however different their needs, and under all circumstances. But different users have very different requirements. One of the advantages of linux is that you can configure it to do exactly what you want. The tools are all there. But you need to learn to use them.
Right. And with a more raw system, I would. BTDT a lot. But if I do things that way, why have Ubuntu at all?

Quote:
Originally Posted by tredegar View Post
What "presented tool", exactly? As usual, there are many varieties that you could be using. Maybe one suits your requirements better than another ( Eg "Network Manager" versus "wicd" )
Whatever I can find in the menu of tools. Maybe replacing NM with WICD is the answer. A couple people on IRC suggested it and will try it later. They didn't know if it could, but merely suspected it could. We'll eventually see.
 
Old 07-19-2009, 03:05 AM   #8
tredegar
Guru
 
Registered: May 2003
Location: London, UK
Distribution: Ubuntu 10.04, mostly
Posts: 6,007

Rep: Reputation: 366Reputation: 366Reputation: 366Reputation: 366
If you want to use a GUI, use a GUI.
But use wicd, and uninstall NM.
Open wicd
Click the little triangle next to your AP's name.
Click "Automatically connect to this network"
Click "Advanced settings" and fill in the boxes.
You are done.
 
  


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
Making wireless connection host-wide instead of per-user Skaperen Linux - Networking 1 07-10-2009 08:15 AM
system wide read only user? bobinabottle Linux - Security 2 02-28-2009 07:23 AM
Start X automatically when user logs in? Firewielder Linux - Newbie 4 01-21-2006 10:00 AM
making a minimalist window manager start up with a particular user logs on JackSmith Linux - Newbie 2 05-22-2005 10:53 AM
Getting a program to start with root privileges when a user logs in. joeking Linux - Security 4 10-24-2003 11:47 AM


All times are GMT -5. The time now is 01:52 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration