LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices


Reply
  Search this Thread
Old 06-08-2013, 12:52 AM   #1
stchhx
LQ Newbie
 
Registered: May 2013
Posts: 6

Rep: Reputation: Disabled
wireless with dhclient


I have finished LFS and now proceed to BLFS. But the first thing I'd like to do is to make wireless working. So I installed Wireless Tools-29 and DHCP-4.2.5-P1. After running:
iwconfig wlan0 essid ...
and
iwconfig wlan0 key ...
I tried:
dhclient -v wlan0

but wasn't able to connect to my router. One of the output being:

execve (/sbin/dhclient-script, ...): Permission denied

I google this message but most of them are related to upgrading of Ubuntu. Could anybody shed some light on how to set up wireless in LFS? Thanks.

BTW, my wireless driver is working properly, I can verify that in dmesg (Intel 4965AGN)
 
Old 06-08-2013, 01:12 AM   #2
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
Hi

The Permission denied part have you run it as root
And have you installed wpa
http://www.linuxfromscratch.org/blfs...upplicant.html

Dose iwlist "wireless adaptor" scan give you results?
 
Old 06-08-2013, 01:41 PM   #3
stchhx
LQ Newbie
 
Registered: May 2013
Posts: 6

Original Poster
Rep: Reputation: Disabled
Sorry I forgot to mention that I am running it as root, actually I haven't created any user other than root yet. And iwlist wlan0 scan give me the following result:

