OpenWrt Forum Archive

Topic: two wifi interfaces?

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

I've been pulling my hair out over this.  I have an AP with a USB port.  I want to plug a USB wifi card into the usb port, and have one interface act as an AP and the other as STA.

Eventually this will sit in a car, and the STA if will have an external antenna, and the AP if will cover the interior of the car.

I've got everything set up, the hardware seems to be working and recognized, and yet I can only get one wifi interface at a time.  Or, if I get both, they're both configured exactly the same way.

I've tried various variations of the config files below.  Nothing seems to work.  The openwrt docs seem to indicate it's possible at least with Atheros chipsets.  I'd rather not go there; the Broadcomm stuff uses half the power (yes that's significant even off a car battery.  It's the difference between a dead battery in 2 days v. 4 days.)

Can anyone provide any guidance on this?  I'd really like to get this done and it's driving me nuts!

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


#### Loopback configuration
config interface loopback
        option ifname   "lo"
        option proto    static
        option ipaddr   127.0.0.1
        option netmask  255.0.0.0


#### LAN configuration
config interface lan
        option ifname   "eth0"
        option proto    static
        option ipaddr   192.168.1.1
        option netmask  255.255.255.0


#### WAN configuration
config interface        wan
        option ifname   "eth1"
        option proto    dhcp
       
#### WiFi configuration
#config interface wifi0
#        option ifname   "wlan0"
#        option proto    dhcp
#        option defaultroute 1
       
#### WiFi configuration
#config interface wifi1
#        option ifname   "wlan1"
#        option proto    static
#        option ipaddr   192.168.2.1
#        option netmask  255.255.255.0

root@OpenWrt:/etc/config# cat wireless
config wifi-device  wifi0
        option type     mac80211
        option channel  5
        option macaddr  00:10:18:90:20:db
        option hwmode   11g
        # REMOVE THIS LINE TO ENABLE WIFI:
#       option disabled 1

config wifi-iface
        option device   wlan0
#       option network  wifi0
        option mode     sta
        option ssid     OpenWrt
        option encryption none

config wifi-device  wifi1
        option type     mac80211
        option channel  9
        option macaddr  00:10:18:90:20:da
        option hwmode   11g
        # REMOVE THIS LINE TO ENABLE WIFI:
#        option disabled 1
                                               
config wifi-iface
        option device   wlan1
#        option network  wifi1
        option mode     ap
        option ssid     xxxx
        option encryption none

OK, I got it figured out....

It finds the interface by matching the mac address, the device name is irrelevant.  Could someone please add that to the kamikaze docs?

http://kamikaze.openwrt.org/docs/openwrt.html

Please?

The discussion might have continued from here.