LinuxQuestions.org
Register a domain and help support LQ
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 07-22-2005, 01:13 AM   #1
trialanderror
LQ Newbie
 
Registered: Jul 2005
Posts: 6

Rep: Reputation: 0
Can't obtain IP address for my wireless card


Thanks in advance for any help!

I am halfway through my first week of Linux and am a bit confused (!) with trying to get my WLAN card to work.
I am using FEDORA3 with kernel ver. 2.6.9-1.667.
My ethernet (wired) eth0 is working fine and I can get online.
I installed NDISWRAPPER v.1.2 with my Windows XP drivers for my Realtek rtl8180 wireless card, and it appears to have installed correctly (I can go to "network settings" and add WLAN0 as a device).
Additionally, from the shell, if I enter:

# /sbin/iwlist wlan0 scanning

I can get info about "Cell 01" including the ESSID (with the name of my house network displayed correctly), address, frequency, protocol, mode (managed). I do get a warning:

"Warning: Driver for device wlan0 recommend version 18 of Wireless Extension,
but has been compiled with version 16, therefore some driver features
may not be available..."

When I attempt to activate the card (through the Network Configuration GUI) it cannot determine IP information for WLAN0. It seems like I am close, but I'm running out of ideas.

Any help is appreciated. Thanks!
 
Old 07-22-2005, 03:56 AM   #2
darkleaf
Senior Member
 
Registered: Jun 2004
Location: the Netherlands
Distribution: debian SID
Posts: 2,170

Rep: Reputation: 45
You can safely ignore the warning.

"iwconfig wlan essid **** key ****"
"dhcpcd wlan0"

