how do you manage wifi cards nowadays? - Page 1
Forum section: electronics / general

author: legacy
author_rank: Super Contributor
timestamp: March 21, 2019, 09:24:14 pm
content: so I have recently bought a couple of supercool Atheros9K miniPCI-wifi cards (300Mbps); they are PCI_MEM_ONLY, my routers is compliant with them, and this is very very goodThere is just a little problem: the ath9k kernel module doesn't support the bridged-mode, so you cannot add the wlan0 to the bridgeCode:192.168.1.4 |mybridge --------||---------- Eth0|---------- Eth1|---------- Eth2|---------- wlan0|so, currently I have two subnet, 192.168.1.4 for the bridged wired lan (three ethernet cards are bridged), and 192.168.2.4 for the wireless.Code:192.168.1.4 |mybridge --------||---------- Eth0|---------- Eth1|---------- Eth2192.168.2.4 |wlan0 -----------|I would like to add the wlan0 physical interface to the bridge, and this worked with intel-2200 wifi cards (54Mbps) by using the old (and dead) MadWifi driver, whereas the new ath9K kernel module is a completely different story.So, how do you manage this, guys?

author: legacy
author_rank: Super Contributor
timestamp: March 21, 2019, 09:25:06 pm
content: (Linux v4.9.91-Roaring-Lionus)

author: magic
author_rank: Super Contributor
timestamp: March 21, 2019, 10:17:30 pm
content: It works out of the box in OpenWRT on a bazillion of Atheros chipset routers.

author: legacy
author_rank: Super Contributor
timestamp: March 21, 2019, 10:45:07 pm
content: Quote from: magic on March 21, 2019, 10:17:30 pmI am not using OpenWRT, everything is *litteraly* made from the scratch.Besides, bridging the Wlan0 worked on routers like Fonera2 was about dealing with Atheros5, driven by MadWifi + patch + hacks. Ath9K is another plannet for perfomances, specifications, and drivers.

author: legacy
author_rank: Super Contributor
timestamp: March 21, 2019, 10:50:13 pm
content: I haven't yet looked at a modern OpenWRT's stuff for understanding *HOW* it's currently managed nowadays.Anyway, this doesn't work as it worked time ago.Code:# brctl addif mybridge wlan0can't add wlan0 to bridge mybridge: Operation not supported

author: legacy
author_rank: Super Contributor
timestamp: March 21, 2019, 10:54:16 pm
content: Code:uc-rb532 wifi # iw dev wlan0 interface add wlan1 type managed 4addr onuc-rb532 wifi # brctl addif mybridge wlan1this looks a compromise, but I am not 100% sure I want to use it.

author: Monkeh
author_rank: Super Contributor
timestamp: March 21, 2019, 11:09:03 pm
content: Quote from: legacy on March 21, 2019, 10:54:16 pmI am 100% sure if you want to bridge a station you want to use 4addr. It is not a compromise, it is a solution. Examine an 802.11 frame and the reason should be obvious.

author: extide
author_rank: Regular Contributor
timestamp: March 21, 2019, 11:09:27 pm
content: Do you need layer 2 stuff to work between the lan/wifi? You could just route between the subnets. I suppose that's what you're probably already doing, though.

author: legacy
author_rank: Super Contributor
timestamp: March 21, 2019, 11:17:26 pm
content: Another irritating thing is that modern wifi cards cannot change the MAC-address like it was possible with old adapters. My fonera2 was using ath5k on the AHB bus and it didn't require any binary-blob built-in compiled within the kernel and it stored the MAC-address inside the flash, so you can literally change it by reprogramming a couple of cells. Both Redboot and uBoot do support it. My Ath9k refuses to change the MAC-address, and does not support the bridge, unless you accept to manage the device in "4-address mode", which is a non-standard extension to the IEEE 802.11 standard to allow transparent Ethernet bridging. So, if you enable it, you can bridge the WLAN, but then your router cannot be used as a hotspot because a lot of clients simply do not work.So, I am thinking about making a userspace-bridge daemon by forwarding at the L2 level all the packets to a destination TUNTAP (offered by the Linux kernel) because this way it can be bridged.Something like this (yes, with devices in promisc mode)Code:wlan = getrawsocket("wlan0", SOCK_DGRAM);tap = getrawsocket("tap0", SOCK_RAW);select(tap + wlan + 1, ...);if (FD_ISSET(wlan, ...)){forward_to_wlan();}if (FD_ISSET(tap, ...)){forward_to_tap();}It ought to be working, but it's not a neat solution, anyway

author: legacy
author_rank: Super Contributor
timestamp: March 21, 2019, 11:22:01 pm
content: Quote from: extide on March 21, 2019, 11:09:27 pmno! I do not want two subnets, I want one subnet, with all the ethernet NICs and wlan0 bridged together!Besides, the wlan0 is requeried to operate withhostapd, so it cannot be set in 4addr-mode.The old fonera2 (2003) was able to do it

author: Monkeh
author_rank: Super Contributor
timestamp: March 21, 2019, 11:23:06 pm
content: Quote from: legacy on March 21, 2019, 11:17:26 pmAnd how else would you like it to work? There are some disgusting hacky solutions available already, but why would you want to use them when you have the correct solution available and working?QuoteNonsense.

author: extide
author_rank: Regular Contributor
timestamp: March 21, 2019, 11:24:57 pm
content: Quote from: legacy on March 21, 2019, 11:22:01 pmOk, sounds like you've got it then

author: legacy
author_rank: Super Contributor
timestamp: March 21, 2019, 11:27:58 pm
content: Quote from: Monkeh on March 21, 2019, 11:23:06 pmPrecisely! With 4addr enabled you're likely to get completely ignored by the AP: association succeeds but all data frames disappear into the ether. This could be for security reasons.

author: Monkeh
author_rank: Super Contributor
timestamp: March 21, 2019, 11:32:37 pm
content: Quote from: legacy on March 21, 2019, 11:27:58 pm4addr enabled on which end?There is no problem with clients connecting to a 4addr AP. Any client which fails isbroken- stop using it.Alternatively, set up a normal AP (you can use the same radio..) for broken trash.

author: legacy
author_rank: Super Contributor
timestamp: March 21, 2019, 11:40:42 pm
content: Quote from: Monkeh on March 21, 2019, 11:32:37 pmIn this working scenario, the rb532 board is the client of my home AP: and, as I worte, the association succeeds but all data frames disappear into the ether.Quote from: Monkeh on March 21, 2019, 11:32:37 pmNot sure it fully works. e.g. using my rb532 board as hotspot, and my Windows XP as client: it perfectly works, but my MacOSX doesn't like the 4-addr mode, 100% packets lost, but, even weird still, this doesn't happen when the wifi card is not bridged.So I an not really sure it works with all the clients: e.g. what about mobile phones? I have to test them.

author: Monkeh
author_rank: Super Contributor
timestamp: March 21, 2019, 11:43:04 pm
content: Quote from: legacy on March 21, 2019, 11:40:42 pmYou will need support enabled on both ends, how else could it work?QuoteThere's a lot more to it than 'MacOSX' - they've used many chipsets and many drivers over the years. Most of them fundamentally broken, being Broadcom, so there's that.I have no and have encountered no devices with issues with 4addr APs - again, set up an AP for faulty devices, or just one for your bridge, if you must. Do not resort to silly userspace hacks.

author: legacy
author_rank: Super Contributor
timestamp: March 21, 2019, 11:46:01 pm
content: Quote from: Monkeh on March 21, 2019, 11:43:04 pmPrecisely: and I cannot touch a Fastweb AP! This configuration needs to operate even with AP that you cannot reconfigure.Otherwise it would be a piece of cake

author: Monkeh
author_rank: Super Contributor
timestamp: March 21, 2019, 11:52:30 pm
content: Quote from: legacy on March 21, 2019, 11:46:01 pmSo don't use their crippled AP.You can use relayd to bodge things if you must, but APs are cheap.

author: magic
author_rank: Super Contributor
timestamp: March 22, 2019, 08:34:40 am
content: Quote from: legacy on March 21, 2019, 11:17:26 pmIt's probably still some external EEPROM somewhere, if you really are desperate to do it that way.I think they blocked it becaue IIRC the same EEPROM also contained some radio calibration data which shouldn't be changed.You can change MAC at runtime with ifconfig.Quote from: Monkeh on March 21, 2019, 11:52:30 pmHow does that thing work and how does it deal with an AP which doesn't accept 4 address frames? I can find millions of identical tutorials on how to set it up but not a word of explanation.Does it just associate every ethernet-side MAC with the AP and send 3 address frames on behalf of it? That's an idea I came up with many years ago when I didn't even know that WDS exists but never implemented it nor really expected anyone else to do.

author: legacy
author_rank: Super Contributor
timestamp: March 22, 2019, 09:40:02 am
content: Quote from: magic on March 22, 2019, 08:34:40 amOn Ath5 the EEPROM is simply memory mapped and it's exposed on the Ahb bus, so you can easily access if for reprogramming. It contains the PLL scale for setting the CPU clock, the MAC-address as well as all the stuff required for the regulatory domain of wireless networks (don't know what it is, I know it's there); Of course I know where all the bytes for MAC-address are located, so I can easily hex-edit the whole image without ruining the calibration data.On Ath9k the EEPROM seems not directly accessible from the PCI, and things are getting more complex.Quote from: magic on March 22, 2019, 08:34:40 amOf course yes, but for other reasons I need to change it permanently and before Linux takes control.

