OpenWrt Forum Archive

Topic: Fonera: setting up AP and STD

The content of this topic has been archived between 20 Apr 2018 and 28 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

No...but for this you should ask a mac user who knows how you configure a second or more ip to an interface.

I'm a Gentoo Linux User big_smile

hBut have you try it now with the bridges ???

regards
j0inty.sL

it is the same command in os x as it is in linux

for example

sudo ifconfig en0 add 192.168.4.2 netmask 255.255.255.0

to add the address 192.168.4.2 with the subnetmask 255.255.255.0 to the interface en0

now, i config all like this:

Trew:
TrewPC (MacOSX):
ifconfig en0 add 77.113.158.101 netmask 255.255.255.248          # to the provider
ifconfig en0 add 192.168.1.1 netmask 255.255.255.0            # to the fonera

TrewFoneraAP:
config interface loopback
        option ifname   lo
        option proto    static
        option ipaddr   127.0.0.1
        option netmask  255.0.0.0

config interface lan
        option ifname   eth0
        option type     bridge
        option proto    static
        option ipaddr   192.168.1.2
        option netmask  255.255.255.0

config wifi-device  wifi0                                                       
        option type     atheros                                                 
        option channel  11                                                     
                                                                               
config wifi-iface                                                               
        option device   wifi0                                                   
        option network  lan                                                     
        option mode     ap                                                     
        option ssid     myssid                                                   
        option encryption none                         


Jack:
JackPC (Winzozz):
added an ip 77.113.158.201 with subnet 255.255.255.248            to the provider
added an ip 192.168.1.3 with subnet 255.255.255.0               # to the fonera

JackFoneraSTA:
config interface loopback
        option ifname   lo
        option proto    static
        option ipaddr   127.0.0.1
        option netmask  255.0.0.0

config interface lan
        option ifname   eth0
        option type     bridge
        option proto    static
        option ipaddr   192.168.1.4
        option netmask  255.255.255.0

config wifi-device  wifi0                                                       
        option type     atheros                                                 
        option channel  11                                                     
                                                                               
config wifi-iface                                                               
        option device   wifi0                                                   
        option network  lan                                                     
        option mode     sta                                                     
        option ssid     myssid                                                   
        option encryption none   


but, TrewFonera not able to ping JackFonera, they not connect..! (inside openwrt, i cannot ping other fonera)

have i to set any route? (gateway..)
and the wan (ath0) interface?

(Last edited by Trew on 12 Dec 2007, 15:34)

Hi,

Today I have tested my bridge with the this configuration and a MAC G4 IBook wink. Works wunderfull and with wpa2 encryption.

But back to the Topic.

If you make an "ifconfig -a" on your fonera you will now see a devive called "br-lan" with the IP that you have setted for it. Now go on Trew's fonera and edit the /etc/hostapd.conf with this:

interface=ath0
bridge=br-lan
driver=madwifi

Check is hostapd running and enable it if needed. Try to connect with a Client, too. Check your "dmesg" on all fonera  for the following lines.

device eth0 entered promiscuous mode
br-lan: port 1(eth0) entering learning state
br-lan: topology change detected, propagating
br-lan: port 1(eth0) entering forwarding state
[...]
device ath0 entered promiscuous mode
br-lan: port 2(ath0) entering learning state
br-lan: topology change detected, propagating
br-lan: port 2(ath0) entering forwarding state

regards
j0inty

PS: Have you turn off the firewall on the fonera. Try this if it already not running.
/etc/init.d/firewall stop

Hi,

have you tested it now and works everything fine ???

Please let it me know, because I want to make a similar thing by a friend in the beginning of next year.

regards
j0inty.sL

j0inty wrote:

If you make an "ifconfig -a" on your fonera you will now see a devive called "br-lan" with the IP that you have setted for it

yes, here:

