LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-12-2011, 10:52 AM   #1
rylan76
Senior Member
 
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,552

Rep: Reputation: 103Reputation: 103
How to get and then use DHCP offers to config the wlan connection?


Hi guys

I'm using the following in a script to connect to my house's wi-fi - it works perfectly for me - simple, and with a static IP:

Code:
modprobe zd1211rw #load the module needed by my wireless LAN adapter
ifconfig wlan0 up
iwconfig wlan0 essid my_network_name_at_home
ifconfig wlan0 10.0.0.8 netmask 255.255.255.0
route add default gw 10.0.0.2 wlan0
iwconfig wlan0 key key_comes_here
However, if I take my machine to the office, we've got DHCP assigned dynamic IPs. How can I modify the above script to NOT do

Code:
ifconfig wlan0 10.0.0.8 netmask 255.255.255.0
route add default gw 10.0.0.2 wlan0
but instead get them from the DHCP service running at work on the W-LAN?

Thanks!
 
Old 05-13-2011, 03:14 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Well from the slightly odd position you're coming from you would just surely use an if statement checking the essid you are connected to or something, but your script already forces you to use a specific essid in the first place so surely what you want to achieve is not actually going to help you? What's wrong with just using network manager or something else normal?
 
Old 05-16-2011, 01:47 PM   #3
rylan76
Senior Member
 
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,552

Original Poster
Rep: Reputation: 103Reputation: 103
Quote:
Originally Posted by acid_kewpie View Post
Well from the slightly odd position you're coming from you would just surely use an if statement checking the essid you are connected to or something, but your script already forces you to use a specific essid in the first place so surely what you want to achieve is not actually going to help you? What's wrong with just using network manager or something else normal?
I'll only ever use the connection in my house's wi-fi hotspot (taking it elsewhere was hypothetical), the ESSID will always be a constant. I've stopped using any form of automatic config since FC10 - had an incredible amount of trouble there getting things working - doing it by hand in FC11 had me going in 5 minutes flat. So I fell back on how I did it in the past on even older distros - wrote my own script to call the needed binaries to configure my connection.

So what you're saying is I'm screwed if I use this approach and now suddenly want to change horses in mid-stream and use DHCP?

AFAIK I can only call dhclient and leave it at that...? All I effectively need is the ability to find an available IP in the local subnet, and the syntax I need to pass, for doing that, to dhclient - if any...

Last edited by rylan76; 05-16-2011 at 01:49 PM.
 
  


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
No DHCP Offers with Debian ehrenbrav Linux - Networking 9 08-20-2009 09:03 PM
Ubuntu, no DHCP offers recieved. The_Neon_Knight Linux - Wireless Networking 0 10-25-2007 04:34 AM
No DHCP Offers With Madwifi wkuballa Linux - Wireless Networking 5 08-15-2007 12:17 PM
No DHCP offers when VMware is running wkuballa Debian 0 06-25-2007 09:34 AM
LXer: Devicescape offers WLAN capabilities to Linux hacks LXer Syndicated Linux News 0 05-11-2006 01:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:48 AM.

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
Open Source Consulting | Domain Registration