Bosse_B
Posts: 981
Joined: Thu Jan 30, 2014 9:53 am

Using Pi as relay between networks?

Wed Oct 15, 2014 3:07 am

Is it possible to use two Pi as some kind of relay between networks?
Say I have an Internet connection to one building on the property and there is another about 100 m away that I also want to be connected but I don't want to pull a network cable across.
Could I use two Pi units as some kind of bridge between the two using a WiFi link?
For example if I use a cantenna in each end and have the Pi WiFi adapter located in each cantenna to talk to the other end, would this be a way to connect the two buildings as a network?

I guess it would be doable, but how can I do it with a couple of Pi units to route the traffic from the remote building through to the Internet?
I really need to get to grips with the configuration on each of the two Pi units....

Ideally the remote building would have its own WiFi router that is fed by the link to the first building as its Internet connection. So all devices connected to the remote building WiFi would have an Internet connection via the network on the first building.
Bo Berglund
Sweden

W. H. Heydt
Posts: 12656
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Using Pi as relay between networks?

Thu Oct 16, 2014 4:04 am

That's called a "bridge" if it just passes all packet from each network to the other. If it's smart enough to only pass packets addressed to devices that are not on the local network, it would be a "router".

User avatar
lmarmisa
Posts: 1265
Joined: Thu Feb 14, 2013 2:22 am
Location: Jávea, Spain

Re: Using Pi as relay between networks?

Thu Oct 16, 2014 8:34 am

Your idea is doable.

You should use at least one wifi dongle supporting the AP (Access Point) feature. This is very important. Remember that the RPi software does not support all the wifi dongles. So, the selection of the suitable dongles is a very important point.

If you plan to have two networks, I recommend a routed solution. You should assign two subnets numbers (for example 192.168.1.0/24 to first building; 192.168.2.0/24 to second building).

The classical and very powerfull firmware for routers named OpenWRT is available for RPi:

http://wiki.openwrt.org/toh/raspberry_pi

If you prefer to use a standard raspbian solution on your two RPIs, you have many tutorials about wifi routers with RPi:

http://raspberrypihq.com/how-to-turn-a- ... fi-router/
http://jacobsalmela.com/raspberry-pi-an ... -a-router/
http://www.pi-point.co.uk/

Anyway, your project is feasible but not trivial. You do not need to be an expert in networks but you will need to know (or learn) some basic concepts related to wireless networks and routing or switching. So, I hope this will be a funny project.

drgeoff
Posts: 10765
Joined: Wed Jan 25, 2012 6:39 pm

Re: Using Pi as relay between networks?

Fri Oct 17, 2014 3:06 pm

Doable but you probably find that buying ready-made items to do the job will be cheaper than RPis plus SD cards plus PSUs plus Wi-Fi dongles plus casings and less hassle.

Bosse_B
Posts: 981
Joined: Thu Jan 30, 2014 9:53 am

Re: Using Pi as relay between networks?

Fri Oct 17, 2014 5:10 pm

After reading the replies here and also a private message directing me towards a TP-LINK product I started a more extensive Google search and found a lot of suggestions there.
What I now would like to do is to attach a separate wifi router to the main router and set it up for a new SSID and different DHCP addresses. Then I would hook its antenna connection to a directional antenna pointing at the remote place. At that place I would use a range extender like the TP-LINK one such that the WiFi strength at that location is good.
This would essentially make two networks out of one and enable the remote site to use the Internet routed through the first network. I think the extra router at the main house is needed so that I can use a directional antenna there.

Anyway, this turned out to no longer need a Pi so I guess it becomes OT for this forum?
Bo Berglund
Sweden

Return to “Advanced users”