LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices



Reply
 
Search this Thread
Old 10-20-2010, 02:32 PM   #1
taoelism
LQ Newbie
 
Registered: Oct 2010
Posts: 4

Rep: Reputation: 0
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!

Last edited by taoelism; 10-21-2010 at 05:02 AM.
 
Old 10-20-2010, 05:27 PM   #2
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora, Lubuntu, FreeBSD
Posts: 3,930
Blog Entries: 5

Rep: Reputation: Disabled
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?
 
Old 10-21-2010, 01:15 AM   #3
taoelism
LQ Newbie
 
Registered: Oct 2010
Posts: 4

Original Poster
Rep: Reputation: 0
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 sass
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.

Last edited by taoelism; 10-21-2010 at 05:06 AM.
 
Old 10-21-2010, 03:26 PM   #4
taoelism
LQ Newbie
 
Registered: Oct 2010
Posts: 4

Original Poster
Rep: Reputation: 0
"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.
 
Old 10-23-2010, 03:00 AM   #5
taoelism
LQ Newbie
 
Registered: Oct 2010
Posts: 4

Original Poster
Rep: Reputation: 0
*Bump*
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Creating the bridge between SketchUp and Eclipse LXer Syndicated Linux News 0 04-15-2009 04:30 PM
Creating a bridge from ADSL router to WLAN router linuxlainen Linux - Networking 7 02-12-2009 12:20 PM
Trouble creating network bridge amhso Linux - Networking 6 01-20-2007 09:46 PM
creating a cron(tab) scheduled thing student04 Linux - Software 5 12-26-2004 10:18 PM
Having problems creating a network bridge. Royle Linux - Networking 1 08-16-2004 10:22 AM


All times are GMT -5. The time now is 12:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration