How can I set up Porteus as a fully wireless router?

Post here if you are a new Porteus member and you're looking for some help.
nickh
Black ninja
Black ninja
Posts: 45
Joined: 07 Mar 2011, 20:56
Location: UK

How can I set up Porteus as a fully wireless router?

Post#1 by nickh » 06 Nov 2015, 19:42

I've just booked a summer holiday to a place which allows one party a single wireless connection and this is not going to keep my kids happy. I can set up an Android device to share its bluetooth connection but its range is limited (and my device consumes power quicker than I can charge it).

I was hoping I could turn my laptop into some sort of router. It has a built-in NIC (bcm4314 type) and I have a spare USB NIC (zd1211rw). I have a small issue with the built in NIC in that it does not see my router on channel 13 (legal in the UK) but at least the Zyxel device does. I know zd1211rw supports master/AP mode but I am not sure about the bcm device.

Currently I've configured the zd device effectively as WAN, but if I can get the bcm device to see channel 13 I'd like to switch that round.

Questions:
1 - How can I get the bcm device to see channel 13?
2 - How can I set one as the NICs in Master/AP mode as a DHCP server routing through to the other NIC as gateway?
3 - Am I being over-ambitious or using the wrong distro (which must be able to run from USB live)

I have quite a lot of experience with ClearOS which is an RHEL based distro which works as a gateway so I am not a Linux newbe.

TIA,

Nick

User avatar
Ed_P
Contributor
Contributor
Posts: 8343
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Re: How can I set up Porteus as a fully wireless router?

Post#2 by Ed_P » 06 Nov 2015, 20:54

nickh wrote:I've just booked a summer holiday to a place which allows one party a single wireless connection and this is not going to keep my kids happy.
Would a wifi repeater be an easier option?
Ed

nickh
Black ninja
Black ninja
Posts: 45
Joined: 07 Mar 2011, 20:56
Location: UK

Re: How can I set up Porteus as a fully wireless router?

Post#3 by nickh » 06 Nov 2015, 20:58

Only if it can act as a router so the kids (and my) connection appear as one device. Is that possible with a repeater? I thought they just passed the connections through.

User avatar
Ed_P
Contributor
Contributor
Posts: 8343
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Re: How can I set up Porteus as a fully wireless router?

Post#4 by Ed_P » 06 Nov 2015, 21:33

To the best of my knowledge they are two routers built into one with each having their own networking capability.
Ed

roadie
Full of knowledge
Full of knowledge
Posts: 400
Joined: 02 Jan 2011, 18:41
Distribution: Porteus 5.0-RC1
Location: In a hayfield

Re: How can I set up Porteus as a fully wireless router?

Post#5 by roadie » 06 Nov 2015, 21:59

Might this help in some way?

https://linuxalfi.wordpress.com/2011/11 ... interface/

Otherwise, I would think you would need 2 cards, possibly a USB wireless card and iptables along with whatever wireless tools.

I did it years ago with Slax and a hardwired connection, I'm sure it can be done with Porteus.

nickh
Black ninja
Black ninja
Posts: 45
Joined: 07 Mar 2011, 20:56
Location: UK

Re: How can I set up Porteus as a fully wireless router?

Post#6 by nickh » 06 Nov 2015, 22:24

Two cards is not a problem. There is one built in and I have a USB WiFi dongle.

I can probably handle iptables if I can work out the auto-starting in Porteus. If the worst comes to the worst I can dump my current server's and base things on it. I may be able to copy DHCP server configs but I was hoping there would be a better way of configuring it. I've also failed to allocate a fixed IP to the AP NIC.

I am weak on wireless configuration. I did set up the dongle once as an AP in ClearOS but don't know the networking system in Porteus and I was hoping for some pointers. I am also not sure how to get traffic going from one interface to the other - perhaps just enabling ip forwarding will work.

Thanks for the guide. I'll have a look at it tomorrow.

Nick

KnallKopf
Samurai
Samurai
Posts: 134
Joined: 18 Sep 2012, 20:56
Distribution: Porteus 64bit KDE4
Location: Absurdistan

Re: How can I set up Porteus as a fully wireless router?

Post#7 by KnallKopf » 08 Nov 2015, 05:35

I thing the biggest problem is, you do not know how the barrier works.
(I mean with that how control the hotel that only one device will registrate).
How does the authenficate work ?
Is ipv4 and or ipv6 working ?
What is blocking ?
You can make a got working solution at home and on the Hotel the solution fail.

But I thing too the best way is a nat.
I have not much experience with ipv6, for this reason i leave it out of account.
If wlan0 the device that connectect to hotel and wlan1 your network interface use this:

Code: Select all

echo 1 > /proc/sys/net/ipv4/ip_forward			# enable ipv4 forwarding
iptables -t filter -A FORWARD -j ACCEPT			# allow all forward traffic
iptables -t nat -A POSTROUTING -o wlan1 -j MASQUERADE	# masquerade all traffic that go out to wlan1
but you have a lot more to do:
How do you wish to connecting on wlan1:
via ad-hoc (IBSS): It does not work on Androide (4.2 i am shure).
via access-point: Many devices will not support this mode test it via:

Code: Select all

iwconfig wlan0 mode master
if it does not work download iw and try:

Code: Select all

iw list
(it show all devices)
and look for that:

Code: Select all

Supported interface modes:
  ...
                 * AP
  ...
If it work you need hostapd to make a Access-Point.

Then you must organize the ip assign the best way is to use dnsmasq.




For using channel 13:
I thing you need the right country code:
get the aktuell country code:

Code: Select all

iw reg get
for setting the right country code:

Code: Select all

iw reg set UK
(UK is an example for United-Kingdom, 00 is the default).
but i have read that does not work on all interfaces because the country code are sometimes hardcoded in the device.

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

Re: How can I set up Porteus as a fully wireless router?

Post#8 by brokenman » 08 Nov 2015, 20:38

Don't today's smart phones do this?

Can't you just connect to a wireless connection (with your phone) and then setup your phone as a shared access point? If not then here is a tutorial.

https://wiki.archlinux.org/index.php/Internet_sharing
How do i become super user?
Wear your underpants on the outside and put on a cape.

nickh
Black ninja
Black ninja
Posts: 45
Joined: 07 Mar 2011, 20:56
Location: UK

Re: How can I set up Porteus as a fully wireless router?

Post#9 by nickh » 08 Nov 2015, 20:48

A few of replies.
1 - yes smartphones can do it but I don't have an international data package. They can also use bluetooth and bridge it to WiFi and this is my backup plan.
2 - the wl driver does not work with channels 12 and 13. It seems a popular issue. It looks like the b43 drivers are the way to go here.
3 - WiFi range extenders may be the way to go as It looks like they only present one MAC/IP address to the hotspot but I need to confirm this. They have the advantage of being much smaller than my laptop. I need to do some more reading. I also hope that I can authenticate with the hotspot this way.

I've also had a quick look at pfSense but can't get to the config screen to set up the WiFi without using the wired connection, and I don't have a spare >2GB SD card to load Zeroshell to check it out.

Thanks for everyone chipping in. I may well be back if I can't get a cheap extender to work. Also it would be a good idea to get the B43 drivers working anyway.

Post Reply