Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to make an ethernet-wifi bridge ?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Gabriel_Blake
Guru
Guru


Joined: 16 Sep 2007
Posts: 362

PostPosted: Mon Jan 21, 2013 11:41 pm    Post subject: How to make an ethernet-wifi bridge ? Reply with quote

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
View user's profile Send private message
massimo
Veteran
Veteran


Joined: 22 Jun 2003
Posts: 1226

PostPosted: Tue Jan 22, 2013 7:35 am    Post subject: Reply with quote

Maybe [1] gets you moving in the right direction.

[1] Bridging Network Interfaces
_________________
Hello 911? How are you?
Back to top
View user's profile Send private message
Gabriel_Blake
Guru
Guru


Joined: 16 Sep 2007
Posts: 362

PostPosted: Wed Jan 23, 2013 2:05 am    Post subject: Reply with quote

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
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1555
Location: Montréal

PostPosted: Wed Jan 23, 2013 4:17 am    Post subject: Reply with quote

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
View user's profile Send private message
Aiken
Apprentice
Apprentice


Joined: 22 Jan 2003
Posts: 239
Location: Toowoomba/Australia

PostPosted: Wed Jan 23, 2013 4:23 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum