LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 09-01-2008, 01:24 AM   #1
okos
Member
 
Registered: May 2007
Location: California
Distribution: Slackware/Ubuntu
Posts: 609

Rep: Reputation: 38
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?

Thanks

Last edited by okos; 09-01-2008 at 01:30 AM.
 
Old 09-01-2008, 03:54 AM   #2
meetscott
Samhain Slackbuild Maintainer
 
Registered: Sep 2004
Location: Phoenix, AZ, USA
Distribution: Slackware
Posts: 411

Rep: Reputation: 43
Referring to the ath0 interface:
Quote:
USE_DHCP[1]=""
Try changing that to:
Quote:
USE_DHCP[1]="yes"
Then comment out:
Quote:
DHCP_HOSTNAME[1]="netgear"
Like this:
Quote:
#DHCP_HOSTNAME[1]="netgear"
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.

Last edited by meetscott; 09-01-2008 at 03:59 AM.
 
Old 09-01-2008, 03:56 AM   #3
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
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.


Also have a look at 'wicd': http://slackbuilds.org/repository/12.1/network/wicd/
 
Old 09-01-2008, 06:29 AM   #4
michalr
LQ Newbie
 
Registered: Aug 2008
Location: Poznań, PL
Distribution: Slackware 12.1
Posts: 7

Rep: Reputation: 0
Referring to the ath0 interface I would also set DHCP_TIMEOUT:

Code:
DHCP_TIMEOUT[1]=30
In my case it was important. I could link my gear up to the network doing:

Code:
# wpa_supplicant -B -Dwext -iwlan0 -c/etc/wpa_supplicant.conf
# dhclient wlan0
while doing

Code:
# /etc/rc.d/rc.inet1 wlan0_start
did not work. Setting the timeout solved the problem.
 
Old 09-01-2008, 06:32 PM   #5
meetscott
Samhain Slackbuild Maintainer
 
Registered: Sep 2004
Location: Phoenix, AZ, USA
Distribution: Slackware
Posts: 411

Rep: Reputation: 43
Quote:
Setting the timeout solved the problem.
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.
 
Old 09-01-2008, 06:35 PM   #6
okos
Member
 
Registered: May 2007
Location: California
Distribution: Slackware/Ubuntu
Posts: 609

Original Poster
Rep: Reputation: 38
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.

I don't understand this means
Code:
# wpa_supplicant -B -Dwext -iwlan0 -c/etc/wpa_supplicant.conf
What does the timeout do? Does it stop the ath0 interface after 30 seconds? Or does it wait 30 seconds before starting?

Last edited by okos; 09-01-2008 at 06:37 PM.
 
Old 09-01-2008, 07:30 PM   #7
meetscott
Samhain Slackbuild Maintainer
 
Registered: Sep 2004
Location: Phoenix, AZ, USA
Distribution: Slackware
Posts: 411

Rep: Reputation: 43
Quote:
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 ;-)

Last edited by meetscott; 09-01-2008 at 07:35 PM.
 
Old 09-01-2008, 11:47 PM   #8
okos
Member
 
Registered: May 2007
Location: California
Distribution: Slackware/Ubuntu
Posts: 609

Original Poster
Rep: Reputation: 38
Here is my edited rc.inet1.conf
Code:
# 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
 
Old 09-02-2008, 12:02 AM   #9
meetscott
Samhain Slackbuild Maintainer
 
Registered: Sep 2004
Location: Phoenix, AZ, USA
Distribution: Slackware
Posts: 411

Rep: Reputation: 43
Those are pretty good instructions

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.

Last edited by meetscott; 09-02-2008 at 12:05 AM.
 
Old 09-02-2008, 04:30 PM   #10
okos
Member
 
Registered: May 2007
Location: California
Distribution: Slackware/Ubuntu
Posts: 609

Original Poster
Rep: Reputation: 38
Thanks a bunch!

I will fool around with the card settings a bit.
 
Old 09-03-2008, 06:24 AM   #11
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
Quote:
I don't understand this means
Code:
# wpa_supplicant -B -Dwext -iwlan0 -c/etc/wpa_supplicant.conf
'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)
 
Old 09-04-2008, 05:47 AM   #12
michalr
LQ Newbie
 
Registered: Aug 2008
Location: Poznań, PL
Distribution: Slackware 12.1
Posts: 7

Rep: Reputation: 0
Quote:
Originally Posted by pinniped View Post
Code:
# wpa_supplicant -B -Dwext -iwlan0 -c/etc/wpa_supplicant.conf
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
 
  


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
Howto bridge wireless and wired network interfaces? pohl886 Debian 11 07-19-2011 06:58 PM
Wireless Laptop to Wired ethernet via Linux PC (wired/wireless) sambartle Linux - Wireless Networking 0 01-30-2005 04:37 AM
Wired to Wireless back to Wired The_Nerd Linux - Hardware 5 09-15-2004 09:20 PM
Wireless - Wired bridge while still being usable? Other network questions too.... etherag Linux - Wireless Networking 6 08-27-2004 09:37 AM
Do you need to switch between wireless and wired interfaces? Wanna monitor cpufreq? ming0 Linux - Laptop and Netbook 0 01-31-2004 02:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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