Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Reboot killed wlan0, net-setup
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Dodec
Tux's lil' helper
Tux's lil' helper


Joined: 09 Jul 2012
Posts: 115

PostPosted: Mon Jul 23, 2012 2:55 pm    Post subject: Reboot killed wlan0, net-setup Reply with quote

After finalizing my Gentoo installation, I rebooted my system and was trying to install the Xorg server software package in order to use a graphical desktop environment when I began getting "unable to resolve host address" errors that aborted the operation. After sending a few test pings and running ifconfig, I determined that the wlan0 connection I had established during the setup process was no longer in existence. Trying to run net-setup to get it back only resulted in the error "-bash: net-setup: command not found", and running iwconfig did the same thing. I attempted to emerge wpa_supplicant in order to reconfigure the network, but could not because I received the same "unable to resolve host address" errors that had plagued my Xorg emerge attempt. If anyone knows a way to get my network back, please let me know...thanks!
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Mon Jul 23, 2012 3:28 pm    Post subject: Reply with quote

ashlyw42 ...

firstly, changes made while booting the CD are not contiguious with your install, everything required for networking after reboot needs to be installed/configured within the 'chroot'. Secondly, 'net-setup' is part of the CD, its not included in your install.

So, if you need wpa_supplicant, dhcpcd, or what-have-you, to configure the network these should be installed prior to rebooting. You can resolve this by booting again from the CD, run net-setup, mounting the HD, chrooting, and emerging whatever packages are needed.

best ... khay
Back to top
View user's profile Send private message
Dodec
Tux's lil' helper
Tux's lil' helper


Joined: 09 Jul 2012
Posts: 115

PostPosted: Mon Jul 23, 2012 3:34 pm    Post subject: Reply with quote

Khayyam: Thank you for clarifying. Now I must ask what are probably two extremely stupid questions: how do I chroot? And will I have to do the rest of the installation process all over again, or does the chroot make it so I don't?
Back to top
View user's profile Send private message
Dodec
Tux's lil' helper
Tux's lil' helper


Joined: 09 Jul 2012
Posts: 115

PostPosted: Mon Jul 23, 2012 5:07 pm    Post subject: Reply with quote

I chrooted into the installation CD with the command "chroot /mnt/gentoo /bin/bash" after mounting my root and boot partitions, ran ifconfig, and the only thing that showed up was lo along with the message "Warning: cannot open /proc/net/dev (No such file or directory). Limited output." When I tried net-setup, it told me the command wasn't found, same thing with iwconfig. When I tried ifconfig with eth0 or wlan0, I got the warning from the first time I tried it with no parameters. Did I chroot wrong or skip a step or something? What's going on here? :?
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Mon Jul 23, 2012 5:35 pm    Post subject: Reply with quote

ashlyw42 wrote:
I chrooted into the installation CD with the command "chroot /mnt/gentoo /bin/bash" after mounting my root and boot partitions, ran ifconfig, and the only thing that showed up was lo along with the message "Warning: cannot open /proc/net/dev (No such file or directory). Limited output." When I tried net-setup, it told me the command wasn't found, same thing with iwconfig. When I tried ifconfig with eth0 or wlan0, I got the warning from the first time I tried it with no parameters. Did I chroot wrong or skip a step or something? What's going on here?

ashlyw42 ... nothing unusual. What your failing to understand is the chroot is the install and the CD is the means of installation. So, if your booted from the CD then it is the tools provided on the CD that is used to configure the network, not the tools within the chroot. This is why the install instructions have you setup networking prior to chrooting.

To answer specific questions. No, you don't need to reinstall, just boot the CD, setup your networking, mount /mnt/gentoo ... mount (bind) /proc, /dev, etc (as per the install instructions), cp /etc/resolv.conf to /mnt/gentoo/etc/ and 'chroot /mnt/gentoo /bin/bash' .. 'env-update' .. 'source /etc/profile'. From this point you should be able to emerge whatever is needed.

HTH & best ... khay
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54212
Location: 56N 3W

PostPosted: Mon Jul 23, 2012 5:39 pm    Post subject: Reply with quote

ashlyw42,

You skipped some steps and did others in the wrong order. Understand that chroot does what its full name means. It changes the root filesystem for everything 'inside' the changed root.
Outside, the root filessytem is provided by the CD inside its your budding Gentoo install. Things inside the chroot cannot reach outside. You may hear of spplications being run ina chroot 'jail'.

During your instll some things are needed both inside and outside the chroot. The things that re needed in both places you must make available inside the chroot every time you boot the CD. There is no persistance.

Refer to the Gentoo Handbook

Boot the CD and run net-setup if you need to. net-setup is not in the chroot.
Do the Copy DNS Info in Code Listing 1.3, this provides net
Continue with Mounting the necessary Filesystems Code Listing 1.4, this makes /proc available inside the chroot. Notice its mounted at /mnt/gentoo/proc, which becomes /proc inside the chroot.

