Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking
User Name
Linux - Wireless Networking This forum is for the discussion of wireless networking in Linux.


  Search this Thread
Old 11-02-2005, 10:23 PM   #1
LQ Newbie
Registered: Jun 2004
Distribution: Kubuntu/CentOS
Posts: 18

Rep: Reputation: 0
Select wifi configuration based on essid

My laptop goes around with me all over the place, connecting to a wide variety of wireless networks. Most of the time it can get a configuration via DHCP and everything is happy. When I come back home at the end of the day, however, I'd like the laptop to connect to my home network with a static IP so that some backup scripts can run automatically.

There's an interesting script here that does something similar to what I'm looking for, but still requires user intervention to make it happen. I would really like for all of this to happen at boot time without my thinking about it. Here's the general idea, in psuedo-code:

$list_of_aps=iwlist eth1 scan;
if (in_list($list_of_ips, 'my_home_network'){
//proceed with static IP configuration
//fall back to DHCP configuration
It seems like this could be put into the networking startup script, but I'm not sure how to do it - shell scripting is not my strong suit.

I've seen some programs out there that can handle switching profiles on the fly. That's all well and good...but not really necessary. At the moment there are really only two options - static IP at home, or DHCP elsewhere. I don't want to set up profiles for every coffee house, hotel, classroom or client I visit. Can anyone help out with this script?
Old 11-23-2005, 04:40 AM   #2
Registered: Feb 2004
Location: Valby, Denmark / Citizen of the Web
Distribution: Slackware 14.1
Posts: 879

Rep: Reputation: 39
Yes - any pointers on this one? At present I use Wifi-radar, which is good, but hardly automatic...
Old 11-23-2005, 08:19 AM   #3
LQ Newbie
Registered: Jun 2004
Distribution: Kubuntu/CentOS
Posts: 18

Original Poster
Rep: Reputation: 0
I got it to work using a script called WhereAmI. It took quite a bit of trial and error. I have two laptops here now that use it. Both run the same version and distro but it took wildly different configs to make them both work.
Old 11-26-2005, 07:38 AM   #4
Senior Member
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 233Reputation: 233Reputation: 233
You could also set your DHCP server to assign the laptop its "static" IP address according to its MAC address. This ability to do assigned/reserved/"nailed" IP's is present in most, but not all, DHCP servers. My old SMC router could do this, a new model at a client's house could not.

Currently I am using SmoothWall Express 2.0 & considering moving to IPcop.

Assuming you have a DHCP server available, there is the advantage of central administration if you have it assign all those local static IP addresses you want. I currently have only 4 (down from 6) boxen + firewall on my LAN & every one gets its assigned IP from my DHCP server.


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
WiFi dhcp ip essid wep advice otchie1 Linux - Wireless Networking 3 12-15-2006 12:32 PM
Wireless config based on ESSID? mdj Linux - Wireless Networking 30 12-15-2005 02:59 AM
How is Mandriva for PCMCIA based WiFi??? JaseP Mandriva 11 12-01-2005 10:08 PM
iwlist vs tethereal in capturing 802.11 wifi ESSID and data rates powah Linux - Wireless Networking 0 11-07-2005 10:21 AM
Changing a table contents dynamically based on select box rose_bud4201 Programming 4 01-13-2005 10:48 AM > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking

All times are GMT -5. The time now is 04:15 PM.

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