# Wireless Configuration

## 0ptimiz3Prime

So I got my gentoo system up and running and I am trying to configure my wireless to work properly.  I have a Macbook pro 4.1 with a broadcom bcm4328 (got that from lspci, that's the wireless chipset right?).  So I googled that and there is so many different guides on getting wireless working, with all different kinds of drivers.  How do I know which one to follow and what drivers to use, what is the difference between all of them.  I got my wireless card to show up in ifconfig -a, but does not show up in just ifconfig, how do I go about actually connecting to a network?

----------

## DONAHUE

```
ifconfig <your interface name> up

ifconfig
```

does it show up now? what is its interface name?

```
echo "net-wireless/wpa_supplicant qt4" >> /etc/portage/package.use

emerge wireless-tools wpa_supplicant dhcpcd
```

get stuff to work with.

```
iwconfig
```

does the wireless show up?

```
iwlist scan
```

does the wireless scan and report contact with your router?

Have you emerged a desktop?

Do you plan to use dhcp or fixed ip? Seeing laptop, I will assume dhcp.

will assume your interface is named wlan0, if incorrect, substitute your actual interface name for wlan0 in anything you use from below:

edit /etc/wpa_supplicant/wpa_supplicant.conf to include: *Quote:*   

> ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel
> 
> update_config=1
> 
> ap_scan=1

 

If you do not have a desktop; add to wpa_supplicant.conf (using info gathered by iwlist scan and from setting up your router to fill in the blanks, pick a network example from the bottom of /etc/wpa_supplicant/wpa_supplicant.conf that best matches your network) a network entry. Mine is simply:

 *Quote:*   

> network={
> 
> 	ssid="myssid"
> 
> 	psk="abcdefgh"
> ...

 for a basic shared key wpa setup

edit /etc/conf.d/net to include:

 *Quote:*   

> modules_wlan0=( "wpa_supplicant" )
> 
> modules_wlan0=( "dhcpcd" ) 
> 
> wpa_supplicant_wlan0="-Dwext"
> ...

 where xxx.xxx.xxx.xxx could be your routers ip if it gives good dns, yyy.yyy.yyy.yyy could be your isp's dns server, 4.2.2.5 could be (and is) a public dns server; don't use the router if the laptop will be used away from your router lest it cause slow dns service

optional in that using this pair may speed dns service but they are not necessary to get service

```
cd /etc/init.d/

ln -s net.lo net.wlan0
```

 Make a symlink so starting wlan0 will run the gentoo network script.

```
rc-update add net.wlan0 default

/etc/init.d/wlan0 restart
```

set wlan0 to start at boot. actually not necessary if you are using dbus/hal/evdev/udev.

If you have a desktop find wpa_gui in the applications or start a terminal to run it. this will give you a simple gui interface to scan for, configure for, and connect to networks. It also allows saving configurations of networks you expect to revisit. If you did not make a network entry when editing wpa_supplicant.conf and you have connected via wpa_gui save the configuration.

```
reboot
```

Hopefuly just a check that all is working.Last edited by DONAHUE on Sun May 23, 2010 2:13 am; edited 2 times in total

----------

## 0ptimiz3Prime

Wow, thank you for the awesome reply.  So I got it to show up in ifconfig now as eth1, it's not a problem that it is not wlan0 right?  I emerged those packages.  When I run iwconfig scan I get a list of wireless networks, and I believe I put in the correct settings for the wpa_supplicant.conf file (note that I had to create this file as it wasn't there by default, is that a problem?),  also I am not sure what proto is so I just used RSN, I'm using a WPA btw and yes I am using dhcp.  When I get down to doing /etc/init.d.wlan0, /etc/init.d.eth1 in my case, the file doesn't exist so I see this exists -> /etc/init.d/net.eth1 (is this the same thing?) so I run the command and I get the module "wpa_supplicant dhcpd" does not exist, not sure why because I downloaded the packages.  Sorry for the somewhat fast paced response, I am at work right now.

----------

## DONAHUE

take dhcpcd out of the modules_eth1=( "wpa_supplicant" ) I got the syntax wrong and you don't need to specify dhcpcd if that is the only dhcp program installed, sorry

do check that no wlan0 crept in. No default empty wpa_supplicant sounds familiar.

 *Quote:*   

> /etc/init.d.wlan0

  should have been   *Quote:*   

> /etc/init.d/wlan0

  or in your case   *Quote:*   

> /etc/init.d/eth1

 Last edited by DONAHUE on Sun May 23, 2010 1:37 am; edited 1 time in total

----------

## d2_racing

Hi, can you post this :

```

# lspci -n

# cat /etc/udev/rules.d/70-persistent-net.rules

# ifconfig -a

# iwconfig

# iwlist scan

# dmesg | tail

```

----------

## 0ptimiz3Prime

Sweet it worked, thanks so much.  I just started with gentoo 3 days ago and the community so far has been awesome in answering my questions.

----------

