# No /etc/conf.d/wireless -- how to configure WLAN?

## Minot

Hello.  I spent the better part of my day working with my laptop and Netgear MA521 cardbus WLAN.  I eventually got the ndiswrapper working properly.  It modprobes perfectly and I get output with iwconfig.

My question is where to proceed from here.  I've been reading these forums and doing google searches, but can't find what I'm looking for.  I have one access point and would like to configure with iwconfig.  I'd like it to start at bootup.  Unfortunately, I don't appear to have the file /etc/conf.d/wireless installed on my system.  There is no example either.  I have both the wireless and radio options configured in my kernel (per the Gentoo Wireless wiki).

How can I get this file and for the wlan0 device to use it?

Thanks!

-MINOT-

----------

## Master Shake

I don't have an /etc/conf.d/wireless either but it does just what I want it to.  It will use the last connection point that you were connected to at startup.  Just make sure that you have net.wlan0 run at default and it should work just fine.

----------

## Minot

Ok, I am trying that now.  I did the following:

```
rc-update del net.eth0 default

rc-update add net.wlan0 default
```

I previously copied /etc/init.d/net.eth0 to /etc/init.d/net.wlan0

My problem now is how to put in the appropriate configuration for my essid and WEP key.  I'm guessing it can go in /etc/conf.d/net instead of /etc/conf.d/wireless.  Where did you put this?  Is there a guide to the proper format for this information?

-MINOT-

----------

## Minot

Where do you put the static ip for the wireless card?  What about all of the iface info.  Right now when I run ifconfig I get wlan0 with the ip address, but nothing of this sort with iwconfig.  Is this normal.  It won't ping anything at the moment.

-MINOT-

----------

## UberLord

You need baselayout-1.11.12 or better for working wireless support.

http://dev.gentoo.org/~uberlord/net-book/

----------

## adi-beg

as root for all:

1. emerge ndiswrapper

2. emerge wireless tools

3. lspci

4. disable smp support in kernel <-- if you end up recompiling a kernel, reboot, then re-emerge ndiswrapper

5. download drivers from http://ndiswrapper.sourceforge.net/supported_chipsets.html

6. ndiswrapper -i /path/to/<driver>.inf <-- This installs the driver

7. ndiswrapper -l <-- Verify the driver was installed

8. edit /etc/modules.d/ndiswrapper to have the line:

alias wlan0 ndiswrapper

9. modprobe ndiswrapper <-- only needs done once

10. iwconfig wlan0 essid <essid>

11. iwconfig wlan0 mode Managed <-- optional to keep away from Ad-hoc. don't use this if you have an ad-hoc network

12. iwconfig wlan0 rate auto <-- optional, but let's the card/router select the rate transmission

13. ifconfig wlan0 up

14. dhcpcd wlan0

if the above does not work,

15. ndiswrapper -e <driver>

16. go back to step 6 and try with another driver

to get the ndismodule to load at boot

echo "ndiswrapper" >> /etc/modules.autoload.d/kernel-<version>

God Luck!

----------

## adi-beg

And of course you need

```
CONFIG_NET_RADIO=y

CONFIG_NET_WIRELESS=y
```

in kernel.

----------

## Minot

First, let me thank you all for your help.  Even before I read these notes, I partially achieved my goal.  The good news is that the wlan0 is working.  In fact, I just finished installing Xfce4 and Firefox and I'm typing this message to you on the laptop (via the wireless).  The bad news is that it is far from automatic after I reboot.  I have to run a series of iwconfig commans to get it working.  I obviously still have my config incorrect.  Let me address a few of your comments.

 *adi-beg wrote:*   

> And of course you need
> 
> ```
> CONFIG_NET_RADIO=y
> 
> ...

 

Yes, I do have both of these items installed.

 *UberLord wrote:*   

> You need baselayout-1.11.12 or better for working wireless support. 

 

How do I know if I have this already installed?  I previously emerged wireless-tools and ndiswrapper.

As for adi-beg's excellent instructions, let me show you where I got:

1. emerge ndiswrapper -- Done!

2. emerge wireless tools -- Done!

3. lspci -- Done! [Shows my cardbus bridge and wlan listed without problems]

4. disable smp support in kernel -- Done with original kernel config!

5. download drivers from http://ndiswrapper.sourceforge.net/supported_chipsets.html -- Done! [net8180.inf and rtl8180.sys]

6. ndiswrapper -i /path/to/<driver>.inf -- Done!  Good results

7. ndiswrapper -l <-- Verify the driver was installed properly -- Done!  Good results

8. edit /etc/modules.d/ndiswrapper to have the line:

alias wlan0 ndiswrapper -- Done!  This line was installed for me -- I did not have to edit and it was there.

9. modprobe ndiswrapper <-- only needs done once -- Done!

10. iwconfig wlan0 essid <essid> -- Done!

11. iwconfig wlan0 mode Managed -- Done!

12. iwconfig wlan0 rate auto <-- optional -- No!  But as you said, not absolutely necessary.

13. ifconfig wlan0 up -- No!  Never did this but it seems to work anyway

14. dhcpcd wlan0 -- Using static IP [no DHCP]

Anyway, that should bring you up to speed.  My Ndiswrapper is working like a charm.  I can get the wlan0 working when I manually run the following lines:

```
iwconfig wlan0 mode managed

iwconfig wlan0 channel 1

iwconfig wlan0 essid <myessid>

iwconfig wlan0 key <mywepkey>
```

I also had to edit /etc/conf.d/net to add a line for iface_wlan0 to set the static IP address for the wireless card.  I don't think this is the right place.  Everything I've read says this should be in /etc/conf.d/wireless.  Unfortunately, the file does not exist for me.

So anyway, I can get it working, but it is far from automated.  How can I get it configured so these iwconfig commands will run automatically at boot?

Thanks again for your help!

-MINOT-

----------

## jakubc

hi,

you really should install the masked baselayout (as UberLord said), edit your /etc/portage/package.keywords to have:

```

sys-apps/baselayout ~YOUR_ARCH

```

that way you will always be up to date on all the releases when doing "emerge -uD world"  :Smile: .  Then just:

```

emerge -av baselayout

```

this will show you the version it is emerging over.

The automatic config of your wireless is in baselayout ver 1.11.?, which is masked, along with /etc/config.d/wireless.

Hope this helped.

----------

## Valhalla

/etc/conf.d/wireless.example is very well documented, and can store all of you iwconfig settings.  You put you settings in /etc/conf.d/wireless, a default  isn't provided for you, and they are parsed every time you start the wireless interface.  Here are some of the settings you will probably want.  Here is what you /etc/conf.d/wireless should probably look like

```

key_<your ssid>="s:<your wep key> enc restricted" 

preferred_aps=( "<your ssid>" )

channel_wlan0="1"

```

The restricted should be whatever is listed as Security Mode: from the command iwconfig wlan0.  It will either be open or restricted and depends on you wireless routers configuration (fully independant of the antennae)

After setting /etc/conf.d/wireless you should be able to add it to the default runlevel and it will work.  If for some reason it fails, I suggest setting RC_VERBOSE="yes" in /etc/conf.d/rc as it will output more information from the init scripts.

----------

## Minot

Ok, I think I'm finding my problem.  It is baselayout (as UberLord so astutely pointed out on the onset).  I am having trouble getting the masked package emerged.  I added "sys-apps/baselayout ~x86" to /etc/portage/package.keywords.  Unfortunately, this still won't install the proper verion of baselayout.  it says some of the dependencies are also masked.  How can I get the system to let me install baselayout 1.11?

Also, just to bring you up to speed.  My configuration is working well, except I have to manually run the following commands from root:

```
iwconfig wlan0 essid myessid

iwconfig wlan0 key 1234ABCD1234ABCD1234ABCD12
```

where myessid is my actual ESSID and the key is the same length as my 128-bit WEP encryption key (I've been using no caps and no hypens).

Once I run those two commands, my wireless lan works great.  I was hoping I could just add the following to /etc/conf.d/net:

```
modules ( "iwconfig" )

