GastroGeek
Posts: 1
Joined: Sat Oct 04, 2014 10:39 pm

Primary and Secondary Network (Subnetwork?) with RPi

Sat Oct 04, 2014 11:13 pm

Hi all,

Firstly, I realise there are umpteen tutorials on this all over the net (these forums included) but I have tried as many as my fingers will allow me to type and I only have about one more attempt in me until I crack!

Anyways, this is what I am trying to achieve and the hardware I have:

Hardware
1x Standard router
1x RPi (with Edimax WiFi and LAN connection direct to router)
1x RPi (with Edimax WiFi - I want this one to be a server, visible to the outside world eventually)

What am I trying to do?
In short, I want to use 1x RPi as a sort of router/access-point with VLAN capabilities or something similar to set up a subnetwork from my main network. i.e I want to be able to have my normal ADSL/broadband router serving out IPs via DHCP as normal - all sat behind the router firewall...

...then... I want to port-foward all traffic on 8080/80 and 22 (SSH) etc to my router-RPi (say on 192.168.0.2). This will in turn create it's own subnetwork completely isolated from the main network (different subnet?) and serve out its own IPs via its own DHCP server to anything I connect to this access point. So... anything I connect to this router-RPi will be visible to the world but will not be able to access any other device or resource on my main network. i.e. this must be totally isolated..

I hope this makes sense. It has been driving me nuts of late so hoping you guys would be able to help. Please :)

Image

elatllat
Posts: 1337
Joined: Sat Dec 17, 2011 5:05 pm

Re: Primary and Secondary Network (Subnetwork?) with RPi

Sun Oct 05, 2014 2:46 am

2 iptables rules will keep your sub-nets isolated, something like this:

Code: Select all

iptables -A INPUT -s 192.168.0.0/24 -d 192.168.1.0/24 -j DROP 
iptables -A INPUT -d 192.168.0.0/24 -s 192.168.1.0/24 -j DROP 
SBC with 32GB RAM: https://hardkernel.com

FAQ : https://raspberrypi.stackexchange.com

Unanswered: https://www.raspberrypi.org/forums/search.php?search_id=unanswered

Return to “Advanced users”