0

I have a unique'ish problem:

Info

Actual ADLS Router with WIFI < ---- > raspberry pi router

So my raspberry pi is connected to my actual wifi from my adsl router, which provides internet access.

My raspberry pi acts as a router for an ethernet switch.

Router <------------> PI <--> switch <--> clients (and server)
|                   ||                                        |
|--192.168.8.0/24---||---------192.168.1.0/24-----------------| 

So my actual router subnet is:

  • 192.168.8.0/24

and my pi router subnet is:

  • 192.168.1.0/24

Problem:

My rapberry pi connects various devices including my home server, which is accessble via the switch. But NOT accessible over my adsl wifi.

I want to connect onto my adsl wifi with e.g. my Android device and access my server from there.

I know there should be some pre/postrouting and/or masquerading but I am not exactly sure how to implement this.

Help would be greatly appreciated

// iptables -L

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere             state NEW,RELATED,ESTABLISHED
ACCEPT     all  --  anywhere             anywhere             state NEW,RELATED,ESTABLISHED

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination 

// iptables -L -t nat

Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination         

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         

Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination         
MASQUERADE  all  --  anywhere             anywhere
0

Well, you need to open ports on raspberry Pi for the services you want to access and forward it to your server but it will void the whole point of your raspberry pi firewall/router. I think it would be better if you will get any WiFi dongle(or use built-in one if it is Raspberry Pi 3) and plug it to the raspberry Pi and set it up as access point with help of hostapd package. This way you would have a guest network provided by ADSL router and guarded private network that can be accessed over WiFi via access point(via hostapd) that running in 192.168.1.0/24 scope.

Here is a good tutorial from adafruit how to setup AP on raspberry Pi in step by step actions with screenshots.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.