A few questions regarding setting up wired and wireless interfaces.
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
A few questions regarding setting up wired and wireless interfaces.
Hi Guys,
At home I plug into my lan via ethO
I will be going on a business trip and am looking to connect to the local unencrypted wireless network (coffee shop etc...)
I have the madwifi drivers and athuros chip and connect via the ath0 interface.
I want the default interface to be eth0 and if no connection, I want my computer to connect via ath0 to the closest wireless network.
I set things up in rc.inet1.conf as so:
Quote:
# Config information for eth0:
IFNAME[0]="eth0"
IPADDR[0]=""
NETMASK[0]=""
USE_DHCP[0]="yes"
DHCP_HOSTNAME[0]="bt"
# Config information for ath0:
IFNAME[1]="ath0"
IPADDR[1]=""
NETMASK[1]=""
USE_DHCP[1]=""
DHCP_HOSTNAME[1]="netgear"
#WLAN_WPA[1]="wpa_supplicant"
I commented out "#WLAN_WPA[1]="wpa_supplicant" because I got an error stating something like wpa_supplicant could not be found at boot.
Could I get some help setting things up as stated above?
On /etc/rc.d/rc.wireless.conf, make sure this is there:
Quote:
## --------- START SECTION TO REMOVE -----------
## Pick up any Access Point, should work on most 802.11 cards
*)
INFO="Any ESSID"
ESSID="any"
;;
## ---------- END SECTION TO REMOVE ------------
You can also see which interfaces are coming up by issuing "ifconfig" as root. "iwconfig" for wireless specific stuff. That should get you a long way.
When you issue a "dhcpcd -N ath0" as root, it should pick up an access point if one is available. I add the -N switch to not clobber ntp.conf if you are syncing with a time server. If not, you can skip the -N.
For 'eth0' Debian's "ifplugd" works beautifully - but I don't know if Slack has an equivalent. You can try 'dhcpcd' to see if that meets your requirements.
As for wpa_supplicant, search for a package with the name "wpasupplicant". You need to see your distro-specific documentation on how to work with it though.
Yeah. If I'm remembering right, Slackware used to set dhcpcd time outs to about 10 seconds. It may have been increased. 10 seconds is fine when there's only a handful of computers and access points around, i.e. your own home. But in busy areas or at work, I've had to increase this to as much as 60 seconds!
michalr, it looks like you are using some things I'm not aware of. It's always good, especially in the realm of wireless communications on Linux, to see what other people are doing to get things to work. Hardware and distributions vary so much, it can be more of a black art and luck instead of a step by step procedure!
Also, I mentioned the -N switch earlier. This applies to /etc/rc.d/rc.inet1 as well. On lines 129 and 130 of Slackware 12.1, dhcpcd is called and the -N switch has to be added there as well to preserve atomic time configuration, just like you'd have to do on the command line. I don't know if anyone cares, but I thought I'd mention it for completeness.
Thanks guys for the response
My reply is a little broken up because I am answering each of your comments.
I setup rc.wireless.conf as so
Code:
## NOTE : Comment out the following five lines to activate the samples below ...
## --------- START SECTION TO REMOVE -----------
## Pick up any Access Point, should work on most 802.11 cards
#
00:14:6c:09:0b:33)
INFO="Netgear WG511T"
ESSID="Any ESSID"
;;
#*)
# INFO="Any ESSID"
# ESSID="any"
# ;;
## ---------- END SECTION TO REMOVE ------------
However I beleive the rc.inet1.conf takes precidence over rc.wireless
For slack you use dhcpcd I never tried ifplugd as used in Debian.
wpa_supplicant comes installed with the slack disks
Perhaps I need to edit the /etc/wpa_supplicant.conf ?
Code:
# This line enables the use of wpa_cli which is used by rc.wireless
# if possible (to check for successful association)
ctrl_interface=/var/run/wpa_supplicant
# By default, only root (group 0) may use wpa_cli
ctrl_interface_group=0
eapol_version=1
ap_scan=1
fast_reauth=1
# WPA protected network, supply your own ESSID and WPAPSK here:
network={
scan_ssid=0
ssid="your_essid_here"
proto=WPA
key_mgmt=WPA-PSK
pairwise=CCMP TKIP
group=CCMP TKIP WEP104 WEP40
psk=your_psk_here
}
# Plaintext connection (no WPA, no IEEE 802.1X),
# nice for hotel/airport types of WiFi network.
network={
key_mgmt=NONE
priority=0
}
I will edit rc.inet1.conf as some of you had suggested.
What does the timeout do? Does it stop the ath0 interface after 30 seconds? Or does it wait 30 seconds before starting?
We're talking about waiting to receive an IP address from the access point you are trying to connect to. It has nothing to do with the interface being brought up or down. That is a separate operation.
Quote:
Perhaps I need to edit the /etc/wpa_supplicant.conf ?
And I'd stay away from anything that has to do with WPA while you are trying to do this. It will only complicate matters and most public access points are not encrypted anyway. I don't really know much about this file because I don't use it myself.
I'd start with seeing which interfaces are up with "ifconfig". You need to know if your system is starting up these interfaces. "ifconfig ath0 up" will attempt to bring that interface up. Likewise, "ifconfig ath0 down" will bring it down.
If the interface is up, then "dhcpcd ath0" will attempt to get an IP address from the nearest access point if it is set to "any".
Wireless settings can be set manually using "iwconfig" or "iwconfig ath0" for a specific interface.
Look... It doesn't have to be ath0, wlan0, or anything else. It's just a name that is configured. Mine is eth0 on one and wlan0 for another card these are on the same box!
Keep posting back. We'll help you get it figured out ;-)
# Config information for eth0:
IFNAME[0]="eth0"
IPADDR[0]=""
NETMASK[0]=""
USE_DHCP[0]="yes"
DHCP_HOSTNAME[0]="bt"
# Config information for ath0:
IFNAME[1]="ath0"
IPADDR[1]=""
NETMASK[1]=""
USE_DHCP[1]="yes"
DHCP_TIMEOUT[1]=30
#DHCP_HOSTNAME[1]="netgear"
#WLAN_WPA[1]="wpa_supplicant"
I have a question,
Is there an easier way to scan and connect to an unencrypted essid via command line other then the instructions on madwifi? http://madwifi.org/wiki/UserDocs/FirstTimeHowTo
I looked at those instructions. Those are pretty good.
You won't have to go through all of them every time. You could write a quick shell script to throw the appropriate switches to make it easier. Also, KDE has a configuration utility that helps with some of it. You could add modules to load at start time, so you don't have to do that.
At a minimum I think you have to make sure the interface is up with:
ifconfig
And bring it up if it's down:
ifconfig ath0 up
Then you have to use dhcpcd to acquire an IP address:
dpchcd ath0
The rest should be set once you get all the configuration set properly, modules loaded, etc. That really should do it if you have it set to "any".
Oh. And for scanning, you might want to check out kismet. I use it all the time, it's a really cool utility for scanning networks in the area. I use the hostap driver for this myself. Your card has to support the scanning mode. I can't remember what that's called. Kismet can't be running while you are are connected to the network because it monopolizes the ethernet card. You can be connected if you have 2 cards though.
'man wpa_supplicant' should tell you what they all mean; I haven't got it on this computer so I don't know what the '-B' does.
-Dwext = Use the driver for the Linux Wireless Extensions; historically you had to specify different 'drivers' to deal with different hardware, but since the code was cleaned up the only necessary driver is 'wext'.
-iwlan0 = Use the interface 'wlan0'
-c ... = Use the file /etc/wpa_supplicant.conf as the configuration file (not necessary if this is the default)
I haven't got it on this computer so I don't know what the '-B' does.
The '-B' stands for Background. It just moves the process to background. In other words it launches wpa_supplicant as a deamon so you get your terminal prompt back
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.