essid_wlan0="myessid"

key_wlan0="1234ABCD1234ABCD1234ABCD12"
```

Why won't adding these lines work?  This seems quite straight forward.

Thanks ahead of time for your help with the masked baselayout ebuild and my /etc/conf.d/net question.

-MINOT-

----------

## jakubc

hi,

sorry about that, I should have mentioned it... I write this so many times, I think I should just make a document to copy-paste:-)) basically just enter whatever packakges emerge says it needs unmasked into your /etc/portage/package.keywords.  The whole procedure is here HOWTO.  Give that a try and see how it goes... 

good luck!

----------

## Minot

Ok, I have baselayout 1.11 installed.  Thanks for the tip.  The funny thing was I had that document you linked printed out and sitting in front of me.  I didn't even realize what it was saying.

Unfortunately, I have no change.  i still have to manually add the essid and key as root using iwconfig.  I created and edited /etc/conf.d/wireless.  Do I need to do some sort of rc-update to get it to read the configuration in that file?   *Valhalla wrote:*   

> After setting /etc/conf.d/wireless you should be able to add it to the default runlevel and it will work.

 I currently have the following: rc-update add net.wlan0 default in the system where net.wlan0 is a symlink to net.eth0.  Do I need to do the following or something like this:

```
rc-update add wireless default
```

There is no /etc/init.d/wireless file so I don't think this is correct.

-MINOT-

----------

## Valhalla

No, you add net.wlan0 ... 

the init script works by parsing whatever comes after net, so it actually activates that interface.

----------

## Minot

I've already got net.wlan0 set as default.  My problems are sounding very similar to those of larand54 in his thread: https://forums.gentoo.org/viewtopic-t-339083-postdays-0-postorder-asc-start-0.html.  I too can get it working manually.  I just want to find a way to get it working through the config files.

Right after I boot the system, the IP address for wlan0 is set (from /etc/conf.d/net).  All of the ifconfig paramaters are correct.  In iwconfig, nothing is set.  No essid, no key, no mode, nothing.  It seems to me that it is not reading any of iwconfig data regardless of where I put it (in /etc/conf.d/wireless or even /etc/conf.d/net).  Is there a trick to getting it to actually read this data?  Adding the following in /etc/conf.d/net seems to have no impact:

```
modules = ( "iwconfig" )
```

Any more suggestions?

-MINOT-

----------

## adi-beg

First time I installed ndiswrapper last year, I followed ALL instuctions and it worked for me. Later I came over wireless-howto in gentoo using baselayout and I followed instructions, but I had problems with getting an IP adress. Reemerging ndiswrapper solved problem. Now I don't use baselayout (I haven't added net.wlan0 to default level) and it still works. Maybe you need to

```
ifconfig wlan0 up
```

anyway...

----------

## adi-beg

By the way, I visited a friend a month ago. He has wireless router with another essid. At that time I still used net.wlan0. I only needed to comment line in my /etc/conf.d/net with my essid and add line with his essid, reboot and it worked. I could use his wireless network from start.

----------

## jakubc

hi,

Minot please post all of your uncommented lines from /etc/conf.d/net and /etc/conf.d/wireless.  Also please post what settings you want to acheive (sp), i.e. the config of the AP you are trying to connect to.

adi-beg you might want to try looking at this post... looks like the same problem... still not solved, but I'm hoping:-))

sry. for the long answer times, but I am in the CET timezone... so I have to sleep:-))

----------

## Minot

Ok, let me bring everyone up to speed on my problem.  I purchased the $499 Toshiba Satellite M35X-S109 laptop from Best Buy last Black Friday.  I haven't had much time until recently to really start working with it.  I dumped Windows XP, added 512 MB (now at 768 MB) and added a Netgear MA521 802.11b wireless card.

I installed Gentoo from stage I and it has been working very well.  I have not put much effort into customizing the laptop yet.  My first priority was to get the WLAN working so I could use it as a portable should be... anywhere I want to in the house.  I did install Xfce4 and Firefox, so I have a basic graphical interface on the computer.  Without an xorg.conf file it works great... with it, I have problems.  That's a topic for a whole other thread.  Getting back to WLAN.

I emerged the following up to this point: ndiswrapper, baselayout and wireless-tools.  My LAN card is working great with the ndiswrapper.  My problem is the card will not configure properly during boot-up.  It appears to get all of the proper info from /etc/conf.d/net (the ifconfig parts) but nothing from /etc/conf.d/wireless (the iwconfig parts).  I emerged and then removed wpa_supplicant.  This should not be a factor, but I wanted to mention it.

Upon boot-up, ifconfig gives the following output:

```
lo        Link encap:Local Loopback  

          inet addr:127.0.0.1  Mask:255.0.0.0

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:2 errors:0 dropped:0 overruns:0 frame:0

          TX packets:2 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0 

          RX bytes:100 (100.0 b)  TX bytes:100 (100.0 b)

wlan0     Link encap:Ethernet  HWaddr 00:09:5B:BC:25:F3  

          inet addr:192.168.1.127  Bcast:192.168.1.255  Mask:255.255.255.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

          Memory:30800000-308000ff
```

Upon boot-up, iwconfig give the following output:

```
lo        no wireless extensions.

eth0      no wireless extensions.

wlan0     IEEE 802.11b  ESSID:off/any  

          Mode:Auto  Frequency:2.412 GHz  Access Point: 00:00:00:00:00:00   

          Bit Rate:11 Mb/s   Tx-Power:20 dBm   Sensitivity=0/3  

          RTS thr:2432 B   Fragment thr:2432 B   

          Encryption key:off

          Power Management:off

          Link Quality:100/100  Signal level:-95 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
```

So basically, my hardware is properly identified and the static IP address of my wireless lan card (wlan0) is set.  Unfortunately, it appears nothing is being set from the iwconfig.  Note there is no essid, no key, no access point MAC address.  Here is my /etc/conf.d/net:

```
# /etc/conf.d/net:

iface_eth0="192.168.1.128 broadcast 192.168.1.255 netmask 255.255.255.0"

iface_wlan0="192.168.1.127 broadcast 192.168.1.255 netmask 255.255.255.0"

# For setting the default gateway

#

gateway="eth0/192.168.1.1"

gateway="wlan0/192.168.1.1"

# Wireless Configuration (wlan0)

modules_wlan0=( "iwconfig" "!wpa_supplicant" )
```

My /etc/conf.d/wireless file is as follows:

```
# /etc/conf.d/wireless:

mode_wlan0="managed"

channel_wlan0="1"

essid_wlan0="minot"

key_minot="ABCD-1234-ABCD-1234-ABCD-1234-AB enc restricted"

preferred_aps=( "minot" )

blacklist_aps=( "myneighbor" )
```

In order to get my LAN working after boot-up, I need to command one line as root:

```
#iwconfig wlan0 essid minot key ABCD1234ABCD1234ABCD1234AB enc restricted
```

And volia!  The wireless lan works without any problems.  Here is my iwconfig after I run this command.

```
lo        no wireless extensions.

eth0      no wireless extensions.

wlan0     IEEE 802.11b  ESSID:"minot"  

          Mode:Managed  Frequency:2.412 GHz  Access Point: 00:06:25:E7:38:89   

          Bit Rate:11 Mb/s   Tx-Power:20 dBm   Sensitivity=0/3  

          RTS thr:2432 B   Fragment thr:2432 B   

          Encryption key:ABCD-1234-ABCD-1234-ABCD-1234-AB   Security mode:restricted

          Power Management:off

          Link Quality:100/100  Signal level:-55 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 added the same command into /etc/conf.d/local.start and the system boots up and the wlan is up and running no problems.  Unfortunately, this would play havoc with any other daemons (such as ntp) which reley upon the network working.

Anyway, that is where I sit.  I haven't had much time to work on this the past few days.  I can get the wlan working without too much hassel, but I know it is not working as it should.  The configuration in /etc/conf.d/wireless should be read and executed, but it is not.