br-lan    Link encap:Ethernet  HWaddr 00:18:84:28:3E:D0  
          inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:894 errors:0 dropped:0 overruns:0 frame:0
          TX packets:370 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:90258 (88.1 KiB)  TX bytes:47355 (46.2 KiB)

Now go on Trew's fonera and edit the /etc/hostapd.conf with this:
interface=ath0
bridge=br-lan
driver=madwifi

i must create that file (hostapd.conf), because it doesn't exist yet..!

Check is hostapd running and enable it if needed

how i have to do?
i think that if i don't running this configuration file, the networking not run.

Check your "dmesg" on all fonera  for the following lines:
device eth0 entered promiscuous mode
br-lan: port 1(eth0) entering learning state
br-lan: topology change detected, propagating
br-lan: port 1(eth0) entering forwarding state
[...]
device ath0 entered promiscuous mode
br-lan: port 2(ath0) entering learning state
br-lan: topology change detected, propagating
br-lan: port 2(ath0) entering forwarding state

ok, i found all these string, in my dmesg command!

PS: Have you turn off the firewall on the fonera. Try this if it already not running.
/etc/init.d/firewall stop

yes, i will stop it before every my test..!

how i have to do?
i think that if i don't running this configuration file, the networking not run.

Hi,

it seems that don't have hostapd installed. With the ipkg command you can install it.

### On Trews fonera ###
ipkg list_installed
ipkg install hostapd

I would delete the other hostapd.conf that you have create by your self, befor install the hostapd package.

regards
j0inty.sL

PS: If you want to use wpa or wpa2 encryption the other Fonera (not Trew) need wpa_supplicant installed.

Hello!

I tried to set up my foneras as j0inty said. I have 2 foneras 1 configured for AP and 1 for STA.
The configurations:

root@FonAP:~# chmod -x /etc/init.d/firewall
root@FonAP:~# chmod -x /etc/init.d/dnsmasq
root@FonAP:~# reboot

root@FonAP:~# cat /etc/config/wireless
config wifi-device  wifi0
        option type     atheros
        option channel  5

        option mode 11bg
        option diversity 0
        option txantenna 1
        option rxantenna 1

config wifi-iface
        option device   wifi0
        option network  lan
        option mode     ap
        option ssid     LaFon
        option encryption none
        option hidden   0
        option bgscan   0

root@FonAP:~# cat /etc/config/network
config interface loopback
        option ifname   lo
        option proto    static
        option ipaddr   127.0.0.1
        option netmask  255.0.0.0

config interface lan
        option ifname   eth0
        option type     bridge
        option proto    static
        option ipaddr   192.168.108.3
        option netmask  255.255.255.0
        option gateway  192.168.108.254
        option dns      192.168.108.254



root@FonSTA:~# chmod -x /etc/init.d/dnsmasq
root@FonSTA:~# chmod -x /etc/init.d/firewall
root@FonSTA:~# reboot


root@FonSTA:~# cat /etc/config/network
config interface loopback
        option ifname   lo
        option proto    static
        option ipaddr   127.0.0.1
        option netmask  255.0.0.0

config interface lan
        option ifname   eth0
        option type     bridge
        option proto    static
        option ipaddr   192.168.108.2
        option netmask  255.255.255.0
        option gateway  192.168.108.254
        option dns      192.168.108.254

root@FonSTA:~# cat /etc/config/wireless
config wifi-device  wifi0
        option type     atheros
        option channel  5

        option mode 11bg
        option diversity 0
        option txantenna 1
        option rxantenna 1

config wifi-iface
        option device   wifi0
        option network  lan
        option mode     sta
        option ssid     LaFon
        option encryption none

This setup doesn't work for me. The hostapd is running on the FonAP, with this config file:

interface=ath0
bridge=br-lan
driver=madwifi

root@FonAP:~# ps | grep hostapd
  432 root        604 S   hostapd -B hostapd.conf


I can see the FonSTA is connected:

