# can't get wlan to work as hostap with baselayout2 [solved]

## javeree

The network setup I want to make is

ppp0 for access to internet (using dhcp)

eth0 for wired access from other PCs (192.168.0.1/24)

wlan0 working as an access point for other PCs (192.168.9.1/24)

With the new baselayout, I got ppp0 and eth0 working as desired, but wlan and hostapd fail.

I suspect something is wrong in the /etc/conf.d/net file, but could not find a solution.

```

# /etc/conf.d/net

# ppp0 related entries have been removed

# userid and password related entries adapted

modules="iproute2"

modules_wlan=" \

        !iwconfig \

        !wpa_supplicant \

        !plug \

        !netplug \

        "

config_wlan="192.168.9.1 netmask 255.255.255.0"

        "

config_lan="192.168.0.1 netmask 255.255.255.0"

dhcp_lan="release"

postdown() {

        # Enable Wake-On-LAN for the lan interface

        # Probably a good idea to set RC_DOWN_INTERFACE="no" in /etc/conf.d/rc

        # as well ;)

        einfo "Calling postdown for ${IFACE}"

        [[ ${IFACE} != "lo" ]] && ethtool -s "${IFACE}" wol pumbg

        # Return 0 always

        return 0

}

essid_wlan="MYSSID"

mode_wlan="Master"

channel_wlan="3"

key_Vereecke="s:MYSSIDPWD"

```

 *Quote:*   

> /etc/init.d/net.wlan --verbose start 
> 
>  * Bringing up interface wlan
> 
>  *   Loaded modules: apipa arping bonding br2684ctl tuntap bridge ccwgroup clip ethtool macchanger macnet netplugd wpa_supplicant ssidnet iproute2 pppd system vlan dhcpcd ip6to4
> ...

 

In the above, what amazes me is that this seems to try to call wpa_supplicant, and tries to plug, even though I've excluded these from the config.

 *Quote:*   

> iwconfig
> 
> wlan      IEEE 802.11bg  ESSID:"VereeckeRouter"
> 
>           Mode:Managed  Access Point: Not-Associated   Tx-Power=20 dBm
> ...

 

```

#/etc/hostapd/hostapd.conf

interface=wlan

driver=nl80211

logger_syslog=-1

logger_syslog_level=2

logger_stdout=-1

logger_stdout_level=2

dump_file=/tmp/hostapd.dump

ctrl_interface=/var/run/hostapd

ctrl_interface_group=0

ssid=MYSSID

hw_mode=g

channel=3

beacon_int=100

dtim_period=2

max_num_sta=255

rts_threshold=2347

fragm_threshold=2346

macaddr_acl=0

auth_algs=1

ignore_broadcast_ssid=0

wme_enabled=1

wme_ac_bk_cwmin=4

wme_ac_bk_cwmax=10

wme_ac_bk_aifs=7

wme_ac_bk_txop_limit=0

wme_ac_bk_acm=0

wme_ac_be_aifs=3

wme_ac_be_cwmin=4

wme_ac_be_cwmax=10

wme_ac_be_txop_limit=0

wme_ac_be_acm=0

wme_ac_vi_aifs=2

wme_ac_vi_cwmin=3

wme_ac_vi_cwmax=4

wme_ac_vi_txop_limit=94

wme_ac_vi_acm=0

wme_ac_vo_aifs=2

wme_ac_vo_cwmin=2

wme_ac_vo_cwmax=3

wme_ac_vo_txop_limit=47

wme_ac_vo_acm=0

eapol_key_index_workaround=0

eap_server=0

own_ip_addr=192.168.9.1

wpa=3

wpa_passphrase=MYSSIDPWD

wpa_key_mgmt=WPA-PSK

wpa_pairwise=TKIP

rsn_pairwise=CCMP
```

 *Quote:*   

> /etc/init.d/hostapd --verbose start 
> 
>  * WARNING: hostapd is scheduled to start when net.wlan has started

 

I guess this is just a consequence of wlan not starting correctly

Can someone help me find the problem with my config ?

I've also seen there is a new configuration file for the network since baselayout2, called /etc/{init,conf}.d/network. I have not find documentation yet on how to move net.xxxx configuration to network.

P.S. the 'equivalent' configuration in baselayout 1 did work.Last edited by javeree on Wed Apr 27, 2011 7:39 am; edited 1 time in total

----------

## javeree

Today, I rewrote my /etc/conf.d/net, and replaced 

 *Quote:*   

> modules_wlan=" \
> 
>         !iwconfig \
> 
>         !wpa_supplicant \
> ...

 

with 

 *Quote:*   

> modules_wlan="!iwconfig !wpa_supplicant" 

 

after this, wlan was correctly assigned a static IP address and hostapd ran correctly.

I am not sure if it as a spacing issue or somethign with the 'plug' statements I left out, and it was too late to test.

Just to let you know it is solved

----------

## jacques.bernardes

Hi Folks

The most important thing is include the following linis in your /etc/conf.d/net file

 *Quote:*   

> mode_wlan0="master"
> 
> essid_wlan0="YourESSID"
> 
> channel_wlan0="01"

 

Regards

Jacques

----------

## donjames

 *jacques.bernardes wrote:*   

> Hi Folks
> 
> The most important thing is include the following linis in your /etc/conf.d/net file
> 
>  *Quote:*   mode_wlan0="master"
> ...

 

Hi Jacques,

I have been trying for 3 days to configure my Gentoo Linux computer to be a wireless access point.  When I added the three lines to /etc/conf/net, that you recommended, it starting working!

Thanks very much for your input.

Sincerely,

Don James

Henderson, Texas, USA

----------

## donjames

 *jacques.bernardes wrote:*   

> Hi Folks
> 
> The most important thing is include the following linis in your /etc/conf.d/net file
> 
>  *Quote:*   mode_wlan0="master"
> ...

 

Hi Jacques,

I got my wireless access point to work after entering the 3 lines that you recommended.

Thanks,

Don James

----------

