You are not logged in.
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!
Offline
Well, one solution I see would be to:
set up one of your wireless interface to create an ad-hoc network (or as an AP, but it's fairly more complex to setup from my experience).
then set-up your computer to NAT the traffic coming from the ad-hoc network
the other computers would then connect to the ad-hoc wireless network
you would then need to configure these computers to route their traffic through your computer
Step 1 is doable with iwconfig.
Step 2 is doable with iptables...
Step 3 is doable with iwconfig (if the other computers are running Linux)
Step 4 is doable with ipconfig/route (or you could set up a DHCP server listening on the ad-hoc wireless interface to simplify the configuration on the remote host).
Note that it won't be a really secure solution since you can only use WEP or no encryption on ad-hoc wireless network.
Offline
Thanks for the reply, but I am looking for something that looks like an acces point, so that cellphones, ipod's, etc can connect to it too.
Is that possible?
Last edited by rayman (2010-10-21 05:18:40)
Offline
Thanks for the reply, but I am looking for something that looks like an acces point, so that cellphones, ipod's, etc can connect to it too.
Is that possible?
This is dependent of how much dumb is your cellphones (note: I have a symbian, so I think that all cellphones are dumb =]).
If you put a adhoc+dhcp server probably the cellphone/ipod will use it as AP transparently as if its not a adhoc, my Nokia 5530 (a symbian s60v5) do this. Windows too (I used to play Counter Strike over adhoc with Windows friends), and Windows is more dumb than my cellphone XD
I'm posting a small 'script' I use
#!/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
In this case ppl connected to the adhoc network (at wlan0 with the creative ESSID of "adhoc-net") get the network of the eth0 connection
EDIT: To give the answer credit this is exact the outline that hexanol give, but I migrated to iproute2 from net-tools because the later is deprecated
Last edited by kazuo (2010-10-21 06:20:42)
Offline
Thanks!
My cellphone can see the access point. But, how do I bridge the interface instead of from eth0 to wlan0 from wlan1 to wlan0?
By just changing "iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE" into "iptables -t nat -A POSTROUTING -o wlan1 -j MASQUERADE"?
Thanks
[EDIT]"iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE" yields "Operation not supported".
Is there any other way?
Last edited by rayman (2010-10-21 19:24:22)
Offline
I don't know much about iptables, so I couldn't tell you exactly why you are getting this error, but I suspect this to be easily fixable.
Offline