author: legacy
author_rank: Super Contributor
timestamp: March 22, 2019, 09:48:19 am
content: Quote from: magic on March 22, 2019, 08:34:40 amGoogling about this stuff has given me a lot of confusion and wrong things. Besides, it seems that things have changed a lot.Let's ask in OpenWRT forum, and let's check by myself how OpenWRT does manage it.

author: legacy
author_rank: Super Contributor
timestamp: March 22, 2019, 12:31:13 pm
content: So, I have installed three wireless card in my RS/PRO (the rb532 only has 2 miniPCI slots, the RS/PRO has 3 slots)- one as AP @ 2.4Ghz <--- this requireshostapd- one as ad-hoc @ 2.4Ghz- one as ad-hoc @ 5Ghzboth the two ad-hoc radio link are bridged, and they are working without any issue! I like it! ad-hoc networks lack the complexities of infrastructure setup and administration, which is good because it enables devices to create and join networks "on the fly"This is good for what these two ad-hok links have to do.

author: Monkeh
author_rank: Super Contributor
timestamp: March 22, 2019, 01:25:37 pm
content: Quote from: magic on March 22, 2019, 08:34:40 amI have never needed to use it, so..It is used for this purpose, that's all I can tell you. I just use functional APs.

author: magic
author_rank: Super Contributor
timestamp: March 22, 2019, 08:20:52 pm
content: Okay, I tracked it down.https://git.openwrt.org/?p=project/relayd.git;a=treeThe secret solution is that it doesn't work in layer 2, only with IPv4.It forwards ARP between the "bridged" networks and, when forwarding a response, changes the MAC address to its own. As a result, hosts send IP packets destined to the other side of the bridge to the bridge's MAC and the bridge's kernel IP stack forwards them to their actual destination. Static rules are set up by relayd for that. The source MAC of forwarded packets is the bridge's own so dumb APs are happy.That's indeed one ugly kludge.

author: macboy
author_rank: Super Contributor
timestamp: March 25, 2019, 03:58:48 pm
content: I use OpenWRT and my routers have no trouble bridging a pair of Atheros9k mini-PCI cards (2.4 and 5 GHz) to my LAN. Maybe they have made some driver changes that haven't been picked up elsewhere? I don't know what OpenWRT does under the hood, but configuration is dead simple and it has worked for me for nearly 7 years.

author: madires
author_rank: Super Contributor
timestamp: March 25, 2019, 04:10:25 pm
content: Basically you create a software bridge and add the physical network interfaces. For example for Debianhttps://wiki.debian.org/BridgeNetworkConnections.

author: legacy
author_rank: Super Contributor
timestamp: March 25, 2019, 04:44:44 pm
content: Quote from: madires on March 25, 2019, 04:10:25 pmalready mentioned, but it doesn't work with recent wireless cards unless you enable a wds interface, but this causes other problems because it's not implemented in the same way everywhere.

author: Monkeh
author_rank: Super Contributor
timestamp: March 25, 2019, 05:40:47 pm
content: Quote from: macboy on March 25, 2019, 03:58:48 pmBridging AP mode interfaces is not the same as client mode.Quote from: legacy on March 25, 2019, 04:44:44 pmIt doesn't work withanycard due to the limited fields in the frame.

author: legacy
author_rank: Super Contributor
timestamp: March 27, 2019, 11:47:13 pm
content: Quote from: Monkeh on March 25, 2019, 05:40:47 pmwhat do you mean? The wds mode on 4addr does works, but it's not guaranteed to be implemented in the same way on two different chipanyway, just bought a couple of different wifi cards- intel2100- intel2200- some Broadcom cards- Atheros5K-AHB (Fon2202, it's 2005-2007 technology)- Atheros5k (rebranded "Genie"? bah ...)- Atheros9k <---------- 300MPS, PCI and miniPCI WOWWWW super deal!- Atheros9k_HC- Atheros10kso I will be able to have an idea about the wds combability

author: Monkeh
author_rank: Super Contributor
timestamp: March 27, 2019, 11:52:21 pm
content: Quote from: legacy on March 27, 2019, 11:47:13 pmI mean bridging a station to an ethernet interface. Without a 4addr frame it does not work. This is not a 'recent' issue, it is just that they only relatively recently prevented people making non-functional bridges, to reduce the amount of noise.Almost any card with a mac80211 driver will interoperate with any other in 4addr mode, and as an AP with any client. This is a software stack issue with only a small number of chipsets being problematic.