View previous topic :: View next topic |
Author |
Message |
Gabriel_Blake Guru
Joined: 16 Sep 2007 Posts: 362
|
Posted: Mon Jan 21, 2013 11:41 pm Post subject: How to make an ethernet-wifi bridge ? |
|
|
I want to do the following and I don't know how to do it exactly.
- my laptop (Gentoo) is connected via wifi with dhcp
- my laptop uses wicd to manage wireless
- another device is connected to my laptop with a crossed ethernet cable
I want my laptop to bridge(?) the ethernet network to the wifi network in such a way that they form one network. The ethernet device should get it's ip address via dhcp of the wifi network. How can this be done ?
Thanks for any help |
|
Back to top |
|
|
massimo Veteran
Joined: 22 Jun 2003 Posts: 1226
|
Posted: Tue Jan 22, 2013 7:35 am Post subject: |
|
|
Maybe [1] gets you moving in the right direction.
[1] Bridging Network Interfaces _________________ Hello 911? How are you? |
|
Back to top |
|
|
Gabriel_Blake Guru
Joined: 16 Sep 2007 Posts: 362
|
Posted: Wed Jan 23, 2013 2:05 am Post subject: |
|
|
Code: |
brctl addif br0 wlan0
can't add wlan0 to bridge br0: Operation not supported
|
So much of that... I works on eth0 but not on wlan0 - bridging wired adapters only apparently.
Any other suggestions ? |
|
Back to top |
|
|
Logicien Veteran
Joined: 16 Sep 2005 Posts: 1555 Location: Montréal
|
Posted: Wed Jan 23, 2013 4:17 am Post subject: |
|
|
What you want to do is to put the Ethernet on the same network then the Wireless one using the Wireless Dhcp server to do it. In a bridge, all ifs share the same IP address. You cannot have one for Ethernet and an other for Wireless that way.
You do not have to create a bridge to share the Internet connection who come from Wireless with the Wire one. Set manually, I mean set statics locales IP addresses on the Ethernet network to a different subnet then the Wireless one. Than, use a firewall rule to allow Network Address Translation (NAT) for Ethernet requests.
I never had to put a wireless card in a bridge. I do not know the state of it. I could miss the solution you need. _________________ Paul
Last edited by Logicien on Wed Jan 23, 2013 4:40 am; edited 8 times in total |
|
Back to top |
|
|
Aiken Apprentice
Joined: 22 Jan 2003 Posts: 239 Location: Toowoomba/Australia
|
Posted: Wed Jan 23, 2013 4:23 am Post subject: |
|
|
Have been doing this with my eeepc. I could not add wlan0 to br0 until I did "iw dev wlan0 set 4addr on". My ap is a normal computer running hostapd with a usb wifi adaptor. Authentication is wpa2 + ccmp. As the eeepc is normally a wifi client I have left it's normal network config alone and use a separate script to kill wicd and manually use wpa_supplicant to connect to the ap and setup the bridge.
Code: |
wpa_supplicant -B -b br0 -i wlan0 -c wpa.conf -Dwext
iw dev wlan0 set 4addr on
brctl addif br0 wlan0
|
Earlier in the script makes sure all drivers are loaded, br0 is setup and later in the script uses dhcpcd to set up the eeepc's networking. Any computers I have had connected to eth0 had normal access to the rest of my network including their own configuration via dhcp.
The hostapd computer creates wlan0.sta and adds that it it's bridge when then eeepc turns 4addr on. Only problem I have had so far is when the eeepc gets turned off the hostapd computer removes both wlan0 and wlan0.sta from it's bridge which kills wifi for anything using that ap. At the moment I have something monitoring this bridge and if wlan0 is missing it adds it back to the bridge.
The other way I use this add a 2nd wifi adaptor to the eeepc and run up hostapd on the 2nd adaptor. This gives me a portable ap with a wireless link back to my main ap. _________________ Beware the grue. |
|
Back to top |
|
|
|