LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   Creating a bridge between ad-hoc and wireless inteface (http://www.linuxquestions.org/questions/linux-server-73/creating-a-bridge-between-ad-hoc-and-wireless-inteface-839345/)

taoelism 10-20-2010 01:32 PM

Creating a bridge between ad-hoc and wireless inteface
 
I was wondering if I could create a bridge between two wireless interfaces. So that when there is a WAN that filters MAC's, 2 different computers which aren't in the WAN whitelist can connect to the WAN via me.
Is that possible? And how?
Thanks!

anomie 10-20-2010 04:27 PM

I'm curious: what size subnets are you talking about bridging? Are both wireless interfaces in your Linux box? (Are you using a Linux box? Which distro / version?)

And if I may be so bold: why in the world would you not just route between the two subnets, and manage access control at the IP level?

taoelism 10-21-2010 12:15 AM

Anomie: I'm using Arch linux, with kernel 2.6.35-ARCH. I don't really know what a subnet is, but, if it's a client, about 10 clients should be able to connect.

Quote:

And if I may be so bold: why in the world would you not just route between the two subnets, and manage access control at the IP level?
.
I don't know alot about servers. Could you please explain that? I don't really understand that one...

[EDIT]
Ad-hoc is a possibility. I've tried it, and my cellphone sees it just like a normal WAN.
To create an ad-hoc network, with bridge to eth0, I used this:
Quote:

#!/bin/sh
if [[ $1 == 'start' ]]; then
ip link set down dev wlan0
iwconfig wlan0 mode ad-hoc
iwconfig wlan0 channel 3
iwconfig wlan0 essid adhoc-net key s:pass
ip link set up dev wlan0
ip addr add 192.168.0.50/24 dev wlan0
/etc/rc.d/dnsmasq start
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
elif [[ $1 == 'stop' ]]; then
iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
/etc/rc.d/dnsmasq stop
ip addr del 192.168.0.50/24 dev wlan0
ip link set down dev wlan0
iwconfig wlan0 essid off
iwconfig wlan0 mode managed
fi
Now, to bridge wlan0(ad-hoc) to wlan1, instead of to eth0, can I just change "iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE" to "iptables -t nat -A POSTROUTING -o wlan1 -j MASQUERADE"?

Thanks!

Credits for the script go to kazuo and hexanol from archlinux.org forums.

taoelism 10-21-2010 02:26 PM

"iptables -t nat -A POSTROUTING -o wlan1 -j MASQUERADE" yields an "Operation not supported" error, both when the interface is up and when it's down.

taoelism 10-23-2010 02:00 AM

*Bump*


All times are GMT -5. The time now is 11:09 PM.