OpenWrt Forum Archive

Topic: bridging multiple wireless mini-pci card with wired ethernet interface

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

Hello, everyone.

I've been developing AP/router with Gateworks 2348-4 (IXP425) board where 3 mini-pci atheros wireless card
installed, using Kamikaze 8.09.1

I'd like to configure i/f's like this:

eth1: WAN I/F
eth0, wifi0, wifi1, wifi2: as bridge.

(eth0, eth1 is interfaces built in IXP425 and it is wired.
eth1 is connected another AP/router. And this router gives
clients dhcp addresses from 192.168.0 network.
)

I'd like to know how to:
1. bridge multiple atheros wireless mini-pci card and ethernet(eth0), say br-lan
2. put three wireless card to AP mode.
3. forwarding packet from br-lan to eth1 (wan)

Is that possible? I've actually search through howto's but I couldn't
find the related one... If anyone know the howto URL
please let me know


For you reference, the following is the message when I booted:

Please press Enter to activate this console. firmware: requesting NPE-B
NPE-B: firmware's license can be found in /usr/share/doc/LICENSE.IPL
NPE-B: firmware functionality 0x2, revision 0x2:1
eth0: link down
br-lan: Dropping NETIF_F_UFO since no NETIF_F_HW_CSUM feature.
device eth0 entered promiscuous mode
firmware: requesting NPE-C
NPE-C: firmware's license can be found in /usr/share/doc/LICENSE.IPL
NPE-C: firmware functionality 0x5, revision 0x2:1
eth1: link down
PPP generic driver version 2.4.2
ip_tables: (C) 2000-2006 Netfilter Core Team
nf_conntrack version 0.5.0 (1024 buckets, 4096 max)
wlan: trunk
ath_hal: module license 'Proprietary' taints kernel.
ath_hal: 2009-05-08 (AR5210, AR5211, AR5212, AR5416, RF5111, RF5112, RF2413, RF5
413, RF2133, RF2425, REGOPS_FUNC, XR)
ath_rate_minstrel: Minstrel automatic rate control algorithm 1.2 (trunk)
ath_rate_minstrel: look around rate set to 10%
ath_rate_minstrel: EWMA rolloff level set to 75%
ath_rate_minstrel: max segment size in the mrr set to 6000 us
wlan: mac acl policy registered
ath_pci: trunk
PCI: enabling device 0000:00:01.0 (0340 -> 0342)
Atheros HAL provided by OpenWrt, DD-WRT and MakSat Technologies
wifi0: 11a rates: 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
wifi0: turboA rates: 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
wifi0: H/W encryption support: WEP AES AES_CCM TKIP
ath_pci: wifi0: Atheros 5212: mem=0x48000000, irq=28
PCI: enabling device 0000:00:03.0 (0340 -> 0342)
Atheros HAL provided by OpenWrt, DD-WRT and MakSat Technologies
wifi1: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
wifi1: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36
Mbps 48Mbps 54Mbps
wifi1: turboG rates: 6Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
wifi1: H/W encryption support: WEP AES AES_CCM TKIP
ath_pci: wifi1: Atheros 5212: mem=0x48020000, irq=26
PCI: enabling device 0000:00:04.0 (0340 -> 0342)
Atheros HAL provided by OpenWrt, DD-WRT and MakSat Technologies
wifi2: 11a rates: 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
wifi2: turboA rates: 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
wifi2: H/W encryption support: WEP AES AES_CCM TKIP
ath_pci: wifi2: Atheros 5212: mem=0x48030000, irq=25
eth1: link up, 100Mbps, full-duplex, lpa 0x45E1
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
br-lan: port 2(ath0) entering disabled state
device ath0 left promiscuous mode
br-lan: port 2(ath0) entering disabled 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
br-lan: port 2(ath0) entering disabled state
device ath0 left promiscuous mode
br-lan: port 2(ath0) entering disabled 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
br-lan: port 2(ath0) entering disabled state
device ath0 left promiscuous mode
br-lan: port 2(ath0) entering disabled state

/etc/config/network:

#config switch eth0
#       option vlan0    "0 1 2 3 5*"
#       option vlan1    "4 5"

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

config 'interface' 'wan'
        option 'ifname' 'eth1'
        option 'proto' 'dhcp'