wlan0 Scan completed :
Cell 01 - Address: 00:24:01:6B:CD:1B
Channel:6
Frequency:2.437 GHz (Channel 6)
Quality=36/70 Signal level=-74 dBm
Encryption keyn
ESSID:"Magicat"
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
9 Mb/s; 12 Mb/s; 18 Mb/s
Bit Rates:24 Mb/s; 36 Mb/s; 48 Mb/s; 54 Mb/s
Mode:Master
Extra:tsf=00000000822df945
Extra: Last beacon: 62ms ago
IE: Unknown: 00074D616769636174
IE: Unknown: 010882848B960C121824
IE: Unknown: 030106
IE: Unknown: 0706555320010B1B
IE: Unknown: 200100
IE: WPA Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : CCMP TKIP
Authentication Suites (1) : PSK
IE: Unknown: 2A0100
IE: Unknown: 32043048606C
IE: Unknown: DD180050F2020101020003A4000027A4000042435E0062322F00
IE: Unknown: DD1E00904C334C101BFFFF000000000000000000000000000000000000000000
IE: Unknown: 2D1A4C101BFFFF000000000000000000000000000000000000000000
IE: Unknown: DD1A00904C3406001900000000000000000000000000000000000000
IE: Unknown: 3D1606001900000000000000000000000000000000000000
IE: Unknown: DD0900037F01010000FF7F
IE: Unknown: DD7B0050F204104A00011010440001021041000100103B00010310470010565AA94967C14C0EAA8FF349E6F5931110210006 442D4C696E6B1023000D442D4C696E6B20526F75746572102400074449522D363135104200046E6F6E651054000800060050 F204000110110006442D4C696E6B100800020084103C000101
Cell 02 - Address: 00:25:9C:FD:37:C6
Channel:6
Frequency:2.437 GHz (Channel 6)
Quality=25/70 Signal level=-85 dBm
Encryption keyn
ESSID:"Darkness"
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
9 Mb/s; 12 Mb/s; 18 Mb/s
Bit Rates:24 Mb/s; 36 Mb/s; 48 Mb/s; 54 Mb/s
Mode:Master
Extra:tsf=0000000dc97e0374
Extra: Last beacon: 1624ms ago
IE: Unknown: 00084461726B6E657373
IE: Unknown: 010882848B960C121824
IE: Unknown: 030106
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : TKIP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
Preauthentication Supported
IE: WPA Version 1
Group Cipher : TKIP
Pairwise Ciphers (1) : TKIP
Authentication Suites (1) : PSK
IE: Unknown: 2A0100
IE: Unknown: 32043048606C
IE: Unknown: DD180050F2020101020003A4000027A4000042435E0062322F00
IE: Unknown: DD930050F204104A00011010440001021041000100103B000103104700100000000000000001100000259CFD37C610210013 4C696E6B73797320436F72706F726174696F6E102300075752543132304E1024000776312E302E30341042000C4A55543030 4B3337333030331054000800060050F204000110110014576972656C65737320526F757465722857464129100800020084
IE: Unknown: DD0900037F01010000FF7F
IE: Unknown: DD0A00037F04010000000000
Cell 03 - Address: 20:76:00:FC:61:2C
Channel:6
Frequency:2.437 GHz (Channel 6)
Quality=22/70 Signal level=-88 dBm
Encryption keyn
ESSID:"TELUS0131"
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 18 Mb/s
24 Mb/s; 36 Mb/s; 54 Mb/s
Bit Rates:6 Mb/s; 9 Mb/s; 12 Mb/s; 48 Mb/s
Mode:Master
Extra:tsf=000003fdb77066aa
Extra: Last beacon: 62ms ago
IE: Unknown: 000954454C555330313331
IE: Unknown: 010882848B962430486C
IE: Unknown: 030106
IE: Unknown: 2A0104
IE: Unknown: 2F0104
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
IE: Unknown: 32040C121860
IE: Unknown: 2D1A6C181BFFFF000000000000000000000000000000000000000000
IE: Unknown: 3D1606001700000000000000000000000000000000000000
IE: Unknown: DD730050F204104A00011010440001021041000100103B0001031047001078D97E3C7EA3E82A66C483073ADFA0FE10210008 42726F6164636F6D1023000842726F6164636F6D1024000631323334353610420004313233341054000800060050F2040001 1011000751313030304150100800020088
IE: Unknown: DD090010180204F0050000
IE: WPA Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
IE: Unknown: DD180050F2020101800003A4000027A4000042435E0062322F00
IE: Unknown: DD1E00904C336C181BFFFF000000000000000000000000000000000000000000
IE: Unknown: DD1A00904C3406001700000000000000000000000000000000000000
Cell 04 - Address: 00:21:04:73:09:8C
Channel:8
Frequency:2.447 GHz (Channel 8)
Quality=49/70 Signal level=-61 dBm
Encryption keyn
ESSID:"G110802"
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 22 Mb/s
Bit Rates:6 Mb/s; 9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s
36 Mb/s; 48 Mb/s; 54 Mb/s
Mode:Master
Extra:tsf=0000000bd3b3054e
Extra: Last beacon: 62ms ago
IE: Unknown: 000747313130383032
IE: Unknown: 010582848B962C
IE: Unknown: 030108
IE: Unknown: 2A0100
IE: Unknown: 32080C1218243048606C
Cell 05 - Address: 38:60:77:8D:8C:3A
Channel:11
Frequency:2.462 GHz (Channel 11)
Quality=29/70 Signal level=-81 dBm
Encryption keyn
ESSID:"7E8E61"
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s
Bit Rates:6 Mb/s; 9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s
36 Mb/s; 48 Mb/s; 54 Mb/s
Mode:Master
Extra:tsf=0000003d39d4f98f
Extra: Last beacon: 62ms ago
IE: Unknown: 0006374538453631
IE: Unknown: 010482848B96
IE: Unknown: 03010B
IE: Unknown: 2A0104
IE: Unknown: 2F0104
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : CCMP TKIP
Authentication Suites (1) : PSK
IE: Unknown: 32080C1218243048606C
IE: Unknown: 2D1AFC181BFFFF000000000000000000000000000000000000000000
IE: Unknown: 3D160B080400000000000000000000000000000000000000
IE: Unknown: 4A0E14000A002C01C800140005001900
IE: Unknown: 7F0101
IE: Unknown: DD09001018020DF02C0000
IE: WPA Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : CCMP TKIP
Authentication Suites (1) : PSK
IE: Unknown: DD180050F2020101800003A4000027A4000042435E0062322F00

Cell 04 is the one I am trying to connect to, looks like it didn't detected any encryption mode. I use WEP64 rather than WPA, is that the problem? Does wpa_supplicant-2.0 handle WEP too or do I need to install other package for WEP? Thanks.
 
Old 06-08-2013, 04:02 PM   #4
stoat
Member
 
Registered: May 2007
Distribution: LFS
Posts: 628

Rep: Reputation: 185Reputation: 185
Quote:
Originally Posted by stchhx

Does wpa_supplicant-2.0 handle WEP...
For a WEP encrypted connection, you don't need wpa_supplicant.

The way I used to connect manually (or by script) with WEP encryption was like this example...
Code:
/sbin/iwconfig wlan0 key restricted <hex_key_here> essid "<router_ssid_here>"
/sbin/ifconfig wlan0 up
/sbin/dhclient wlan0
You have iwconfig and dhclient. Net-tools-CVS_20101030 (in the BLFS book) provides ifconfig. But there may be other ways to do this. You might be able to bring up the interface with /sbin/ifup. You already have that. No harm trying it. You also may be able to use the network init script (which calls /sbin/ifup) to bring up the interface automatically and a script (or some lines in ~/.bash_profile) to handle establishing the connection. Anyway, that's how I currently do all this with WPA.

You need to have your config file in /etc/sysconfig. You may need to add a rule for your device in /etc/udev/rules.d/70-persistent-net.rules. You know, all the usual stuff for any network connection.

Last edited by stoat; 06-08-2013 at 08:19 PM.
 
1 members found this post helpful.
Old 06-08-2013, 10:34 PM   #5
stchhx
LQ Newbie
 
Registered: May 2013
Posts: 6

Original Poster
Rep: Reputation: Disabled
Thanks, it works! As soon as I run:

/sbin/iwconfig wlan0 key restricted <hex_key_here> essid "<router_ssid_here>"

the connection is established, even without the ifup and dhclient. I didn't know that essid and key should be set in one command, instead of two separated commands.

I have already had ifconfig.wlan0 in /etc/sysconfig with the following content:

ONBOOT="yes"
IFACE="wlan0"
SERVICE="dhcpcd"
DHCP_START="-b -q"
DHCP_STOP="-k"

and the content of 70-persistent-net.rules is like this:

# net device e1000e
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:16:d3:ca:16:95", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# net device iwl4965
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:13:e8:92:48:51", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan0"

is that sufficient? Should I put the iwconfig wlan0 key restricted <hex_key_here> essid "<router_ssid_here>" command somewhere? I guess I can not put it in ~/.bash_profile, right? otherwise whenever I launch a bash shell it will be execute?
 
Old 06-09-2013, 07:34 AM   #6
stoat
Member
 
Registered: May 2007
Distribution: LFS
Posts: 628

Rep: Reputation: 185Reputation: 185
Quote:
Originally Posted by stchhx

...the connection is established, even without the ifup and dhclient.
Probably your network initscript, which calls /sbin/ifup which reads the config file, is handling bringing the interface up. You probably can see that occurring amongst the console init messages during booting. Then, later, your iwconfig command is establishing the connection. I use the same scheme with wpa_supplicant for WPA.

Quote:
Originally Posted by stchhx

I guess I can not put it in ~/.bash_profile, right? otherwise whenever I launch a bash shell it will be execute?
I put commands to be run once at login time in my non-root user's ~/.bash_profile. I put things to be run each time a bash shell is opened in my non-root user's ~/.bashrc. I usually don't add anything to the root user's private startup files. That arrangement works okay for me.

Quote:
Originally Posted by stchhx

I have finished LFS and now proceed to BLFS. But the first thing I'd like to do is to make wireless working.
Quote:
Originally Posted by stchhx

...I am running it as root, actually I haven't created any user other than root yet.
I would first complete chapter 3 including creating a non-root user. Then go wherever you want next in the BLFS book. Anyway, that's what I do.

Last edited by stoat; 06-09-2013 at 08:06 AM.
 
1 members found this post helpful.
Old 06-09-2013, 12:18 PM   #7
stchhx
LQ Newbie
 
Registered: May 2013
Posts: 6

Original Poster
Rep: Reputation: Disabled
Thanks for the explanation. You are right, it's time to create a non-root user and I will put the iwconfig command in that user's .bash_profile.
 
  


Reply



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
Wireless locks up with dhclient keith2045 Linux - Wireless Networking 1 10-30-2007 07:27 PM
dhclient with wireless card on Debian benoit808 Linux - Wireless Networking 5 02-21-2007 12:26 PM
Ubuntu finds my wireless but DHCLIENT won't work igo_mexico Linux - Wireless Networking 5 05-28-2006 04:50 PM
Kubuntu dhclient and wireless king111 Linux - Wireless Networking 5 01-03-2006 05:34 PM
PC-BSD 0.7 Wireless dhclient shepper *BSD 2 05-24-2005 09:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 01:19 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
Open Source Consulting | Domain Registration