Modify

Opened 6 years ago

Closed 6 years ago

Last modified 4 years ago

#10050 closed defect (invalid)

mac80211 and Ad-hoc mode is not working

Reported by: drkhosla@… Owned by: developers
Priority: normal Milestone: Barrier Breaker 14.07
Component: packages Version: Trunk
Keywords: mac80211 adhoc Cc:

Description

I am running trunk r28152 (ubiquity routerstation-pro with compex 802.11n mini-pci card). My network configuration is

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   eth1
        option type     bridge
        option proto    static
        option ipaddr   192.168.1.1
        option netmask  255.255.255.0

config interface wan
        option ifname   eth0
        option proto    dhcp

config interface adhocnet
        option ifname  wlan1
        option proto   static
        option ipaddr  192.168.2.1
        option netmask 255.255.255.0

config switch
        option name     eth1
        option reset    1
        option enable_vlan 1

config switch_vlan
        option device   eth1
        option vlan     1
        option ports    "0 1 2 3 4"

and wireless configuration is

config wifi-device  radio0
        option type     mac80211
        option channel  11
        option macaddr  00:80:48:6b:c3:4b
        option hwmode   11ng
        option htmode   HT20
        list ht_capab   SHORT-GI-40
        list ht_capab   TX-STBC
        list ht_capab   RX-STBC1
        list ht_capab   DSSS_CCK-40

config wifi-iface adhoc-test
        option device radio0
        option network adhocnet
        option mode adhoc
        option bssid 11:22:ff:ee:bb:ee
        option ssid openwrt-adhoc
        option encryption none

config wifi-iface accesspoint
        option device   radio0
        option network  lan
        option mode     ap
        option ssid     openwrt-ap
        option encryption none

But I am not able to see any ad-hoc interface. iwconfig show following output

lo        no wireless extensions.

eth0      no wireless extensions.

eth1      no wireless extensions.

br-lan    no wireless extensions.

tunl0     no wireless extensions.

ifb0      no wireless extensions.

ifb1      no wireless extensions.

gre0      no wireless extensions.

wlan0     IEEE 802.11bgn  Mode:Master  Frequency:2.462 GHz  Tx-Power=23 dBm
          RTS thr:off   Fragment thr:off
          Power Management:on

mon.wlan0  IEEE 802.11bgn  Mode:Monitor  Tx-Power=23 dBm
          RTS thr:off   Fragment thr:off
          Power Management:on

when I remove

config wifi-iface accesspoint
        option device   radio0
        option network  lan
        option mode     ap
        option ssid     openwrt-ap
        option encryption none

from wireless configuration. iwconfig output change to

root@OpenWrt:~# iwconfig
lo        no wireless extensions.

eth0      no wireless extensions.

eth1      no wireless extensions.

br-lan    no wireless extensions.

tunl0     no wireless extensions.

ifb0      no wireless extensions.

ifb1      no wireless extensions.

gre0      no wireless extensions.

root@OpenWrt:~#

This show that ad-hoc is not working. Either it is problem in /lib/wifi/mac80211.sh or somewhere else.

Attachments (0)

Change History (12)

comment:1 follow-up: Changed 6 years ago by nbd

  • Resolution set to invalid
  • Status changed from new to closed

two problems: first, you cannot use "-" in section names (adhoc wifi interface section). second, the bssid that you used is bogus, because it's a multicast address (lowest bit on first mac address byte is set).

comment:2 in reply to: ↑ 1 Changed 6 years ago by drkhosla@…

  • Resolution invalid deleted
  • Status changed from closed to reopened

Replying to nbd:

two problems: first, you cannot use "-" in section names (adhoc wifi interface section). second, the bssid that you used is bogus, because it's a multicast address (lowest bit on first mac address byte is set).

Sorry, actually, I am playing with many option and just forget about these point. I am creating adhoc mesh using olsrd and also AP for local access. The exact working configuration with previous version is

network config is

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

config interface mesh
        option ifname  wlan0
        option proto   static
        option ipaddr  1.193.201.125
        option netmask 255.0.0.0


config interface lan
        option ifname   eth1
        option type     bridge
        option proto    static
        option ipaddr   192.168.1.1
        option netmask  255.255.255.0

config interface wan
        option ifname   eth0
        option proto    dhcp

config switch
        option name     eth1
        option reset    1
        option enable_vlan 1

config switch_vlan
        option device   eth1
        option vlan     1
        option ports    "0 1 2 3 4"

and wireless

config  wifi-device radio0
        option type mac80211
        option channel 11
        option macaddr 00:80:48:6b:c3:4b
        option hwmode 11ng
        option htmode HT20
        list ht_capab SHORT-GI-40
        list ht_capab TX-STBC
        list ht_capab RX-STBC1
        list ht_capab DSSS_CCK-40