What do you recommend I try next?  Thanks again for your help!

-MINOT-

----------

## UberLord

As you've been very polite and I'm in a good mood, I've redone your configs for you  :Smile: 

If it works, you may kiss my feet, send whisky or just say "Thanks Mr UberLord Sir!"

```
# /etc/conf.d/net:

modules_wlan0=( "iwconfig" )

config_eth0=( "192.168.1.128 broadcast 192.168.1.255 netmask 255.255.255.0" )

# or a bit shorter if you prefer

# config_eth0=( "192.168.1.128/24 broadcast 192.168.1.255" )

routes_eth0=( "default via 192.168.1.1" )

config_wlan0=( "192.168.1.127 broadcast 192.168.1.255 netmask 255.255.255.0" )

# or a bit shorter if you prefer

# config_wlan0=( "192.168.1.127/24 broadcast 192.168.1.255" )

routes_wlan0=( "default via 192.168.1.1" )

# The last interface up will control the default route

```

```
# /etc/conf.d/wireless:

key_minot="ABCD-1234-ABCD-1234-ABCD-1234-AB enc restricted"

preferred_aps=( "minot" )

```

Now, if your card supports scanning, add this to conf.d/wireless

```
blacklist_aps=( "myneighbor" )
```

otherwise

```
associate_order="forcepreferred"
```

Hopefully that now has you working.

If not, disable wep, mac filtering, enable ssid broadcasting on the AP and remove wep config and try again.

If still not, please add RC_VERBOSE="yes" to conf.d/net and post the output of the script starting and the output of "iwlist wlan0 scan"

----------

## Minot

UberLord and everyone else, thank you for your excellent help.  I put in UberLord's updates verbatim including the force prefered APs in the wireless config.

Unfortunately, it did not work.  In fact, I get the following error during boot-up:

```
Please make sure that /etc/conf.d/net has $ifconfig_wlan0 set (or $iface_wlan0 for old style configuration).

ERROR: Problem starting needed services.

"netmount" was not started.
```

My novice experience tells me that the system is not recognizing the command "config_wlan0".  Am I missing a larger piece (possibly an ebuild) which is preventing me from getting this working?

Also, not sure if it matters, but when I run ifconfig as root, I only get data for "lo" and "wlan0" is not listed.  This makes sense since the wlan0 is not configured.  Before I go back to my original /etc/conf.d/net I wanted to get your advice (and that of the community).  Why won't this new /etc/conf.d/net work?

Thank you all for your help.  It is much appreciated (not to mention I am learning tons)!

-MINOT-

----------

## UberLord

 *Minot wrote:*   

> UberLord and everyone else, thank you for your excellent help.  I put in UberLord's updates verbatim including the force prefered APs in the wireless config.
> 
> Unfortunately, it did not work.  In fact, I get the following error during boot-up:
> 
> ```
> ...

 

You're missing one or two very vital parts

1) baselayout is lower than 1.11.x (ideally needs to be 1.11.12-r4 or newer)

EDIT: you just need the stable version now - emerge sync && emerge -uaDv world and you'll get it  :Smile: 

2) net.wlan0 is not a symbolic link to net.lo

----------

## adi-beg

Hi again.

What about putting

```
iwconfig wlan0 essid minot key ABCD1234ABCD1234ABCD1234AB enc restricted
```

 into /etc/conf.d/net some place before 

```
ifconfig wlan0 up
```

I have something like that in my /etc/conf.d/net...

By the way, I haven't /etc/conf.d/wireless.

----------

## jakubc

adi-beg you must install the masked baselayout... do that according to the HOWTO I posted a while ago in this thread and you will have /etc/conf.d/wireless, where you can put all of these settings...

----------

## UberLord

 *jakubc wrote:*   

> adi-beg you must install the masked baselayout... 

 

It's no longer masked - emerge sync and emerge --oneshot baselayout should do it  :Smile: 

----------

## jakubc

wow! so it finaly got what was it's right? congradz!  :Smile: )

----------

## Minot

Ok, I had installed the masked baselayout ebuild.  I will remove the package keywords (which let me install the masked packages) and emerge sync / emerge baselayout.  

I think the symlink is my problem.  I made the symbolic link for net.wlan0 to net.eth0 based on this thread: https://forums.gentoo.org/viewtopic-t-341999-highlight-.html.  Now that I read the thread again, I see what I did.  It did say net.lo not net.eth0.  Doh!  So this is wrong and I need to change the symlink?

Let me try this and get back with you all.

Thanks for your help!

-MINOT-

----------

## adi-beg

I do have last baselayout installed on my system, but I still don't have /etc/conf.d/wireless... But everything is working  :Smile: 

----------

## jakubc

when did you last emerge baselayout? 

your configuration is working, because of the command you put in... it sets up your wlan card, and then baselayout treats it like a normal card with net access, which works once you set it up... this is what /etc/conf.d/wireless is for... but hey if it works this way, then that's ok (if it ain't broke don't fix it:-) )... the kosher thing to do would be to emerge baselayour 1.11.12-r4 and put the config into /etc/conf.d/wireless...

you decide, either way you have a working setup:-)

----------

## Minot

Ok, I did it now.  I created more trouble for myself.  Here is what I did when I went to create the symlink:

```
 ln -sf net.wlan0 net.lo
