# Wireless Setup (SOLVED)

## JC99

Ok, I want to setup wireless on my network. I emerged wireless-tools and wpa_supplicant but what do I do next? The output for iwconfig is...

 *Quote:*   

> penguin ~ # iwconfig
> 
> lo        no wireless extensions.
> 
> eth0      no wireless extensions.
> ...

 

eth0 and eth1 are my wired network cards, ppp0 is my pppoe and I don't know what sit0 is but it was there before I plugged in my wireless card.

I am guessing I should see something like wlan0. Do I need to include something in my kernel? I want to use WPA.Last edited by JC99 on Mon Jul 21, 2008 9:07 am; edited 3 times in total

----------

## poly_poly-man

What kind of card do you have?

Give output of lspci and lspci -n.

poly-p man

btw, in case you're curious, sit0 is an ipv6-to-ipv4 tunnel special device that can be ignored.

----------

## JC99

My card is a D-Link DWL-G520. According to this it works with Linux and uses the Atheros driver. But in my kernel config there is no option for Atheros that I can find.

 *Quote:*   

> penguin linux-2.6.24.7 # lspci
> 
> 00:00.0 Host bridge: VIA Technologies, Inc. VT8377 [KT400/KT600 AGP] Host Bridge (rev 80)
> 
> 00:01.0 PCI bridge: VIA Technologies, Inc. VT8237 PCI Bridge
> ...

 

 *Quote:*   

> penguin linux-2.6.24.7 # lspci -n
> 
> 00:00.0 0600: 1106:3189 (rev 80)
> 
> 00:01.0 0604: 1106:b198
> ...

 

----------

## poly_poly-man

http://gentoo-wiki.com/HOWTO_MadWifi_Install

poly-p man

----------

## JC99

ok, my kernel menu is a little different that is listed on the wiki article, is this correct?

 *Quote:*   

>  [*]Enable loadable module support
> 
>     [*] Module unloading
> 
>     [*] Automatic kernel module loading (optional)
> ...

 

I set up everything according to the wiki article for madwifi installed madwifi then ran modprobe ath_pci and nothing shows up. The kernel modules for atheros is not listed when I configure my kernel.

----------

## poly_poly-man

http://madwifi.org/wiki/UserDocs/KernelConfig

Do that, install madwifi, run depmod (probably not necessary), then modprobe it again.

Give dmesg output if it doesn't work.

poly-p man

----------

## JC99

ok, I configured my kernel but when I run "depmod" nothing happens, when I run modproble it just says...

 *Quote:*   

> penguin ~ # depmod
> 
> 

 

 *Quote:*   

> penguin ~ # modprobe
> 
> Usage: modprobe [-v] [-V] [-C config-file] [-n] [-i] [-q] [-b] [-o <modname>] [ --dump-modversions ] <modname> [parameters...]
> 
> modprobe -r [-n] [-i] [-v] <modulename> ...
> ...

 

...nothing happens. Is there something that I need to add after the depmod or modprobe command?

Here is my dmesg...

 *Quote:*   

> 000000007fff3000 (ACPI NVS)
> 
>  BIOS-e820: 000000007fff3000 - 0000000080000000 (ACPI data)
> 
>  BIOS-e820: 00000000fec00000 - 00000000fec01000 (reserved)
> ...

 

----------

## d2_racing

Hi, you need to run this command :

```

# modprobe ath_pci

# dmesg | tail

```

Also can you post this plz :

```

# ifconfig -a

```

----------

## d2_racing

Also, can you post theses commands :

```

# equery list madwifi

# cat /etc/conf.d/net

# cat /etc/wpa/wpa_supplicant.conf

```

----------

## JC99

 *Quote:*   

> penguin ~ # ifconfig -a
> 
> ath0      Link encap:Ethernet  HWaddr 00:19:5B:80:F2:D8
> 
>           BROADCAST MULTICAST  MTU:1500  Metric:1
> ...

 

Why do I have a wifi0 and ath0?

 *Quote:*   

> penguin ~ # dmesg | tail
> 
> wifi0: turboG rates: 6Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
> 
> wifi0: H/W encryption support: WEP AES AES_CCM TKIP
> ...

 

 *Quote:*   

> penguin ~ # modprobe ath_pci

 

 *Quote:*   

> penguin ~ # equery list madwifi
> 
> [ Searching for package 'madwifi' in all categories among: ]
> 
>  * installed packages
> ...

 

 *Quote:*   

> penguin ~ # cat /etc/conf.d/net
> 
> # This blank configuration will automatically use DHCP for any net.*
> 
> # scripts in /etc/init.d.  To create a more complete configuration,
> ...

 

 *Quote:*   

> penguin ~ # cat /etc/wpa_supplicant/wpa_supplicant.conf
> 
> # This is a network block that connects to any unsecured access point.
> 
> # We give it a low priority so any defined blocks are preferred.
> ...

 

 *Quote:*   

> penguin init.d # iwconfig
> 
> lo        no wireless extensions.
> 
> eth0      no wireless extensions.
> ...

 

----------

## JC99

Relevant part of "ifconfig -a"...

 *Quote:*   

> ath0      Link encap:Ethernet  HWaddr 00:19:5B:80:F2:D8
> 
>           inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
> 
>           inet6 addr: fe80::219:5bff:fe80:f2d8/64 Scope:Link
> ...

 

ok, so far this is what I have done but I don't know what else to do. I am setting up my Gentoo box as a wireless router so other computers in the house will connect to my linux server to share the internet. In /etc/conf.d/net I have the following...

```
config_ath0=( "192.168.1.1 netmask 255.255.255.0 broadcast 192.168.1.255" )

essid_ath0="MyNetwork"
```

Do I have to add anything for config_wifi0?

What do I put in my wpa_supplicant.conf file, right now I have ...

 *Quote:*   

