Wireless from the Debian command line

Walter Dnes waltdnes-SLHPyeZ9y/tg9hUCZPvPmw at public.gmane.org
Wed May 12 06:03:40 UTC 2010


On Mon, May 10, 2010 at 10:36:46AM -0400, Giles Orr wrote

> Unencrypted wireless seems to be fine, I believe this is entirely
> wpa_supplicant-related.

  I had a similar problem, where open access points worked, but not my
wireless router.  It was caused by my eth0 route over-riding my wlan0
route, which "is not a good thing".  For a quick-n-dirty test, tear down
your eth0 with "/etc/init.d/net.eth0 stop" (or Debian equivalant), and
then try to connect to your wireless router.  If that works, then it's a
routing problem.  You can modify your route statements to allow multiple
routes to co-exist.  The key is the "metric" option.  The higher the
number, the lower priority it has.  My home setup is like so...

ST546 4-port ADSL router modem with internal network 192.168.123.248/29
which can also be written as 192.168.123.248 netmask 255.255.255.248.
The numbers inside the LAN are...
192.168.123.250  Dell d530 desktop
192.168.123.251  Dell d530 desktop
192.168.123.252  external address of Belkin router
192.168.123.254  ST546 internal address

  My netbook is hooked up to different wired networks at different
times, so things get ugly.  I sometimes hook it up to an ethernet jack
on the Belkin wired+wireless router, to configure the wireless.  The
internal net behind the Belkin is 192.168.2.0 netmask 255.255.255.0.
The Belkin shows up internally as 192.168.2.1, and I assign 192.168.2.2
to my netbook.  I've recently purchased an HDHomerun dual-ATSC-tuner,
which can be run from the command line in linux (and Windows and Mac).
The HDHomerun does *NOT* have static IP addressing, so it uses zeroconf
(aka link-local) addresses in 169.254.0.0/16.  I need my netbook to be
able to connect to it.  So I also assign it IP address 169.254.1.1.
Here is my /etc/conf.d/net (Gentoo-specific; Debian may differ).

####################################################################
config_eth0=(
"192.168.2.2 broadcast 192.168.2.255 netmask 255.255.255.0 mtu 1452"
"169.254.1.1 broadcast 169.254.0.255 netmask 255.255.0.0"
)
routes_eth0=(
"default via 192.168.2.1 metric 2"
"192.168.123.248/29 via 192.168.2.1 metric 0"
"169.254.0.0/16 via 196.254.1.1 metric 0"
)
modules=( "wpa_supplicant" )
config_wlan0=( "null" )
wpa_supplicant_wlan0="-Dwext"
wpa_timeout_wlan0=15
####################################################################

The netbooks's eth0 has 2 static IP addresses with different networks.
The wireless (wlan0) IP address is dynamically assigned.  Here's how I
think it works...

* the highest priority is "metric 0".

* Any attempt to ssh to my desktops will go via the wired connection of
  the Belkin, which is plugged into the ST546 router

* Any attempt to talk to the HDHomerun tuner goes via eth0 direct to the
  tuner

* next priority is "metric 1".  Dialup and wireless appear to be
  assigned that value.

* lowest in my config is "metric 2".  Any packets that aren't specified
  elsewhere will be taken by the "default route".  This is usually used
  when I'm updating Gentoo on the netbook, and have to talk via the
  wired connection of the Belkin.

* Since I have only 1 physical ethernet jack, at least one of the wired
  networks is always unreachable, so I get a "network unreachable"
  warning at bootup.  That is not a problem.

  Debian's conf may be different, but the logic should be the same.  I
first figured out this stuff when I became annoyed at having to tear
down eth0 to allow dialup (ppp0) to connect properly.  It looks like I
may end up using it in a different way soon.  Given Bell's UBB victory,
I'll force email and Gentoo updates via dialup, and reserve my ADSL
bandwidth for internet radio.

-- 
Walter Dnes <waltdnes-SLHPyeZ9y/tg9hUCZPvPmw at public.gmane.org>
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list