Set your key and essid with the first command (leave it out if you don't use either or both)
Then try to get the info.
 
Old 07-22-2005, 12:26 PM   #3
trialanderror
LQ Newbie
 
Registered: Jul 2005
Posts: 6

Original Poster
Rep: Reputation: 0
I can set the ESSID to my network ("madhouse")
The "address" in Cell 1 (madhouse) does not match the "cell" when I type:

# iwconfig wlan0

and I'm not sure how to change it (or if I need to). Also

#dhcpcd wlan0

results in an error "bash: dhcpcd: command not found"
 
Old 07-22-2005, 12:39 PM   #4
darkleaf
Senior Member
 
Registered: Jun 2004
Location: the Netherlands
Distribution: debian SID
Posts: 2,170

Rep: Reputation: 45
Can you install the dhcpcd package then?

Those addresses should be the same. Kind of weird. are you sure you're connecting to the right point then?
 
Old 07-22-2005, 04:45 PM   #5
Lleb_KCir
Senior Member
 
Registered: Nov 2003
Location: Orlando FL
Distribution: Debian
Posts: 1,765

Rep: Reputation: 45
Quote:
Originally posted by trialanderror
I can set the ESSID to my network ("madhouse")
The "address" in Cell 1 (madhouse) does not match the "cell" when I type:

# iwconfig wlan0

and I'm not sure how to change it (or if I need to). Also

#dhcpcd wlan0

results in an error "bash: dhcpcd: command not found"
type the following for setting your essid and key:

Code:
iwconfig wlan0 essid madhouse

iwconfig wlan0 key restricted XXXXXXXXX
were XXXXX... is the key from your AP for WEP. on my wifi card for what ever reason if i do not set the WEP i can not connect and pull an IP properly. you might have to configure WEP, write down the key and put that in. keep in mind the WEP key is case sensative so mine111 is not the same as MINE111.

before setting your essid and wep key i would type the following:

Code:
ifdown wlan0
and once you have it set, type [ifup wlan0[/code]


they after it comes back up you can use
Code:
ifconfig wlan0 up
and see if you can pull an IP at that point.

to look and see if you pulled an ip type
Code:
ifconfig wlan0
this will report only the info about your wlan0 card and not bother with pppX or ethX devices or loop.

good luck.
 
Old 07-22-2005, 05:05 PM   #6
dcdbutler
Member
 
Registered: Jan 2005
Location: Boston
Distribution: slackware
Posts: 502

Rep: Reputation: 30
Even after all this, you'll still need to get dhcpcd to assign an IP address. To do so on FC3, you may need to do;

# /sbin/dhcpcd wlan0

Cheers

Edit: Actually, it might be

# /sbin/dhclient wlan0

depending on whether dhcpcd or dhclient is installed, I can't remember which is the default in fedora, try both if one doesn't work.

Last edited by dcdbutler; 07-22-2005 at 05:15 PM.
 
Old 07-22-2005, 06:57 PM   #7
trialanderror
LQ Newbie
 
Registered: Jul 2005
Posts: 6

Original Poster
Rep: Reputation: 0
Thanks for all your help. My cable service decided to drop out for most of today! (lol). Now that it's back up, I tried:

# ifdown wlan0
# iwconfig wlan0 essid madhouse
(My wireless network does not require a key, so I skipped "iwconfig wlan0 key restricted XXXXXXXXX". )
# ifup wlan0

I get:

"Determining IP information for wlan0...", and "failed." after a minute or so. And when I type:

# /sbin/dhclient wlan0

I get:

"sit0: unknown hardware address type 776
sit0: unknown hardware address type 776
Listening on LPF/wlan0/00:0d:f0:12:64:cc
Sending on LPF/wlan0/00:0d:f0:12:64:cc
Sending on Socket/fallback
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 5
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 10
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 12
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 19
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 15
No DHCPOFFERS received.
No working leases in persistent database - sleeping."

I would like to avoid having to use WEP as I would like to use my laptop on various wireless networks (coffee shops, library, etc.) and obviously can't configure their networks to make my driver work. Maybe I've installed something wrong? How would I be able to tell? Thanks again for any advice.
 
Old 07-22-2005, 07:20 PM   #8
dcdbutler
Member
 
Registered: Jan 2005
Location: Boston
Distribution: slackware
Posts: 502

Rep: Reputation: 30
ok.

make sure that ndiswrapper module is loaded (it should be in the output of):

# lsmod

After you enter the key and essid information for your card, check the output of

# iwconfig wlan0

to check that all the info is there as you have input. If it is not there, simply try putting it in again. Sometimes I have to put mine in a couple of times for iwconfig to pick it up correctly You have to have the correct AP and essid info there.

# ifconfig wlan0 up

check that wlan0 is there:

# ifconfig

Once everything is there as it should be, you should be able to do

# /sbin/dhclient wlan0

It should assign an IP address.

Any more probs, post the output of iwconfig and ifconfig

Cheers
 
Old 07-22-2005, 07:59 PM   #9
Lleb_KCir
Senior Member
 
Registered: Nov 2003
Location: Orlando FL
Distribution: Debian
Posts: 1,765

Rep: Reputation: 45
you maybe in the same situation as me were your wifi card will not work in linux without WEP assigned.

go into your AP, set a WEP key, activate it, write it down, and get back into linux and try it again.

it can not hurt to activate WEP, and all it does is slow down anyone trying to wardrive you as that is better then no security at all anyways.
 
Old 07-22-2005, 08:36 PM   #10
trialanderror
LQ Newbie
 
Registered: Jul 2005
Posts: 6

Original Poster
Rep: Reputation: 0
o.k. Ndiswrapper is listed when I type lsmod (it lists "0" under the "used by" column)
I type:

# ifdown wlan0
# iwconfig wlan0 essid Madhouse
# iwconfig wlan0 AP 00:11:95:76:ED:5C
(I got this AP from doing "# /sbin/iwlist wlan0 scanning", this is the address associated with Cell 01 "Madhouse")
# iwconfig wlan0

I get:

wlan0 IEEE 802.11b ESSID:"Madhouse" Nickname:"localhost.localdomain"
Mode:Ad-Hoc Frequency:2.412GHz Cell: 00:11:95:76:ED:5C
Bit Rate=11Mb/s Tx-Power:20 dBm Sensitivity=0/3
RTS thr=2432 B Fragment thr=2432 B
Encryption keyff
Power Managementff
Link Quality:100/100 Signal level:-52 dBm Noise level:-256 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0

I type:

# ifconfig wlan0

I get:

wlan0 Link encap:Ethernet HWaddr 00:0D:F0:12:64:CC
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:38 errors:0 dropped:0 overruns:0 frame:0
TX packets:70 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:12716 (12.4 KiB) TX bytes:17316 (16.9 KiB)
Memory:e0201000-e02010ff

I type:

# /sbin/dhclient wlan0

I get:

sit0: unknown hardware address type 776
sit0: unknown hardware address type 776
Listening on LPF/wlan0/00:0d:f0:12:64:cc
Sending on LPF/wlan0/00:0d:f0:12:64:cc
Sending on Socket/fallback
DHCPREQUEST on wlan0 to 255.255.255.255 port 67
DHCPREQUEST on wlan0 to 255.255.255.255 port 67
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 3
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 6
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 11
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 11
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 21
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 9
No DHCPOFFERS received.
Trying recorded lease 192.168.0.101
PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.

--- 192.168.0.1 ping statistics ---
4 packets transmitted, 0 received, +3 errors, 100% packet loss, time 2998ms
, pipe 4
No working leases in persistent database - sleeping.

And finally:

# ifup wlan0

"Determining IP information for wlan0...failed"

and for good measure, I type "ping google.com" and get "ping: unknown host google.com" ("ping" works when I plug in my ethernet cable though)

Am I missing something? or doing something in the wrong order? Thanks again for any help.
 
Old 07-22-2005, 08:45 PM   #11
dcdbutler
Member
 
Registered: Jan 2005
Location: Boston
Distribution: slackware
Posts: 502

Rep: Reputation: 30
Ok, everything seems to be in iwconfig correctly, except the mode. Do you really use ad-hoc? Check the output of iwlist wlan0 scanning for this. Mostly people use managed, but if your card supports ad-hoc...... To change this if you need to, or to experiment,

# iwconfig wlan0 mode Managed

then try the dhcp stuff again. I'm assuming you use dhcp btw from the earlier discourse in this thread. Most people do, especially with wireless routers, but I'm just making sure. In the words of Kate Bush

"don't give up"
 
Old 07-22-2005, 09:17 PM   #12
trialanderror
LQ Newbie
 
Registered: Jul 2005
Posts: 6

Original Poster
Rep: Reputation: 0
I tried setting WEP on my router and setting the key with iwconfig, but it didn't seem to make a difference.
I also checked on my router to be sure DHCP is enabled (it is).
I changed the mode to Managed (it was listed as Managed when I typed: # iwlist wlan0 scanning).
When I'm getting: "DHCPREQUEST on wlan0 to 255.255.255.255 port 67" when I type "# /sbin/dhclient wlan0", does this number have any relation to the subnet mask? (which is 255.255.255.0 on my router control panel page)
 
Old 07-22-2005, 09:29 PM   #13
dcdbutler
Member
 
Registered: Jan 2005
Location: Boston
Distribution: slackware
Posts: 502

Rep: Reputation: 30
Hmmm, everything looks like it should work. That number is related to your subnet mask, but I'm not sure how, I'm several million marks below guru status I'm afraid.

My advice would be to just keep playing around with it. As long as all the settings match up well between the iwlist scan results and iwconfig, and you can then see the interface in ifconfig, you should be able to get dhclient to give it an IP address. Make sure your ethernet cable is unplugged too.

Good luck
 
Old 07-22-2005, 10:27 PM   #14
Lleb_KCir
Senior Member
 
Registered: Nov 2003
Location: Orlando FL
Distribution: Debian
Posts: 1,765

Rep: Reputation: 45
you may also try plugging in a static IP info in your equvilent location to:

/etc/network/interfaces

file. that is were it is located in debian, no clue were it is in your distro sorry.

# out the dhcp, and plug in a static stack to see if it is just not pulling an IP.

make sure to plug in an IP you KNOW will never be pulled. most SoHo routers start in the x.x.x.100 range and go up from there so try something way under that for your static.

an example would be as follows:

Code:
#auto wlan0
#iface wlan0 inet dhcp
 iface wlan0 inet static
        address 192.168.2.55
        netmask 255.255.255.0
        network 192.168.2.1
        broadcast 192.168.2.255
        gateway 192.168.2.1
in that example i # out the dhcp, and plug in a static stack. i also currently have wlan0 disabled on start up. the reason is ndiswrappers make my system extreemly unstable and will hard lock my box several times before i can get it up and running stable.
 
Old 07-23-2005, 12:16 AM   #15
trialanderror
LQ Newbie
 
Registered: Jul 2005
Posts: 6

Original Poster
Rep: Reputation: 0
Well I'm not sure what I did but it seems to be working now!
I couldn't find /etc/network/interfaces (is that a folder or a file?) but I played with some settings in Fedora's Network Settings GUI and I'm assuming that it saves the changes to a config file somewhere. I'd like to find it. I switched to a static IP and entered in the gateway and subnet mask, and I couldn't get online. When I reverted back to DCHP, it worked!? I hope I can figure out what to learn from all this.

Thanks everybody for your help!
 
  


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
wireless card cannot obtain IP address from DHCP server kswitch Linux - Wireless Networking 6 11-06-2005 11:36 AM
how to obtain someone's ip address through netstat dr_zayus69 Linux - Networking 5 08-13-2005 11:06 PM
unable to obtain socket and address of client David@330 Linux - Newbie 5 06-01-2005 09:23 AM
how to obtain a host's harware address through C programs in linux sagishikha Linux - Software 0 03-04-2004 03:10 AM
obtain dns server address automatically mspier Linux - Networking 10 01-11-2004 12:33 AM


All times are GMT -5. The time now is 04:14 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