```

It should have been:

```
ln -sf net.lo net.wlan0
```

So I effectively deleted net.lo and replaced it with the symlink to net.wlan0 (which does not exist).  I tried re-emerging wireless-tools and baselayout but they fail because there is no file for net.eth0 (also tied to net.lo).

How can I reinstall /etc/init.d/net.lo?  Is there a simple ebuild I can install or do I need to reinstall stage II (or worse)?

-MINOT-

----------

## Minot

Well, I tried copying the exisitng net.eth0 and naming it net.lo.  That made it worse.  Now when I run ifconfig I get NO output.  It failed to bring up net.lo as well as net.wlan0.  eth0 is not set to come up by default.

Do I need to re-bootstrap using the LiveCD?  I don't have any networks working on the laptop now.

-MINOT-

----------

## jakubc

hi,

try to unlink it (net.lo) from anything, then emerge baselayout... that should rewrite it I think... if it doesn't then I can post it for you... but I think it should...

if it doesn't work post the "ln -l net*" so we can see what your links are...

----------

## Minot

Jakubc,

You are a lifesaver!  Ok, I found a way to get it back on the internet.  I deleted all of the symlinks for net.eth0 and net.wlan0.  I deleted net.lo and re-emerged baselayout.  I added the correct symlinks this tima and it worked!

Not only did it work, it configured my wlan0 card!!!

It detected the proper essid, key and set everthing up... except...

It said the default gateway was set at 192.168.1.1, but after I logged in nothing would ping on the internet.  I could successfully ping the machine's IP and the loopback IP.  I could not ping the router/gateway (192.168.1.1) or anything past it on the internet.

When I ran route, it gave me no output and won't end until I CTRL-Z.  If I command 

```
route add default gw 192.168.1.1
```

I get the following error, "SIOCADDRT: File exists" but from then on it works.  Route gives me the following output:

```
Kernel IP Routing Table

Destination       Gateway       Genmask        Flags Metric Ref     Use  Iface

192.168.1.0      *                  255.255.255.0 U      0        0        0     wlan0

loopback          localhost       255.0.0.0         UG   0        0        0     lo