> network={
> 
>         ssid=MyNetwork
> 
>         key_mgmt=NONE
> ...

 

I have a static ip 66.11.182.5

----------

## d2_racing

Ok first, since you have a working ath0, the wifi0 is something that need to be there in order to have a working madwifi driver.

So everything is cool.

Also, what encryption do you use for your router.

I'm not an expert, but if you want to use WPA2 has an encryption methode, you will need something like this inside /etc/wpa/wpa_supplicant

```

ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=wheel

ap_scan=0

#update_config=1

network={

   ssid="your_SSID"

   psk="your_passphrase"

   proto=WPA2

   key_mgmt=WPA-PSK

   pairwise=CCMP

   group=CCMP

   priority=5

}

```

And inside your /etc/conf.d/net

```

#WPA_SUPPLICANT

modules=( "wpa_supplicant" )

wpa_supplicant_ath00_="-Dwext"

config_ath0=( "dhcp" )

```

Mine is for a dhcp but I think that you can you that as a base to start a working config.

----------

## JC99

OK, unfortunately that didn't work because I still can't connect to my wireless network...

In my /etc/conf.d/net I have the following...

 *Quote:*   

> modules=( "wpa_supplicant" )
> 
> wpa_supplicant_ath00_="-Dwext"
> 
> config_ath0=( "192.168.1.1 netmask 255.255.255.0 broadcast 192.168.1.255" )
> ...

 

ok, here is what happens...

 *Quote:*   

> penguin init.d # /etc/init.d/net.ath0 start
> 
>  * Starting ath0
> 
>  *   Starting wpa_supplicant on ath0 ...                                                                                [ ok ]
> ...

 

Here is what I want to do....

 *Quote:*   

> Internet----Gentoo Server----My Computer

 

I am trying to configure the Gentoo Server. My computer doesn't show a wireless network to connect too.

..and is there anything I need to do with wifi0?

.. Is the problem because nothing shows up when I do...

 *Quote:*   

> modprobe ath_pci

 

----------

## d2_racing

After that :

```

# /etc/init.d/net.ath0 start 

```

Can you post that :

```

# iwconfig

# dmesg | tail

# ifconfig -a

# wpa_cli status

```

I REALLY need theses output to help you now.

----------

## JC99

Yeah, I did start it up...

For ssid and passphrase do I keep the "" and does the passphrase have to be a certain length?

Also, the box my network card came in says WPA so will WPA2 work?

Just for clarity sake I did "cp net.eth0 net.ath0"

What is the wifi0 used for?

Info you need....

 *Quote:*   

> penguin ~ # iwconfig
> 
> lo        no wireless extensions.
> 
> eth0      no wireless extensions.
> ...

 

 *Quote:*   

> penguin ~ # dmesg | tail
> 
> ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
> 
> ADDRCONF(NETDEV_UP): eth1: link is not ready
> ...

 

 *Quote:*   

> penguin ~ # ifconfig -a
> 
> ath0      Link encap:Ethernet  HWaddr 00:19:5B:80:F2:D8
> 
>           inet6 addr: fe80::219:5bff:fe80:f2d8/64 Scope:Link
> ...

 

 *Quote:*   

> penguin ~ # wpa_cli status
> 
> Selected interface 'ath0'
> 
> wpa_state=DISCONNECTED
> ...

 

----------

## poly_poly-man

wait, what are you trying to connect to?

does the access point you are trying to connect to use any sort of security?

poly-p man

----------

## JC99

 *poly_poly-man wrote:*   

> wait, what are you trying to connect to?
> 
> does the access point you are trying to connect to use any sort of security?
> 
> poly-p man

 

Here is what I am trying to do. 

Internet -- Gentoo Server -- My Computer running Windows

The gentoo server is connected to the internet via ADSL.

Basically I am trying to setup the Gentoo Server is an Access Point ( I think that is what it is called, I am new to wireless) so I can connect to it from my windows laptopLast edited by JC99 on Fri Jul 18, 2008 7:39 pm; edited 3 times in total

----------

## exif

 *exif wrote:*   

> Have a look at the official Gentoo Wireless Docs. More specifically the Ad-Hoc and Master Modes section. You may also need to setup wpa_supplicant to set the security settings. 
> 
> A quick Google search also brought up this article from linux.com about setting up a secure wireless AP.
> 
> I haven't done this myself, but this might get you a good starting point for finding a good resource on the topic.

 

From this forum post. He is also trying to do something similar to you.

----------

## JC99

 *exif wrote:*   

> From this forum post. He is also trying to do something similar to you.

 

yeah, I read that already, it didn't help me out. I am still confused as to what to do. Basically I need someone to walk me through step by step what to do.

----------

## exif

You might try going on IRC while you're setting it up. People are usually faster to reply and it's easier to step someone through something that way.

----------

## JC99

I tried IRC and it screwed up my system. The guy told be to follow this which linked to something else which I followed and told me to do this...

 *Quote:*   

> ifconfig ath0 down
> 
> wlanconfig ath0 destroy
> 
> wlanconfig ath0 create wlandev wifi0 wlanmode ap
> ...

 

But now when I try /etc/init.d/net.ath0 start I get the following...

 *Quote:*   

> penguin init.d # /etc/init.d/net.ath0 start
> 
>  * Starting ath0
> 
>  *   Starting wpa_supplicant on ath0 ...
> ...

 

It says...

 ioctl[SIOCSIWMODE]: Invalid argument

Could not configure driver to use managed mode 

How do I undo that?

Then the guy who helped left the channel so I think I will stick with the forums

UPDATE: I rebooted and everthing is fine now.Last edited by JC99 on Fri Jul 18, 2008 8:43 pm; edited 1 time in total

----------

## poly_poly-man

you did modify the mode to be "Master", right?

poly-p man

----------

## JC99

 *poly_poly-man wrote:*   

> you did modify the mode to be "Master", right?
> 
> poly-p man

 

No, how do I do that? I am total Newb when it comes to wireless. I need a step by step guide on what to do although I think my kernel is configured correctly.

----------

## d2_racing

I'm not sure about the ath0 driver, but with my iwl3945 driver, I do that :

```

# ifconfig wlan0 down

# iwconfig wlan0 mode master

```

So maybe it's

```

# ifconfig ath0 down

# iwconfig ath0 mode master

```

Since I see that there is no exemple with iwconfig, maybe you will need to use the wlanconfig instead command.

----------

## d2_racing

Sorry, to make your AP has master you need to run this :

```

ifconfig ath0 down

wlanconfig ath0 destroy

wlanconfig ath0 create wlandev wifi0 wlanmode ap

```

----------

## JC99

Thanks

I got my Gentoo server working as a Wireless Access Point without encryption. Now to learn how to enable WPA encryptiion.

I had to add the following to /etc/conf.d/net

mode_ath0="Master"

essid_ath0="MyNetwork"

config_ath0=( "192.168.1.1 netmask 255.255.255.0 broadcast 192.168.1.255" )

wpa_supplicant_ath0="-Dmadwifi"

Once I get it all setup I am going to write a wiki article so others can easily setup there box as a WAP. I know there is already an article but it says at the beginning "This page needs a bunch of work" so I am going to create an updated version.Last edited by JC99 on Sat Jul 19, 2008 9:30 pm; edited 1 time in total

----------

## d2_racing

Hi, if you can use WPA2 with AES(CCMP) algorithm, then use this. It's the most advance protection that can have with a personnal router.

Also, if you shoot that, just change the SSID and the passphrase from the config I posted earlier and everything will be fine.

Keep us inform of your progress.

----------

## JC99

ok, I have successfully setup my Gentoo server as a wireless access point (WAP) but with no security. I now want to add WPA. I have been following this guide.

I added this to my wpa_supplicant.conf

 *Quote:*   

> ctrl_interface=/var/run/wpa_supplicant
> 
> ctrl_interface_group=wheel
> 
> ap_scan=1
> ...

 

but when I look at the Wireless Network Connections window on my laptop running XP, it still says the network is unsecured. No WPA . 

--------------------------------------------------------------------------------------------------

I have 2 problems. The first...

 When I add...

 *Quote:*   

> modules=( "wpa_supplicant" ) 

 

...to my /etc/conf.d/net...

/etc/conf.d/net *Quote:*   

> config_eth0=( "66.11.182.5 netmask 255.255.255.0 broadcast 66.11.182.255" )
> 
> config_eth1=( "192.168.0.1 netmask 255.255.255.0 broadcast 192.168.0.255" )
> 
> mode_ath0="Master"
> ...

 

I get this error message when I run /etc/init.d/net.ath0 start...

 *Quote:*   

> penguin ~ # /etc/init.d/net.ath0 start
> 
>  * Starting ath0
> 
>  *   Starting wpa_supplicant on ath0 ...
> ...

 

I am configuring it to be a wireless access point. What do I do?

-------------------------------------------------------------------------------------------------

The second problem...

I have installed hostapd but when I run this command

 *Quote:*   

> hostapd -dd /etc/hostapd/hostapd.conf

 

I get this result which is not what is expected on the wiki guide...

 *Quote:*   

> penguin ~ # hostapd -dd /etc/hostapd/hostapd.conf
> 
> Configuration file: /etc/hostapd/hostapd.conf
> 
> ctrl_interface_group=0
> ...

 

I am using hostapd 0.5.10

----------

## JC99

ok, I got it all working, I modilfied my hostapd.conf file as follows....

 *Quote:*   

> interface=ath0
> 
> # In case of madwifi driver, an additional configuration parameter, bridge,
> 
> # must be used to notify hostapd if the interface is included in a bridge. This
> ...

 Last edited by JC99 on Sat Jul 19, 2008 9:28 pm; edited 3 times in total

----------

## JC99

ok, now that I have a wireless access point with WPA encryption using madwifi and hostapd I just need to setup ethernet bridging, but that isn't really a priority. I will write a wiki entry and post a link to it from here. Turns out creating a wireless access point doesn't use wpa_supplicant, that is for clients.

----------

## JC99

Here is how I did ethernet bridging.

Here is a Gentoo Wiki entry on how I did this.

----------