config 'interface' 'lan'
        option 'ifname' 'eth0' 'wifi0' 'wifi1' 'wifi2'
#       option 'ifname' "eth0.0"
        option 'type' 'bridge'
        option 'proto' 'static'
        option 'ipaddr' '192.168.1.1'
        option 'netmask' '255.255.255.0'
        option 'dns' ''
        option 'gateway' '192.168.0.1'

/etc/config/wireless:

config wifi-device  wifi0
        option type     atheros
        option channel  auto
        option country  kr

        # REMOVE THIS LINE TO ENABLE WIFI:
        #option disabled 1
config wifi-iface
        option device   wifi0
        option network  lan
        option mode     ap
        option ssid     OpenWrt
        option encryption psk, psk2
        option isolate  1

config wifi-device  wifi1
        option type     atheros
        option channel  auto
        option country  kr

        # REMOVE THIS LINE TO ENABLE WIFI:
        #option disabled 1
config wifi-iface
        option device   wifi1
        option network  lan
        option mode     ap
        option ssid     OpenWrt
        option encryption psk, psk2
        option isolate  1

config wifi-device  wifi2
        option type     atheros
        option channel  auto
        option country  kr

        # REMOVE THIS LINE TO ENABLE WIFI:
        #option disabled 1
config wifi-iface
        option device   wifi2
        option network  lan
        option mode     ap
        option ssid     OpenWrt
        option encryption psk, psk2
        option isolate  1

'brctl' didn't allow bridge with wired and wireless i/f's..
Is that due to the i/f configuration problem with /etc/config/network, /etc/config/wirelss etc,
or should I use another package other than bridge-utility?


Thank you!..

(Last edited by dobest03 on 13 Jul 2009, 08:20)

I coudn't see bridged interfaces with 'brctl show' so
I posted an question.

I've changed the /etc/config/network and /etc/config/wireless is like the following
and it seems working.

/etc/config/network:

root@OpenWrt:~# cat /etc/config/network
config switch eth0
        option vlan0    "0 1 2 3 5*"
        option vlan1    "4 5"

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

config 'interface' 'wan'
        option 'ifname' 'eth1'
        option 'proto' 'dhcp'

config 'interface' 'lan'
#       option 'ifname' 'eth0' 'wifi0' 'wifi1' 'wifi2'
        option 'ifname' "eth0.0"
        option 'type' 'bridge'
        option 'proto' 'static'
        option 'ipaddr' '192.168.1.1'
        option 'netmask' '255.255.255.0'
        option 'dns' ''
        option 'gateway' '192.168.0.1'

/etc/config/wireless:

config wifi-device  wifi0
        option type     atheros
        option channel  auto
        option country  kr

        # REMOVE THIS LINE TO ENABLE WIFI:
        #option disabled 1
config wifi-iface
        option device   wifi0
        option network  lan
        option mode     ap
        option ssid     OpenWrt
        option encryption psk, psk2
        option key      "some_key"
        option isolate  1

config wifi-device  wifi1
        option type     atheros
        option channel  auto
        option country  kr

        # REMOVE THIS LINE TO ENABLE WIFI:
        #option disabled 1
config wifi-iface
        option device   wifi1
        option network  lan
        option mode     ap
        option ssid     OpenWrt
        option encryption psk, psk2
        option key      "some_key"
        option isolate  1

config wifi-device  wifi2
        option type     atheros
        option channel  auto
        option country  kr

        # REMOVE THIS LINE TO ENABLE WIFI:
        #option disabled 1
config wifi-iface
        option device   wifi2
        option network  lan
        option mode     ap
        option ssid     OpenWrt
        option encryption psk, psk2
        option key      "some_key"
        option isolate  1

And I tried to connect with wireless usb dongle from my development PC to Gateworks boards:

From developemnt pc:

 $ ifconfig
lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:145 errors:0 dropped:0 overruns:0 frame:0
          TX packets:145 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:13013 (13.0 KB)  TX bytes:13013 (13.0 KB)

ra0       Link encap:Ethernet  HWaddr 00:12:0e:a8:34:de  
          inet addr:192.168.1.103  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::212:eff:fea8:34de/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1000 errors:0 dropped:0 overruns:0 frame:0
          TX packets:223 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:153230 (153.2 KB)  TX bytes:18906 (18.9 KB)