default             192.168.1.1   0.0.0.0            UG   0        0        0     wlan0
```

What would make the default gateway not set route properly?

-MINOT-

----------

## jakubc

happy to hear it worked!

well the route is something out of my depth...  :Sad: 

assuming that your config looks like what UberLord wrote, then you are setting the default gateway twice... shouldn't be a problem (I think)... try to comment out the route for your other card in /etc/conf.d/net.  See if this works...

btw. you don't have some sort of dhcp server running on your AP?

----------

## Minot

No DHCP.  I'm assigning static IPs in my home LAN.

I will try commenting out the eth0 route statement in /etc/conf.d/net and see what happens.  I'm interested to hear what UberLord recommends.  The syntax he recommended and I'm now using is a bit different from the examples in the /etc/conf.d/net file.

-MINOT-

----------

## UberLord

 *Minot wrote:*   

> No DHCP.  I'm assigning static IPs in my home LAN.

 

Running any security? MAC filtering? WEP?

 *Quote:*   

> I will try commenting out the eth0 route statement in /etc/conf.d/net and see what happens.  I'm interested to hear what UberLord recommends.  The syntax he recommended and I'm now using is a bit different from the examples in the /etc/conf.d/net file.

 

I doubt that - I wrote the example and the code and the manual

----------

## UberLord

 *jakubc wrote:*   

> assuming that your config looks like what UberLord wrote, then you are setting the default gateway twice... shouldn't be a problem

 

Yes, it's set twice - but there is a reason.

In the old config, you had the gateway var

```
gateway="eth0/192.168.0.1"
```

Which was great - but eth0 had to be up. Bummer when you have two interfaces going to the same gateway but only one may be up at the time!

This way,it doesn't matter which. Well, actually it does as the last one up takes precedence.

baselayout-1.12.0-alpha3 (or 4) will solve this by using route metrics per interface (which we calculate for you) so whichever interface is up, it should Just Work (tm)

----------

## jakubc

i thought so, it was a shot in the dark... I knew you wouldn't write anything stupid UberLord, you're the one who makes these scripts... so fat chance of that... (btw. this isn't kissing up, this is clearifying  :Smile:  ).  

The question is why would "route" act like that? and puting the gateway in manually suddenly starts things up again... I don't know how the script does it, but I presume it doesn't do it any differently...

[edit] spelling

----------

## Minot

 *UberLord wrote:*   

> Running any security? MAC filtering? WEP?

 

Wlan0 is using WEP encryption, but that seems to be working great.  Iwconfig is showing my wlan0 up and properly connected to the AP (essid and key are good).  Data isn't getting from the laptop to the AP (which is the default gateway).

I am not using any security (firewall) or MAC filtering.

What is the difference between these:

```
routes_eth0=( "default via 192.168.0.1" )
```

versus 

```
routes_eth0=( "default gw 192.168.0.1" )
```

I pulled this example right out of your Network guide.

-MINOT-

----------

## Minot

 *UberLord wrote:*   

> I doubt that - I wrote the example and the code and the manual

 

You're right.  What I meant was the /etc/conf.d/net file I originally installed (long before baselayout 1.11) had iface examples and other things".  From what I understand the examples are the old config syntax.  Your new network guide is great!  Why is it sitting under your dev working tree and not in the formal docs area?

-MINOT-

----------

## UberLord

 *Minot wrote:*   

>  *UberLord wrote:*   Running any security? MAC filtering? WEP? 
> 
> Wlan0 is using WEP encryption, but that seems to be working great.  Iwconfig is showing my wlan0 up and properly connected to the AP (essid and key are good).  Data isn't getting from the laptop to the AP (which is the default gateway).

 

Simple. Wireless is not working (ie you cannot ping) but you claim that WEP is working. How exactly do you know this if you cannot ping? Disable WEP and see if it starts working - if so then the problem is with WEP.

 *Quote:*   

> 
> 
> What is the difference between these:
> 
> ```
> ...

 

Syntax - first one works with iproute2 (ip), second with net-tools (route). Baselayout supports them both transparently.

This is needed as we're aiming to make iproute2 the default in baselayout-1.12.x

----------

## UberLord

 *Minot wrote:*   

> Your new network guide is great!  Why is it sitting under your dev working tree and not in the formal docs area?

 

It was moved into the handbook a few hours after we went stable.

My dev space will contain the latest guide that pertains to whatever is latest in portage - the handbook is only for STABLE packages.

----------

## Minot

 *UberLord wrote:*   