root@FonAP:~# wlanconfig ath0 list
ADDR               AID CHAN RATE RSSI  DBM  IDLE  TXSEQ  TXFRAG  RXSEQ  RXFRAG CAPS ACAPS ERP    STATE     MODE
00:18:84:1e:7b:d1    1    5  36M   37  -58   180     90       5   2457       0 ESs          0        7   Normal WME ATH

I cant ping.

root@FonSTA:~#  ping 192.168.108.3
PING 192.168.108.3 (192.168.108.3): 56 data bytes

--- 192.168.108.3 ping statistics ---
2 packets transmitted, 0 packets received, 100% packet loss

When check the ARP table the hw address is 00:00:00:00:00:00.

root@FonSTA:~# arp
IP address       HW type     Flags       HW address            Mask     Device
192.168.108.3    0x1         0x0         00:00:00:00:00:00     *        br-lan
192.168.108.210  0x1         0x2         00:E0:A6:78:5A:13     *        br-lan
192.168.108.254  0x1         0x0         00:00:00:00:00:00     *        br-lan


192.168.108.210 is my laptop connected to FonSTA on ethernet interface, 192.168.108.254 is a WRT-54GL which is the gateway to the internet.

When I tcpdump on the FonAP I don't see any packets conming from the FonSTA.

When I tcpdump on the FonSTA I can see there are arp packets coming from the FonAP.

01:07:26.738486 arp who-has 192.168.108.2 tell 192.168.108.3
01:07:26.738831 arp reply 192.168.108.2 is-at 00:18:84:1e:7b:d0 (oui Unknown)


As I can see the FonAP can send packets to the FonSTA, but the FonSTA can't send to the FonAP.
I can connect to the FonAP with my laptop via Wifi.

I tried the Routed client mode http://wiki.openwrt.org/ClientModeKamikazeStyleHowto and it works, but I would like to use in Bridged client mode


What is the problem ? Could you help me?

Thanks!

(Last edited by turrican on 14 Jan 2008, 20:10)

Hi,

Best thanks for this much informations, so I can try to better understand your configuration.

1. Lets sort your infos, because I don't understand something.

Your AP is possible to get via ARP the STA mac address ?? But the STA doesn't store this mac address correctly or none.

When I tcpdump on the FonSTA I can see there are arp packets coming from the FonAP.

01:07:26.738486 arp who-has 192.168.108.2 tell 192.168.108.3
01:07:26.738831 arp reply 192.168.108.2 is-at 00:18:84:1e:7b:d0 (oui Unknown)

But now the arp table show 00:00:00.... for the AP on STA

root@FonSTA:~# arp
IP address       HW type     Flags       HW address            Mask     Device
192.168.108.3    0x1         0x0         00:00:00:00:00:00     *        br-lan (wlan)
192.168.108.210  0x1         0x2         00:E0:A6:78:5A:13     *        br-lan (lan)
192.168.108.254  0x1         0x0         00:00:00:00:00:00     *        br-lan (wlan)

Hmmmm, sounds bad sad . You wrote that your AP is seeing that the STA in connected via wlan.

root@FonAP:~# wlanconfig ath0 list
ADDR               AID CHAN RATE RSSI  DBM  IDLE  TXSEQ  TXFRAG  RXSEQ  RXFRAG CAPS ACAPS ERP    STATE     MODE
00:18:84:1e:7b:d1    1    5  36M   37  -58   180     90       5   2457       0 ESs          0        7   Normal WME ATH

Does the hostapd running on the STA ???
It seems that something is blocking the traffic.
From&To the bridge interface sad. For ath0 it seems to work.
The arp request from AP will returned with a successfull arp reply from the STA.

Thats my /etc/hostapd.conf. I post that because every one  sends me three lines and that can't it be.

root@fonera:~# cat /etc/hostapd.conf | grep -vh '^[[:space:]]*\(#\|$\)' "$@"
interface=ath0
bridge=br-lan
driver=madwifi
logger_syslog=-1
logger_syslog_level=2
logger_stdout=-1
logger_stdout_level=2
debug=0
dump_file=/tmp/hostapd.dump
ssid=wpa-test
eapol_key_index_workaround=0
eap_server=0
own_ip_addr=127.0.0.1
wpa=1
wpa_passphrase=<wpa key>
wpa_key_mgmt=WPA-PSK WPA-EAP
wpa_pairwise=TKIP CCMP
root@fonera:~#

root@fonera:~# cat /etc/config/network | grep -vh '^[[:space:]]*\(#\|$\)' "$@"
config interface loopback
        option ifname   lo
        option proto    static
        option ipaddr   127.0.0.1
        option netmask  255.0.0.0
config interface lan
        option ifname   eth0
        option type     bridge
        option proto    static
        option ipaddr   192.168.0.60
        option netmask  255.255.255.0
        option gateway  192.168.0.1
root@fonera:~# cat /etc/config/wireless | grep -vh '^[[:space:]]*\(#\|$\)' "$@"
config wifi-device  wifi0
        option type     atheros
        option channel  1
        option mode     11bg
        option diversity 0
        option txantenna 1
        option rxantenna 1
        option disabled 0
config wifi-iface
        option device   wifi0
        option network  lan
        option mode     ap
        option ssid     <ssid>
        option hidden   0
        option bgscan   0
        option encryption psk2
        option key      <wpa_key>
        option macfilter allow  # or deny
        option maclist 00:0C:6F:AF:30:7F
root@fonera:~#

regards
j0inty

(Last edited by j0inty on 15 Jan 2008, 21:45)

@turrican and all other guys, who try to get bridged-client-mode working:

I guess the reason why you have troubles getting your wireless bridge in station mode running, is that it´s not really supported.
if you stick with the 801.11g specifications you have two options: use station-mode to connect the ap and your client-router and handle to connection to client behind the "wireless-bridge" through layer3 (ip-routing).
or you use a wds-link between the two routers and bridge it to the local networks. wds was build for this purpose and will work!
The problem is, that in a "normal" wifi-frame you can only specify one source and one destination mac-address.
but you would need the source and destination address of wifi-link and the addresses of the "real" source and destination machines behind the routers. in a wds-package you have this 4 adresses, in a "normal" package you have only two addressfields, so bridging in stationmode can´t work! (sorry I don´t now all technical terms but I hope you get it)

ok it  can work, but it can´t work without tricks. there are some approaches to make it work.
the wet-mode of the broadcom-driver, does some sort of arp masquerading to achieve this. (this mode should work in whiterussian, so give it a try if you really want to use it)
or you can have a look at this:
http://wiki.openwrt.org/WirelessBridgeWithWPAHowto
there is an implementation with  parprouted (a daemon for transparent IP (Layer 3) proxy ARP bridging) and a dhcp-forwarder cause the "brigding" with parprouted only works for ip packages, and so dhcp can´t be forwarded with it.

so maybe you get the wet-mode running, or something that works as a bridge for ip-packages, and be happy with it.

but I really would recommend to use wds to create a real wireless bridge, or use routed-client-mode.
so learn a little bit about WDS, or ip-routing, and you should be able to create a wireless bridge which will meet your requirements (without strange arp-, dhcp- or whatever-problems) and your configuration would be  801.11g-compliant!

Thanks for your answer!

j0inty:

The hostapd runs on the AP.
Unfortunately, my AP can't get the mac address of the STA. The STA receives the ARP request, and tries to send the reply back to the AP, but the AP doesn't receive.
If I connecting my laptop to the AP via ath0 everything works well, so I think the STA blocks the outgoing traffic.

eleon216:

I will try the WDS. The Routed client mode works, but that is not my goal.

Thank you!

(Last edited by turrican on 21 Jan 2008, 16:59)

The discussion might have continued from here.