Bridging wire and wireless using bridge-utils

Asked by dervih

Since Linux kerner >= 2.6.33 it is impossible to: "brctl addif br0 eth0 wlan0"
where eth0 is a wire and wlan0 is a wireless interface respectively.
But is seems that is not an implementation limitation, yet only an interface, maybe only one "if" in the code.

In fact it is not simple to bride wire and wireless due to the mac problem in the manage mode
(probably the wireless device refuses packets addressed with a different MAC than its)
So I assume that somebody decided to prohibit bridging wire and wirless
instead of non-trivialy extending bridge implementation in the kernel (just as Microsoft did).
And now when I issue "brctl addif brt0 eth0 wlan0" I get "Operation not supported".

It's a great pity that the decider hadn't taken the existing workaround into consideration:
the MAC problem can be resolved using ebtables, dhcrelay can solve a dhcp problem
and arp-scan to refresh ebtables rules.
Finally the wire-wireless bridge can work almost perfectly as an ordinary bridge.
There are a lot of opinions in internet that the workaround was effective and usuful and
there are a lot of questions how to brdige wire and wireless in a mange mode.

I'm writting to you because I've noticed something strange:
I managed to bridge wire and wireless via "brctl addif brt0 eth0 eth1" on Xubuntu/Ubuntu 12.04 and 12.10
(Note that eth1 is a wiress interface, naming convention has changed since Ubunut 12.*)
Xubuntu/Ubuntu 12.* are using Linux kernel version 3.2.* so I though that the bridging restriction was lifted.
Alas! In Xubuntu/Ubuntu 13.04 (pre-release version) the restriction still occurs
so it is unlikely that something in the kernel was changed in version 3.2.* regarding bridging.

I think that I discovered the reason why bridging works in Xubuntu/Ubuntu 12.*.
When I issue "iw eht1 info" in Xubuntu/Ubuntu 12.* I get error "nl80211 not found"
but my wirelles interface works correctly (with wpa_supplicant)
So it is simply a Xubuntu/Ubuntu 12.* bug.
Note that "iw" package was significantly upgraded against Xubuntu/Ubuntu 11.*.
The bug has been fixed in Xubuntu/Ubuntu 13.04, "iw eht1 info" works.

So it seems that the bug was a nice side-effect causing that the bridging restriction was cheated.
But how? Probably during "brctl addif brt0 eth0 wlan0" the kernel asks the wireless device
about mode in wich it is working, the bridging restriction affects manage mode but not access point mode.

For me and not only the bridging restriction is ridiculous especially as it causes that
wire-wireless bridge can not be obtained at all completely differently than in Windows 7.
In Windows 7 I click on two interaces wire and wireless and followed by "Brdge Connections" and it works!

From my point of view as a computer scientist the wire and wireless inferfaces for notebooks and etc.
should be bridged by default making one logical interface. It is stupid to keep them independent
while, nine times out of ten, the intefaces are used exclusively only as two ways to connect to a local subnet.
They hardly ever are used to connect two different subnets and making a notebook to be something like a router.

MY QUESTION IS:
Could you do something to make possible for ever to bridge wire and wireless interface on Ubuntu?

About usefulness of bridging. It has a lof of advantages but most important in my opinion are:
- I can connect fastly two notebooks or another device to my notebook (e.g.: printer, TV)
  via wire in case copying a huge amount of data and both are connecteced to my subnet (and also have an access to internet)
- I can connect fastly sombedy elses's notebootk to my notebook when I want to temporarily give him
  an access to my subnet and/or internet but I don't want to give him my wireless password.

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

I suggest you report a bug. Raring is not stable and not ready so you will see feature holes up to and even after release. It works in Precise because it IS ready.

What did you expect?.....think about it. This is WHY it say "Develpment", the OS is incomplete.

Revision history for this message
dervih (dervih) said :
#2

I was writing the question about 3 hours!
And you have just answered providing no usuful information! Have you read it all??

Note that I did a lot analysis about the problem and it is clear where the problem is.
Could my question be passed to the someone competent in network issues?

I am wating for the answer at the same technical level as my question!
Thanks in advance.

Revision history for this message
Manfred Hampl (m-hampl) said :
#3

Maybe you find more information on the source page of bridge-utils http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge
There is some contact info at the end of that page.

And of course you should consider creating a bug report about your problem, either on Launchpad for Ubuntu, or on Debian.

P.S.: Are you sure that the syntax "brctl addif brt0 eth0 wlan0" is right?
According to the documentation the "brctl addif <brname> <ifname>" takes only one interface name?
Have you ever tried reversing the sequence of eth0 and wlan0?

Revision history for this message
dervih (dervih) said :
#4

And again. You still have not understood my question.
Let me explain one more time.

1. I am only trying to improve Ubuntu, now it is impossible to bridge wire and wireless interfaces
2. If it was possible to bridge I would manage to do, believe me!
3. So there is no bug to report nor problem to solve, this is the lack of functionality and
    very stupid restriction in linux kernel.

I usually create the brdige issueing the following commands:
"brctl addbr br0"
"brctl addif br0 eth0"
"brctl addif br0 wlan0" or "brctl addif br0 eth1"
depending on Ubuntu version.

As I have written: the last command does not work on Ubuntu 11.* and Ubuntu 13.*.
yielding error message "can't add wlan0 to bridge br0: Operation not supported"
"http://ubuntuforums.org/archive/index.php/t-1938219.html"
Google: brctl eth0 wlan0 "operation not supported"

The impossibility is caused by linux kernel restriction introduced in 2.6.33.
http://kerneltrap.org/mailarchive/linux-ath5k-devel/2010/3/21/6871553
Google: wire wireless bridge "2.6.33"

I managed to bridge wire and wireless on Ubuntu 12.* but only accidentally.
The bug with nl80211 causes that the bridge restriction is workaraounded.
( Issueing command "iw eht1 info" yield error "nl80211 not found" )

The situation on Ubuntu 12.* confirms that the bridging problem ( "operation not supported" )
is not a limatation of the bridge implementation but only a restriction that can be simply turned off.

What Ubuntu developer team can do?
So Ubuntu developer team can decided to:
a) patch kernel sources in order to turn off the restriction
b) implement wire wirelss brdige at the kernell level in the same way as Microsoft did.
c) issue an enhacement request to Linux kernel team to change the thing
d) implement wire wirelss brdige in the user mode e.g. in Network Manager

I belive that Ubuntu team want to have wire wireless bridging possible
especially that the Ubuntu is now the best Linux flavour system for a notebook.

Revision history for this message
Manfred Hampl (m-hampl) said :
#5

"And again. You still have not understood my question."
I think I have. You say that bridging wired and wireless network interfaces was possible in certain Ubuntu version / kernel version combinations, and it is not possible in other cases.

I tried my best to understand you, but there are some contradictions in your information.

In your original message you claim it to be an Ubuntu bug ("So it is simply a Xubuntu/Ubuntu 12.* bug.")
Upon my request to create a bug report about that, in response #4 you now deny it to be a bug. ("So there is no bug to report nor problem to solve.") What is now the case?

From reading some google hits about that case it seems to me that the problem is not that you cannot bridge wired and wireless devices together, but it seems that you cannot use wireless interfaces in a bridge at all. Can you confirm that? Does the command sequence
"brctl addbr br0"
"brctl addif br0 wlan0"
fail even if there is no wired interface involved at all?

In your last post you proposed 4 potential solutions. I guess option c) "issue an enhacement request to Linux kernel team to change the thing" will be the best choice. Why don't you try convincing the kernel team to (re-)implement that functionality?

Revision history for this message
dervih (dervih) said :
#6

"I tried my best to understand you, but there are some contradictions in your information."
My question is about bridging. The bug affects semething else ( nl80211 ) and it is no problem for me.
However the bug can be the reason why wire wireless bridging works on Ubuntu 12.*
I believe that if the bug was solved the bridging would be impossible again.
So surpisingly I enjoy the bug on Ubuntu 12.*. But I want to upgdrade my Ubuntu in the future.
Therefore I ask Ubuntu team if it the team could address wire - wirelss bridging to be possible.

Yes, I can not use wireless interfaces in a brdidge at all provided that it works in manage mode.
There ara some modes in which I can use wireless in the bridging:
- when a wireless device works as na access point
- when a wireless works in 4addr mode
The last mode is incompatible with routers basesd on Broadcom's platform.
While the command "brctl addif br0 wlan0" is being processed
the wirelass device is asked in which mode works.
I guess that the bug relating to nl80211 causes that there is no answer
or such answer that the bridging process keeps going on.
I found some information in Internet that there is only explicit restriction causing
the error "Operation not supported"

I guess option c) "issue an enhacement request to Linux kernel team to change the thing"
Well I am not sure what is the best way to make wire-wirelss possible.
Note that I wrote that some extra steps must be performed in order to wire wireless bridge works:
- mac nat in ebtables
- dhcp relaying
- periodically refreshing ebtables rules
The brief inofrmation how to make wire-wirelss bridge on Ubuntu 12.* can be found:
http://ubuntuforums.org/archive/index.php/t-1692292.html

I believe that for notebooks the wire-wireless brdige should be created
during Ubuntu installation process (by default) and it should be only one logical intefrace, say br0
and the interface should be managed by Network Manager.
Now Network Manager can't managed bridge interfaces at all.
So it is a lot of to do and not only by Linux kernel team.

There is some people deciding how Ubuntu should look and work in the future.
Maybe that people have the same view on wire-wirelss bridging.

My proposition is an enhancement request to Ubuntu developer team.
My question is how big are chances that my propistion is accepted.

Revision history for this message
Manfred Hampl (m-hampl) said :
#7

Re: "My question is how big are chances that my proposition is accepted."
That is something noone can tell as long as you haven't created such request.

You have to be aware that for discussing technical details you better use the bug area or IRC channels, and not the question area of launchpad, because that is where the developers work.

I recommend that you
- create an enhancement request in the form of a bug report
and/or
- try contacting the developers working on that area (see http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge and https://launchpad.net/bridge-utils or #ubuntu-devel and #ubuntu-kernel IRC channels or similar)

Can you help with this problem?

Provide an answer of your own, or ask dervih for more information if necessary.

To post a message you must log in.