I have three profiles set up in /etc/network.d/ on a laptop that I'm trying to use to bridge a stand-alone computer to my main LAN in another part of the house.
1. eth0 - with a static address, no gateway or dns
2. wireless - with a static address, no GW or DNS
3. bridge - with a static address, GW and DNS bridging wlan to eth0
Both eth0 and wireless work fine and the bridge interface starts up fine too but I can't get it to act as a bridge.
With the bridge interface up:
I can only ping my gateway and the internet from the laptop when the network cable is attached to my main LAN. It's as if the wireless interface is inactive.
I can get the stand-alone computer that I'm trying to connect to my network to talk to the bridge, but not through the bridge to my main LAN.
The wireless is using ndiswrapper. Does this matter?
When starting the wireless interface I get 'nl80211: Could not configure driver to use managed mode' but the wireless works. Does this matter?
Any ideas would be helpful.
Could you post your profiles? Also do you have bridge-utils and iptables installed? I doubt it would matter if the card is using ndiswrapper or not.
I have bridge-utils installed but I didn't have iptables.
My profiles are (with some redaction):
CONNECTION='ethernet' DESCRIPTION='A basic static ethernet connection using iproute' INTERFACE='eth0' IP='static' ADDR='10.--.--.--' NETMASK='255.255.255.---' CONNECTION='wireless' DESCRIPTION='A simple WPA encrypted wireless connection using a static IP' INTERFACE='wlan1' SECURITY='wpa' ESSID='*****' KEY='*******************' IP='static' # Any other CONNECTION='ethernet' options may be used. ADDR='10.--.--.--' NETMASK='255.255.255.---' #PRECONNECT iw dev wlan1 set 4addr on INTERFACE="br0" CONNECTION="bridge" DESCRIPTION="Bridge eth0 and wlan0" BRIDGE_INTERFACES="eth0 wlan1" IP="static" ADDR='10.--.--.--' NETMASK='255.255.255.---' GATEWAY='10.--.--.1' DNS='10.--.--.1'
Just to be sure, are your addresses where you have "---" hidden by you, or is that how they are set up? You don't really have reason to hide these addresses from us, they are internal on your LAN, we can't do anything with them. It makes the file harder to read too. If you reposted them unfiltered (hide your passkeys though) it would be appreciated.
Also, what are you connecting the laptop and computer with? Are you using a crossover cable or a switch between them?
Last edited by MisterAnderson (2012-09-30 12:50:09)
I'm using a switch. I think I have the bridge up and running, what I'm missing, I guess, is iptables/shorewall setup for the bridge. I'm looking at http://www.shorewall.net/bridge-Shorewall-perl.html and trying to adapt it to my needs.
I can ping the bridge from the computer and vice versa, I just can't send packets through the bridge.
Hey, I've got some free time this afternoon and an old laptop so I threw Arch on it and shoved a wireless card in it, I'll see if I can get it working.
Ok I've been having a look and it looks like you can't bridge from a wireless card in client mode (ie your laptop, connected to your wifi) but you can route it, giving you internet access. I learnt this from here but I'll adapt the instructions to make them clearer.
Now, since you went and hid all your private IP addresses (WHY!?) you'll have to adapt from my examples.
wlan0 - my wifi card
eth0 - ethernet
192.168.2.1 - my primary router for the network
192.168.3.1 - will be assigned to eth0
First edit /etc/sysctl.conf and change "net.ipv4.ip_forward = 0" to 1.
Setup your wireless card to connect to your wifi with a netcfg profile. Leave it how it is, just make sure the laptop can connect to the net.
Now make a new profile in called /etc/network.d/bridge and put the following in:
CONNECTION='ethernet' DESCRIPTION='bridge to wifi' INTERFACE='eth0 IP='static' ADDR='192.168.3.1' NETMASK='255.255.255.0' POST_UP="iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE"
Now enable both your profiles to run at boot (i'm using net-auto-wireless and net-auto-wired but do it how you want). Reboot your laptop.
Now go to your desktop and change the IP settings to static with these settings:
IP address: 192.168.3.2
Subnet mask: 255.255.255.0
Default gateway: 192.168.3.1
And there you go, internet access. Local network filesharing and the like won't work but you'll have internet access.
EDIT: Almost forgot it's pretty easy to setup DHCPD on eth0 instead of static IP, letting you leave the desktop on dhcp.
If you really want to properly bridge it I would recommend buying a router that supports dd-wrt and setting it up in client bridge mode. I have a Linksys E2500 and highly recommend it, easy to flash and quite cheap on ebay at the moment. If you don't mind old 802.11g then a Linksys WRT54GL would be cheaper.
Last edited by MisterAnderson (2012-10-02 10:11:39)