config wifi-iface mesh
        option device radio0
        option network mesh
        option mode adhoc
        option bssid 02:ca:ff:ee:ba:be
        option ssid mesh
        option encryption none

config wifi-iface public
        option device radio0
        option network lan
        option mode ap
        option ssid Unwired
        option encryption none
        option key mesh123

the output of iwconfig is

root@OpenWrt:/# iwconfig
lo        no wireless extensions.

eth0      no wireless extensions.

eth1      no wireless extensions.

br-lan    no wireless extensions.

tunl0     no wireless extensions.

ifb0      no wireless extensions.

ifb1      no wireless extensions.

gre0      no wireless extensions.

wlan0     IEEE 802.11bgn  Mode:Master  Frequency:2.462 GHz  Tx-Power=23 dBm
          RTS thr:off   Fragment thr:off
          Power Management:on

mon.wlan0  IEEE 802.11bgn  Mode:Monitor  Tx-Power=23 dBm
          RTS thr:off   Fragment thr:off
          Power Management:on

The above output does not show any adhoc interface.

after removing following lines from wireless config

config wifi-iface public
        option device radio0
        option network lan
        option mode ap
        option ssid Unwired
        option encryption none
        option key mesh123

the output of iwconfig is

lo        no wireless extensions.

eth0      no wireless extensions.

eth1      no wireless extensions.

br-lan    no wireless extensions.

tunl0     no wireless extensions.

ifb0      no wireless extensions.

ifb1      no wireless extensions.

gre0      no wireless extensions.

wlan0     IEEE 802.11bgn  ESSID:off/any
          Mode:Ad-Hoc  Frequency:2.462 GHz  Cell: Not-Associated
          Tx-Power=23 dBm
          RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:on

The above output show that adhoc mode is not associate with 02:ca:ff:ee:ba:be nor it show any ssid

The basic problem is that adhoc does not join bssid network and it does not create multiple ssid when one of them is in adhoc mode. But it works well with two virtual ap.

comment:3 follow-up: Changed 6 years ago by nbd

remove the "option ifname wlan0" from your /etc/config/network, it's wrong

comment:4 in reply to: ↑ 3 Changed 6 years ago by anonymous

Replying to nbd:

remove the "option ifname wlan0" from your /etc/config/network, it's wrong

It hardly make any difference when I remove "option ifname wlan0". Somehow I manage to get what I want. First I change line number 222 of function scan_mac80211() in file /lib/wifi/mac80211.sh.

From

config_set "$device" vifs "${ap:+$ap }${adhoc:+$adhoc }${sta:+$sta }${monitor:+$monitor }${mesh:+$mesh}"

I change the order of ${ap:+$ap } to ${adhoc:+$adhoc }. And line become

config_set "$device" vifs "${adhoc:+$adhoc }${ap:+$ap }${sta:+$sta }${monitor:+$monitor }${mesh:+$mesh}"

iwconfig output become

wlan0     IEEE 802.11bgn  ESSID:"mesh"
          Mode:Ad-Hoc  Frequency:2.462 GHz  Cell: Not-Associated
          Tx-Power=23 dBm
          RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:on

wlan1     IEEE 802.11bgn  Mode:Master  Frequency:2.462 GHz  Tx-Power=23 dBm
          RTS thr:off   Fragment thr:off
          Power Management:on

mon.wlan1  IEEE 802.11bgn  Mode:Monitor  Tx-Power=23 dBm
          RTS thr:off   Fragment thr:off
          Power Management:on

Now I can see both vif adhoc and ap. But adhoc is still not joining network. To join the network I give following command manually.

iw dev wlan0 ibss leave
ip link set wlan0 down
ip addr flush dev wlan0
iw dev wlan0 set type ibss
ip addr add 1.242.160.111/24 dev wlan0
ip link set wlan0 up
iw dev wlan0 ibss join mesh 2462 fixed-freq 02:ca:ff:ee:ba:be

and output is what I want

root@OpenWrt:~# iwconfig
lo        no wireless extensions.

eth0      no wireless extensions.

eth1      no wireless extensions.

br-lan    no wireless extensions.

tunl0     no wireless extensions.

ifb0      no wireless extensions.

ifb1      no wireless extensions.

gre0      no wireless extensions.

wlan0     IEEE 802.11bgn  ESSID:"mesh"
          Mode:Ad-Hoc  Frequency:2.462 GHz  Cell: 02:CA:FF:EE:BA:BE
          Tx-Power=23 dBm
          RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:on

wlan1     IEEE 802.11bgn  Mode:Master  Frequency:2.462 GHz  Tx-Power=23 dBm
          RTS thr:off   Fragment thr:off
          Power Management:on

mon.wlan1  IEEE 802.11bgn  Mode:Monitor  Tx-Power=23 dBm
          RTS thr:off   Fragment thr:off
          Power Management:on


I think problem lies in /lib/wifi/mac80211.sh

comment:5 follow-up: Changed 6 years ago by nbd

in my tests it works, no matter what order the interfaces are in. it just takes some seconds for it to bring up the ibss cell if it can't join immediately.

comment:6 in reply to: ↑ 5 Changed 6 years ago by anonymous

Replying to nbd:

in my tests it works, no matter what order the interfaces are in. it just takes some seconds for it to bring up the ibss cell if it can't join immediately.

If I remove "option ifname wlan0" (actually I want wlan0 as an adhoc vif) and restore mac80211.sh to previous one ie order is ap first and adhoc second. Instead of wlan0 as adhoc interface I can see wlan1 as adhoc interface but still it does not join network. I waited 15 minutes. But if give following command

iw dev wlan1 ibss join mesh 2462 fixed-freq 02:ca:ff:ee:ba:be

It join network after few seconds. I am using target ar71xx and ubnt routerstation-pro.

comment:7 Changed 6 years ago by nbd

please try the latest version to see if the issue is still there

comment:8 follow-up: Changed 6 years ago by nbd

  • Resolution set to no_response
  • Status changed from reopened to closed

comment:9 in reply to: ↑ 8 Changed 6 years ago by drkhosla@…

  • Resolution no_response deleted
  • Status changed from closed to reopened

Replying to nbd:

Now I am using Ubiquity Rocket M2 running r29697. Same ar71xx as Routerstation Pro. I downloaded firmware from openwrt site.

my /etc/config/wireless is

config wifi-device  radio0
        option type     mac80211
        option channel  6
        option macaddr  00:27:22:XX:XX:XX
        option hwmode   11ng
        option htmode   HT40+
        list ht_capab   SHORT-GI-40
        list ht_capab   TX-STBC
        list ht_capab   RX-STBC1
        list ht_capab   DSSS_CCK-40
        # REMOVE THIS LINE TO ENABLE WIFI:
#       option disabled 1

config wifi-iface mesh
        option device radio0
        option network mesh
        option mode adhoc
        option bssid 02:ca:ff:ee:ba:be
        option ssid mesh
        option encryption none

config wifi-iface
        option device   radio0
        option network  lan
        option mode     ap
        option ssid     OpenWrt
        option encryption none

and /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.1.1'
        option 'netmask' '255.255.255.0'

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

config 'interface' 'mesh'
        option 'proto' 'static'
        option 'ipaddr' '192.168.100.1'
        option 'netmask' '255.255.255.0'

Problem persist, I don't see any adhoc interface.

root@OpenWrt:~# iwconfig
lo        no wireless extensions.

eth0      no wireless extensions.

br-lan    no wireless extensions.

wlan0     IEEE 802.11bgn  Mode:Master  Frequency:2.437 GHz  Tx-Power=18 dBm
          RTS thr:off   Fragment thr:off
          Power Management:on

mon.wlan0  IEEE 802.11bgn  Mode:Monitor  Frequency:2.437 GHz  Tx-Power=18 dBm
          RTS thr:off   Fragment thr:off
          Power Management:on

When I set only adhoc not ap mode ie

config wifi-device  radio0
        option type     mac80211
        option channel  6
        option macaddr  00:27:22:XX:XX:XX
        option hwmode   11ng
        option htmode   HT40+
        list ht_capab   SHORT-GI-40
        list ht_capab   TX-STBC
        list ht_capab   RX-STBC1
        list ht_capab   DSSS_CCK-40
        # REMOVE THIS LINE TO ENABLE WIFI:
#       option disabled 1

config wifi-iface mesh
        option device radio0
        option network mesh
        option mode adhoc
        option bssid 02:ca:ff:ee:ba:be
        option ssid mesh
        option encryption none

I don't see any wireless interface

root@OpenWrt:~# iwconfig
lo        no wireless extensions.

eth0      no wireless extensions.

br-lan    no wireless extensions.

root@OpenWrt:~#

comment:10 follow-up: Changed 6 years ago by nbd

  • Resolution set to invalid
  • Status changed from reopened to closed

remove the 'mesh' name for the wifi-iface section in /etc/config/wireless

comment:11 in reply to: ↑ 10 Changed 6 years ago by anonymous

Replying to nbd:

remove the 'mesh' name for the wifi-iface section in /etc/config/wireless

Thanks it works.

comment:12 Changed 4 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.