Finally follow Code Listing 1.5 to chroot and set the environament. These commands should be in your back buffer as you are in the chroot now. Type a few letters of each line and press PageUp.
If the wrong command is found, press page up repeatedly.

You are now back in the chroot as if you has never left and your network should work too.

Oh, there are no stupid questions - except the one you don't ask. Be on your guard for stupid answers though.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Dodec
Tux's lil' helper
Tux's lil' helper


Joined: 09 Jul 2012
Posts: 115

PostPosted: Tue Jul 24, 2012 1:03 am    Post subject: Reply with quote

Thank you both for your help, but I mounted the filesystems, ran net-setup, copied the DNS info, chrooted into the system, emerged wpa_supplicant, and rebooted twice, and got the same result. Is there anything else I might be doing wrong that could be causing this? (On the plus side, I finally got my system to boot without typing a multitude of commands I could never remember--turns out my computer is one of the ones that doesn't work with GRUB.)
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Tue Jul 24, 2012 3:30 am    Post subject: Reply with quote

ashlyw42 wrote:
[...] chrooted into the system, emerged wpa_supplicant, and rebooted twice, and got the same result. Is there anything else I might be doing wrong that could be causing this?

ashlyw42 ... the question now is: how are you configuring wpa_supplicant and networking in general. As you haven't mentioned doing so, I'll assume you haven't added anything to /etc/wpa_supplicant/wpa_supplicant.conf or /etc/conf.d/net nor added /etc/init.d/net.wlan0 to the default runlevel.

I'm not sure what authentication mechanism your AP uses, I'll assume WPA2, /etc/wpa_supplicant/wpa_supplicant.conf should look something like the following (obviously the 'ssid' and 'psk' would need to match those of your AP)

Code:
network={
        ssid="your_accesspoint_name"
        scan_ssid=1
        proto=RSN
        key_mgmt=WPA-PSK
        group=CCMP TKIP
        pairwise=CCMP TKIP
        psk=your_password
}

/etc/conf.d/net can be left empty (in which case it will default to using dhcp to configure the IP, etc), however, here is an example configuration which does pretty much the same, but obviously exactly how it should be configured depends on your particular requirements ... (this particular configuration stipulates that net-misc/dhcpcd should be used as the dhcp client).

Code:
modules_wlan0="!plug wpa_supplicant dhcpcd"
wpa_supplicant_wlan0="-Dwext"
wpa_timeout_wlan0="15"
config_wlan0="dhcp"

You would then make a link to the init script ...

Code:
ln -s /etc/init.d/net.lo /etc/init.d/net.wlan0

The interface can then be activated with the following ...

Code:
/etc/init.d/net.wlan0 start

... at this point dhcp should be negociated, and IP, route, and DNS, asigned ... and you should be able to ping. If not then you will need to provide some idea of what goes wrong.

If the interface needs to be started on each boot then you can add the init script to the default runlevel, like so ...

Code:
rc-update add net.wlan0 default

HTH & best ... khay
Back to top
View user's profile Send private message
Dodec
Tux's lil' helper
Tux's lil' helper


Joined: 09 Jul 2012
Posts: 115

PostPosted: Tue Jul 24, 2012 12:37 pm    Post subject: Reply with quote

khayyam: I followed your instructions to modify the config file and create the link, and everything went smoothly until I tried to start net.wlan0, which gave me this:
Code:
 
# ln -s /etc/init.d/net.lo /etc/init.d/net.wlan0
# /etc/init.d/net.wlan0 start
*Caching service dependencies...
*Bringing up interface wlan0
*Starting wpa_supplicant on wlan0...
*Starting wpa_cli on wlan0...
*Backgrounding...
*WARNING: net.wlan0 has started, but is inactive


After getting this, I attempted to run a test ping, and got an unknown host error, even though running ifconfig showed that wlan0 existed and was working just fine. What else can I do to try and fix this?
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Tue Jul 24, 2012 3:41 pm    Post subject: Reply with quote

ashlyw42 ...

the 'WARNING' is not fatal ... its just saying that the initscript is not waiting for dhcp, or what-have-you, to return success. Normally the dhcp negociation will take some seconds, so you should normally give it a little time before attempting to ping.

Now, when you say that "ifconfig showed that wlan0 existed and was working just fine" did you mean that interface had an IP asigned? For example:

Code:
% awk '/inet addr:/{print (substr($2,6,15))}' <(/sbin/ifconfig wlan0)
192.168.2.206

... shows my current IP. If this is not the case then you should post the output of the following:

Code:
awk '/wlan0/' <(dmesg)

best ... khay
Back to top
View user's profile Send private message
Dodec
Tux's lil' helper
Tux's lil' helper


Joined: 09 Jul 2012
Posts: 115

PostPosted: Tue Jul 24, 2012 3:56 pm    Post subject: Reply with quote

khayyam: the ping still doesn't work, and when I ran awk '/wlan0/' <(dmesg) I got a screen full of nothing but this over and over again:
Code:
 
wlan0: authenticate with 08:86:3b:15:3a:a0 (try 1)
wlan0: authenticate with 08:86:3b:15:3a:a0 (try 2)
wlan0: authenticate with 08:86:3b:15:3a:a0 (try 3)
wlan0: authentication with 08:86:3b:15:3a:a0 timed out


What does it mean??? :(
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Tue Jul 24, 2012 4:54 pm    Post subject: Reply with quote

ashlyw42 wrote:
khayyam: the ping still doesn't work

ashlyw42 ... this means that the process of either authenticating or dhcp is failing ... most probably the former.

ashlyw42 wrote:
and when I ran awk '/wlan0/' <(dmesg) I got a screen full of nothing but this over and over again: wlan0: authentication with 08:86:3b:15:3a:a0 timed out. What does it mean?

It means the connection to the AP can't be established for one reason or other. So, can you tell me what authentication mechanisms does you Belkin AP support (WEP, WPA, WPA2), it may be that the above wpa_supplicant.conf is not correct (I did say this was for WPA2).

When you run net-setup what details do you provide in order for the connection to be established when booting from the CD (of course please don't provide your passphrase here).

best ... khay
Back to top
View user's profile Send private message
Dodec
Tux's lil' helper
Tux's lil' helper


Joined: 09 Jul 2012
Posts: 115

PostPosted: Wed Jul 25, 2012 12:45 am    Post subject: Reply with quote

The router supports WPA, WPA2, and WEP. My network is WEP, and when I run net-setup it gives me a screen saying "Interface name: wlan0 MAC address: 00:19:d2:b9:5f:79 Driver: iwl3945 Is this the interface you want to configure? " To which I reply yes, then when it prompts for the network settings I choose "My network is wireless" , then I enter the ssid. When asked whether the network uses encryption, I say yes, then indicate thay the key is in HEX. I enter my passphrase, then select "Use DCHP to auto-detect my network settings", after which it goes back to the command line with the prompt "Type "ifconfig" to make sure the interface was configured correctly."
Here's my /etc/wpa_supplicant/wpa_supplicant.conf, if it's any help:

Code:

# The below line must not be changed otherwise it refuses to work
ctrl_interface=/var/run/wpa_supplicant

# Ensure that only root can read the WPA configuration
ctrl_interface_group=0

# Let wpa_supplicant take care of scanning and AP selection
ap_scan=1

# Shared WEP connection (no WPA, no IEEE 802.1X) using Shared Key IEEE 802.11 authentication
network={
     ssid="network_name"
     key_mgmt=NONE
     # Keys in quotes are ASCII keys
     # Keys specified without quotes are hex keys
     wep_key1=passphrase
     wep_tx_keyidx=0
     priority=5
     auth_alg=SHARED
}

Are there any problems here?
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Wed Jul 25, 2012 1:19 am    Post subject: Reply with quote

Should be wep_key0, not wep_key1.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Wed Jul 25, 2012 2:10 am    Post subject: Reply with quote

ashlyw42 ...

Ant P. is correct it should be wep_key0= ... incidently, if your AP supports WPA and WPA2, why use WEP?

best ... khay
Back to top
View user's profile Send private message
Dodec
Tux's lil' helper
Tux's lil' helper


Joined: 09 Jul 2012
Posts: 115

PostPosted: Wed Jul 25, 2012 2:31 am    Post subject: Reply with quote

I changed wep_key1 to wep_key0, saved the config file, and while everything was loading after rebooting, I noticed that there was an error saying that wpa_supplicant had failed to start. The system brought up the eth0 connection and that timed out, and sure enough, when I logged in again and sent a test ping, it failed and I ran ifconfig, which told me that my wlan0 had disappeared once more. Should I chroot again and add wpa_supplicant to the default runlevel, or would that do anything since it appears that it alread tried to start and failed?
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Wed Jul 25, 2012 3:10 am    Post subject: Reply with quote

ashlyw42 ...

no, infact remove wpa_supplicant from the default runlevel. If you followed the instructions above then net.wlan0 is responcible for starting wpa_supplicant.

Now, disapearing interfaces ... I can't even begin to debug that.

best ... khay
Back to top
View user's profile Send private message
Odward
n00b
n00b


Joined: 21 Mar 2012
Posts: 65

PostPosted: Wed Jul 25, 2012 3:27 am    Post subject: Reply with quote

Code:
ifconfig -a

If that doesn't list your wlan0 at all, my first thoughts would be did you configure the kernel with support for your wireless card?
Wireless drivers should be built as modules.

If that is ok you probably need the firmware.

You may need to boot from the CD again and chroot according to the previous methods. Once inside the chroot environment
Code:
emerge iwl3945-ucode


That will install the firmware so your wireless adapter can work.
**Edit: I mean so the wireless adapter can work from your install, obviously the CD has it covered :D Assuming I'm not way
off base.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Wed Jul 25, 2012 4:44 am    Post subject: Reply with quote

Odward wrote:
If that doesn't list your wlan0 at all, my first thoughts would be did you configure the kernel with support for your wireless card?

Odward ... read above:

ashlyw42 wrote:
wlan0: authentication with 08:86:3b:15:3a:a0 timed out

So, the interface is active ... why is would then disapear, thats another question ...

best ... khay
Back to top
View user's profile Send private message
Odward
n00b
n00b


Joined: 21 Mar 2012
Posts: 65

PostPosted: Wed Jul 25, 2012 5:03 am    Post subject: Reply with quote

Sorry about that, I got the environments confused. Thought that set of configuration steps was occuring in the chroot, and using
the kernel from the CD. Wasn't sure if a wlan0 ever existed in the real boot.
Back to top
View user's profile Send private message
Dodec
Tux's lil' helper
Tux's lil' helper


Joined: 09 Jul 2012
Posts: 115

PostPosted: Wed Jul 25, 2012 11:34 am    Post subject: Reply with quote

This time, when I tried to run awk '/wlan0' <(dmesg) from inside the chroot it gave me this:
Code:

awk: cmd. line:1:/wlan0
awk: cmd. line:1: ^ unterminated regexp

Could this have something to do with it?
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Wed Jul 25, 2012 1:30 pm    Post subject: Reply with quote

ashlyw42 ...

no, its becuase you haven't terminated the regular expression '/wlan0/' not '/wlan0' ... but why are we back in the chroot?

best ... khay
Back to top
View user's profile Send private message
Dodec
Tux's lil' helper
Tux's lil' helper


Joined: 09 Jul 2012
Posts: 115

PostPosted: Wed Jul 25, 2012 10:02 pm    Post subject: Reply with quote

khayyam: Oh. Whoops....anyway, I'm in the chroot because that's the only way I can get the network to do anything at this point. When I run awk '/wlan0/' <(dmesg) in the chroot it gives me an IP address now that I'm using the right command, but outside the CD environment it doesn't even do anything, and ifconfig only shows eth0 and lo, neither of which work because I don't use a wired connection. When I tried to run /etc/init.d/net.wlan0 start outside the CD, it told me the service didn't exist, and that I should check that I had the right kernel module enabled for my hardware, which I'm almost positive I do. I went back into the chroot and enabled whatever else looked like it might work, and noticed in the help section on one that firmware would needed...maybe Odward was on to something with the firmware suggestion? Although that doesn't really explain how the interface would be acting like it is, or at least it's not clicking in my tiny technologically incompetent brain... :? Any other ideas, anyone?
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Thu Jul 26, 2012 1:26 am    Post subject: Reply with quote

ashlyw42 ...

this is news to me ... what am I supposed to think when you post "wlan0: authentication with 08:86:3b:15:3a:a0 timed out", obviously, that you have a wlan0 and the issue is authentication ... to double the confusion when booted from the CD we know that networking is available, so if you write "ifconfig showed that wlan0 existed and was working just fine" but that you were unable to ping, then the obvious conclusion is that your booted from the install as, again, we know that networking is available when booted from the CD ... what a merry dance. Now, should I need to ask "is the computer plugged in to the power socket?" ... because it seems I've been working on false assumptions from the beginning.

So, to start over "[w]hat your failing to understand is the chroot is the install and the CD is the means of installation", so all the information you provide should focus on information related to networking when booted from the install. As I understand it now, you have no wlan0 device ... so, this is either due to your missing the driver, and/or firmware, for your network card. So, as Odward suggested ... please check your kernel configuration for the iwl3945 driver and emerge the iwl3945-ucode firmware.

best ... khay
Back to top
View user's profile Send private message
Dodec
Tux's lil' helper
Tux's lil' helper


Joined: 09 Jul 2012
Posts: 115

PostPosted: Thu Jul 26, 2012 11:47 am    Post subject: Reply with quote

khayyam: actually, I can go for about 10 minutes with the computer unplugged, but after that I need to plug it in or else the battery dies. :)
In all seriousness, though, I believe we may have a new problem...I have just attempted to boot the CD in order to chroot three times, and each time my computer has lingered at the BIOS screen where I choose the boot options, thought about doing what I told it to, and then decided to completely ignore the CD and go straight to the LILO boot screen. And, needless to say, when it makes it into my install, wlan0 is still missing, and the ping still doesn't work. I don't suppose there's any way I can coerce the computer into accepting the existence of my wireless card without booting from the CD and chrooting...?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum