OpenWrt Forum Archive

Topic: Fonera as wi-fi bridge

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

Hello,

I've configured my fonera to connect to my wireless wpa network, and it works fine. Now I'd like to add another (virtual) interface and to use it as an ap, but I don't understand how to do that. Is it possible to do that or am I dreaming? wink

My working configuration is:
----------------
root@OpenWrt:~# cat /etc/config/network
# Copyright (C) 2006 OpenWrt.org

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

config interface waifai
        option ifname   ath0
        option type     bridge
        option proto    static
        option ipaddr   '192.168.0.10'
        option netmask  255.255.255.0
        option gateway  '192.168.0.1'
        option dns      '192.168.0.20'
----------------
root@OpenWrt:~# cat /etc/config/wireless
config wifi-device  wifi0
        option type     atheros
        option channel  ''
        option disabled '0'
        option diversity        '0'
        option txantenna        '0'
        option rxantenna        '0'
                                       
config wifi-iface
        option device   wifi0
        option network  waifai
        option mode     'sta'
        option ssid     'my_ssid'
        option hidden   0
        option encryption       'psk'
        option isolate  '0'         
        option txpower  '16'
        option bgscan   '0'
        option key      'my_key'
----------------

I've tried to add at the end of /etc/config/wireless this:
----------------
config "wifi-iface" ""
        option device   'wifi0'
        option mode     'ap'
        option ssid     'another_ssid'
        option hidden   '0'
        option encryption       'psk'
        option network  'waifai'
        option isolate  '0'
        option txpower  '16'
        option bgscan   '0'
        option key      'another_key'
----------------
but it doesn't work and break my config so I've to move to old config.

Any hint?

Thank you and bye
InSa

Ps: kamikaze revision 7355

(Last edited by insa_hc on 1 Jun 2007, 00:34)

Ok, now something is working.

I have to change to manual script:

# Create the bridge
brctl addbr br-waifai
ifconfig br-waifai 192.168.0.10 up
route add default gw 192.168.0.1

# Create client interface and add it to the bridge
wlanconfig ath0 create wlandev wifi0 wlanmode sta nosbeacon
wpa_supplicant -bbr-waifai -Dwext -iath0 -c/etc/wpa_supplicant.conf -Bw
brctl addif br-waifai ath0

# Create ap interface and add it to the bridge
wlanconfig ath1 create wlandev wifi0 wlanmode ap
iwconfig ath1 mode master
iwconfig ath1 essid OpenWrt
iwconfig ath1 enc off
ifconfig ath1 up
brctl addif br-waifai ath1

With this configuration the client mode is working and at least I can see the "OpenWrt" net and I can connect to it. If I also set an ip on the client side I can also ping la fonera through net "OpenWrt". But the bridge isn't working because from the client I can only ping la fonera, also if it should ok:

root@OpenWrt:/# brctl show
bridge name     bridge id               STP enabled     interfaces
br-waifai               8000.001884256809       no              ath0
                                                          ath1

Second question (for today) is: how can I enable dhcp-forward? I've installed it and configured like this:

group           root
group           root

chroot          /var/lib/dhcp-fwd

logfile         /var/log/dhcp-fwd.log
loglevel        1

pidfile         /var/run/dhcp-fwd.pid

ulimit core     0
ulimit stack    64K
ulimit data     32K
ulimit rss      200K
ulimit nproc    0
ulimit nofile   0
ulimit as       0

if      ath1    true    false   true
if      ath0    false   true    true

server  bcast   ath0

But when if I try to start it doesn't work:

root@OpenWrt:~# dhcp-fwd -c /etc/dhcp-fwd.conf 
ioctl(): Cannot assign requested address
Can not get interface information

Any hint?

Thank you and bye.
InSa

I have the same problem now an i get the same error message.
Any ideas?

Sorry, if off-topic. But I'm stuck at the problem your appearently solved:
I want a WPA-Wireless bridge, with the "WAN" the Wifi (ath0) bridged to the "LAN" (eth0). I think, that is what you desribed as your working setup in your original post, right?

Can you please repost your complete configuration , especially the "lan"-section in /etc/config/network?

Thanks!

Tobi

(Last edited by coldtobi on 22 Jan 2008, 09:50)

Hi guys,

1. A Bridge on "Virtual" Devices isn't possible jet....

2. If you bridged your device, Why u use dhcp-fwd ????

3. I use my bridge like below and a dhcp server behind, and everything works fine !!!

regards
j0inty

root@fonera:~# cat /etc/config/network
# Copyright (C) 2006 OpenWrt.org

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
config wifi-device  wifi0
        option type     atheros
        option channel  1
        option mode     11bg
        option diversity 0
        option txantenna 1
        option rxantenna 1
        # REMOVE THIS LINE TO ENABLE WIFI:
        option disabled 0

config wifi-iface
        option device   wifi0
        option network  lan
        option mode     ap
        option ssid      my_SSID
        option hidden   0
        option bgscan   0
        option encryption psk2
        option key      <wpa key>
        option macfilter allow  # or deny
        option maclist 00:0C:6E:45:23:5F

(Last edited by j0inty on 24 Jan 2008, 21:52)

The discussion might have continued from here.