>  *Minot wrote:*    *UberLord wrote:*   Running any security? MAC filtering? WEP? 
> 
> Wlan0 is using WEP encryption, but that seems to be working great.  Iwconfig is showing my wlan0 up and properly connected to the AP (essid and key are good).  Data isn't getting from the laptop to the AP (which is the default gateway). 
> 
> Simple. Wireless is not working (ie you cannot ping) but you claim that WEP is working. How exactly do you know this if you cannot ping? Disable WEP and see if it starts working - if so then the problem is with WEP.

 

I've been out of town a few weeks for business.  I thought I'd let this problem sit a little while and come back to it.  Here I am.

The good news is it is the WEP.  I disabled it and the network worked like a charm.  That leads me to ask two questions.

1) Why wasn't WEP working?

2) With WEP disabled, I have a major security problem.  Is there an alternative I can use to provide security (i.e. WPA -- not that I'm familar with this, but it is an option on the wireless router).  I went ahead and limited access to certain MAC addresses that I enter.  I only have three wireless cards that will ever access the network.  Is this an acceptable level of security for a home LAN?

What do you think?  Thanks for your help.

-MINOT-

----------

## UberLord

 *Minot wrote:*   

> The good news is it is the WEP.  I disabled it and the network worked like a charm.

 

Cool.

The problem is probably the keys either side. Notes about WEP

1) Each side has 4 keys - although only 1 is ever active. Each active key has to match both in index and content.

So if the AP's active key index is 2 and the key content is "FooBar", the client's active key index also has to be 2 and the key content is "FooBar"

2) Passphrase/passkey is not supported. This is an issue with wireless-tools - but mainly because not all AP's use passphrase the same way.

Instead, manual enter the content of all the keys.

 *Quote:*   

> Is this an acceptable level of security for a home LAN?

 

It's no worse than WEP. Probably easier to spoof a MAC address then cracking the keys,but both stop the casual wifi freeloader.

If you can get WPA working then good - but be warned it only supports a few cards AND has a seperate configuration.

----------

## mijenix

Hi

Does anyone know why i get the error message when I use wpa_supplicant?

-> https://forums.gentoo.org/viewtopic-t-353488.html

And I have baselyout 1.11.12-r4.

Thx!

--Mathias

----------

## Minot

 *UberLord wrote:*   

> The problem is probably the keys either side. Notes about WEP
> 
> 1) Each side has 4 keys - although only 1 is ever active. Each active key has to match both in index and content.
> 
> So if the AP's active key index is 2 and the key content is "FooBar", the client's active key index also has to be 2 and the key content is "FooBar"

 

I need to do some reading on WEP.  I was using 128-bit encryption using a Linksys BEFW11S4 Wireless Router.  The options on the router did not have four keys at this encryption level.  However, when I tried 64-bit encryption I see what you mean.  Then I have an option of using one of four keys.  Anyway, I'm sure there was something that prevented the Linksys Router from synchronizing with the laptop's card.  Is there a way to force the router and the laptop's wireless card to always use the same active key index?

 *UberLord wrote:*   

> 2) Passphrase/passkey is not supported. This is an issue with wireless-tools - but mainly because not all AP's use passphrase the same way.
> 
> Instead, manual enter the content of all the keys.

 

I don't think this applies with WEP turned-off.

 *Minot wrote:*   

> Is this an acceptable level of security for a home LAN?

 

 *UberLord wrote:*   

> It's no worse than WEP. Probably easier to spoof a MAC address then cracking the keys,but both stop the casual wifi freeloader.
> 
> If you can get WPA working then good - but be warned it only supports a few cards AND has a seperate configuration.

 

Great!  That is what I thought.  A dedicated hacker will break WEP.  I just want to be able to limit access to my home AP to my systems and I need something that will work on both Linux and Windows XP (work laptop).

Thanks for your help!

-MINOT-

----------

## UberLord

 *Minot wrote:*   

> Is there a way to force the router and the laptop's wireless card to always use the same active key index?

 

Here's howto get iwconfig to use a specific key

```
key_Uber_NET="[2] s:uberkey key [2] enc open"
```

The first [2] says here's the key for index 2 and the key [2] bit says use key index [2]

You'll have to consult your router docs for setting its key index!

----------