$ iwconfig
lo        no wireless extensions.

eth0      no wireless extensions.

vboxnet0  no wireless extensions.

pan0      no wireless extensions.

ra0       RT2870 Wireless  ESSID:"OpenWrt"  Nickname:"RT2870STA"
          Mode:Managed  Frequency=2.457 GHz  Access Point: 00:15:6D:53:7C:AC   
          Bit Rate=54 Mb/s   
          RTS thr:off   Fragment thr:off
          Link Quality=82/100  Signal level:-62 dBm  Noise level:-83 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

$ ping www.intel.com
PING a961.g.akamai.net (125.56.214.48) 56(84) bytes of data.
64 bytes from 125.56.214.48: icmp_seq=1 ttl=52 time=12.3 ms
64 bytes from 125.56.214.48: icmp_seq=2 ttl=52 time=31.3 ms
64 bytes from 125.56.214.48: icmp_seq=3 ttl=52 time=11.4 ms
64 bytes from 125.56.214.48: icmp_seq=4 ttl=52 time=10.8 ms
^C
--- a961.g.akamai.net ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3005ms
rtt min/avg/max/mdev = 10.848/16.519/31.395/8.605 ms

ps from gateworks is like the following:

root@OpenWrt:~# ps
  PID USER       VSZ STAT COMMAND
    1 root      1116 S    init       
    2 root         0 SW<  [kthreadd]
    3 root         0 SW<  [ksoftirqd/0]
    4 root         0 SW<  [events/0]
    5 root         0 SW<  [khelper]
   39 root         0 SW<  [kblockd/0]
   67 root         0 SW   [pdflush]
   68 root         0 SW   [pdflush]
   69 root         0 SW<  [kswapd0]
   70 root         0 SW<  [aio/0]
  602 root         0 SW<  [mtdblockd]
 1868 root         0 SWN  [jffs2_gcd_mtd3]
 1882 root      1128 R    /bin/ash --login 
 1890 root      1128 S    syslogd -C16 
 1892 root      1108 S    klogd 
 1904 root       592 S    /sbin/hotplug2 --override --persistent --max-children
 2354 root      1128 S    udhcpc -t 0 -i eth1 -b -p /var/run/eth1.pid -R 
 2385 root       808 S    hostapd -P /var/run/wifi-ath0.pid -B /var/run/hostapd
 2445 root       808 S    hostapd -P /var/run/wifi-ath1.pid -B /var/run/hostapd
 2505 root       808 S    hostapd -P /var/run/wifi-ath2.pid -B /var/run/hostapd
 2675 root       892 S    /usr/sbin/dropbear -p 22 
 2680 root      1112 S    /usr/sbin/httpd -p 80 -h /www -r OpenWrt 
 2701 nobody     712 S    /usr/sbin/dnsmasq -K -D -y -Z -b -E -s lan -S /lan/ -
 2708 root      1108 S    watchdog -t 5 /dev/watchdog 
 2718 root      1116 R    ps

I have a question about vlan port mapping:

        option vlan0    "0 1 2 3 5*"
        option vlan1    "4 5"

0: for eth0,
1~3: for wireless i/f (ath0, ath1, ath2)
4: eth1
5: internal port which has a VLAN-tagged connection into LInux internals.

My consumption is right? Where can I confirm the port number and i/f..

If one more wireless card is installed that configuraiton must change like the following?

        option vlan0    "0 1 2 3 4 5*"
        option vlan1    "6 5"

Thank you for your reading ~!

(Last edited by dobest03 on 13 Jul 2009, 09:46)

As "config switch eth0" says, it's the configuration of the internal switch (if your device does have any).
If your device does not have an internals switch (supported by openwrt!), the whole "config switch" section is useless, in that case, vlans like "eth0.1" and "eth0.0" will not exist, unless you create your own with vconfig.
Since your devices seems to have only two ethernet interfaces, which are eth0 and eth1, it does not have an internal switch.
So you should bridge your wireless interfaces with eth0, if eth1 is used for WAN.
Either specify the wireless interface in "option ifname" in /etc/config/network **OR** use the "option network" in /etc/config/wireless.

The discussion might have continued from here.