You are not logged in.

#1 2013-12-13 17:39:01

~slice
Member
From: Arizona
Registered: 2007-10-31
Posts: 58

Connecting to availible hotspots and feeding to ethernet?

Not looking for a full walk through, just need someone to point me in the right direction and maybe a few keywords.

So me and my girlfriend both have hotspots and no cable/modem service at my place. So my goal is to take my Raspberry Pi with Arch installed add a usb Wi-Fi and have it pick up the hotspots and feed it out the Ethernet to my router.

Key features that I am looking for:
- Ability to prioritize which hotspot to pick up (I have unlimited data)
- Ability to block/enable ports dependent on what hotspot is connected (I don’t want my usenet downloading on her hotspot)


Again any input towards programs to use or files and keywords for my research is greatly appreciated.


There are 10 types of peaple in the world. Those who know binary and those that don't.

Offline

#2 2013-12-13 20:18:07

clfarron4
Member
From: London, UK
Registered: 2013-06-28
Posts: 2,165
Website

Re: Connecting to availible hotspots and feeding to ethernet?

I've never thought about the Raspberry Pi, but isn't based on the ARM architecture? If so, you might want to ask on the ArchLinux ARM forums.


Claire is fine.
Problems? I have dysgraphia, so clear and concise please.
My public GPG key for package signing
My x86_64 package repository

Offline

#3 2013-12-13 20:55:47

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,424

Re: Connecting to availible hotspots and feeding to ethernet?

You would just read up on the internet sharing wiki.  It should be about the same for the raspberry pi as the regular arch.


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#4 2013-12-13 23:05:12

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,965
Website

Re: Connecting to availible hotspots and feeding to ethernet?

Is this helpful?


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#5 2013-12-13 23:56:23

~slice
Member
From: Arizona
Registered: 2007-10-31
Posts: 58

Re: Connecting to availible hotspots and feeding to ethernet?

All of the config stuff is generally the same on the arm architecture. I came here for the Networking Gurus. Thanks nomorewindows I didn't even know that existed. Good stuff Xyne, I like pictures. I'll go through all of that and see what I can setup. Any other input is appreciated.


There are 10 types of peaple in the world. Those who know binary and those that don't.

Offline

#6 2013-12-14 02:20:03

mrinx
Member
From: Richmond, VA
Registered: 2013-08-01
Posts: 87
Website

Re: Connecting to availible hotspots and feeding to ethernet?

As nomorewindows mentioned, internet sharing wiki page is a good place to start.

You can write your own service file for the raspbery, somewhere there will be

ExecStart=/usr/bin/ip link set eth0 up
ExecStart=/usr/bin/ip addr add 192.168.7.1/24 dev eth0
ExecStart=/usr/bin/sysctl net.ipv4.ip_forward=1
ExecStart=/usr/bin/iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE

ExecStop=...
Try to write the ExecStops by yourself.
Then the easiest way is to set static IP for WAN port on your router, IP 192.168.7.2, mask 255.255.255.0, gateway 192.168.7.1 (it would be wasting of resources to run DHCP server just for one client).

The solution above doesn't solve your key features though, but I think it's a good start.

How do you want to prioritize what hotspot to pick up, do you have some algorithm for it on your mind?
Blocking of ports is easy with iptables, you just have to find out how to determine what hotspot you are connected to. I would say it's related to prioritizing your hotspots, as you would probably like to change it anytime when the Pi change the AP that it is connected to.


English isn't my first language.
Is Arch Linux user called archer? Where are our bows and arrows?

Offline

#7 2013-12-15 14:52:53

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,424

Re: Connecting to availible hotspots and feeding to ethernet?

mrinx wrote:

As nomorewindows mentioned, internet sharing wiki page is a good place to start.

You can write your own service file for the raspbery, somewhere there will be

ExecStart=/usr/bin/ip link set eth0 up
ExecStart=/usr/bin/ip addr add 192.168.7.1/24 dev eth0
ExecStart=/usr/bin/sysctl net.ipv4.ip_forward=1
ExecStart=/usr/bin/iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE

ExecStop=...
Try to write the ExecStops by yourself.
Then the easiest way is to set static IP for WAN port on your router, IP 192.168.7.2, mask 255.255.255.0, gateway 192.168.7.1 (it would be wasting of resources to run DHCP server just for one client).

The solution above doesn't solve your key features though, but I think it's a good start.

How do you want to prioritize what hotspot to pick up, do you have some algorithm for it on your mind?
Blocking of ports is easy with iptables, you just have to find out how to determine what hotspot you are connected to. I would say it's related to prioritizing your hotspots, as you would probably like to change it anytime when the Pi change the AP that it is connected to.

Just write a netctl script for this purpose, and save your iptables for later, just starting iptables when you need it.


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#8 2013-12-15 14:56:05

mrinx
Member
From: Richmond, VA
Registered: 2013-08-01
Posts: 87
Website

Re: Connecting to availible hotspots and feeding to ethernet?

I believe he can't get the internet through without iptables.


English isn't my first language.
Is Arch Linux user called archer? Where are our bows and arrows?

Offline

#9 2013-12-15 15:38:06

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,424

Re: Connecting to availible hotspots and feeding to ethernet?

mrinx wrote:

I believe he can't get the internet through without iptables.

He doesn't need iptables masquerade until he is routing traffic through the raspberry pi for other clients.  There are still default iptables when not in use.


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#10 2013-12-15 17:46:04

mrinx
Member
From: Richmond, VA
Registered: 2013-08-01
Posts: 87
Website

Re: Connecting to availible hotspots and feeding to ethernet?

nomorewindows wrote:

until he is routing traffic through the raspberry pi for other clients.

But that is exactly what he wants to do.


English isn't my first language.
Is Arch Linux user called archer? Where are our bows and arrows?

Offline

#11 2013-12-15 23:27:39

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,424

Re: Connecting to availible hotspots and feeding to ethernet?

mrinx wrote:
nomorewindows wrote:

until he is routing traffic through the raspberry pi for other clients.

But that is exactly what he wants to do.

Then you just leave iptables enabled through systemd, given that he has saved his iptables.rules  Also enable the netctl profile so that it assigns itself the same IP configuration each time.  No problem there, just much more standard to do it this way.  Don't forget to set the ipv4.forwarding option in /etc/sysctl/sysctl.conf.

Last edited by nomorewindows (2013-12-15 23:33:11)


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

Board footer

Powered by FluxBB