

However, if your two networks use the same subnet (e.g. I haven't personally set up ncat that way but it will probably just work, especially if you specify the IP address to listen on as part of the -l option. two Ethernet ports or an Ethernet + WiFi). Since you're connecting to 2 networks, I assume your Pi has two network interfaces (e.g. In your case, just make sure it allows everything. Using NAT would allow you to access all devices on the private network, though it's kind of ugly in principle.įinally, use the Pi's firewall rules (iptables 'FORWARD' chain) to decide what can be accessed. either add the route on the PC, or enable SNAT (aka masquerading) in the Pi.
RASPBERRY PI 3 FIREWALL BUILDER PC
This lets the reply packets from the PC travel back to your laptop. Similarly, if the "Private Network's" main router supports defining static routes, also create one towards the public network, again with the Pi as gateway. If the router does not support that, then the same route would need to be added on your laptop (and would only allow connections from the laptop). (Specifically, the Pi's " public network" address – the one that's facing the router you're configuring – is the one that goes in the "gateway" field.) If the "Public Network's" main router supports defining static routes, create one towards the opposite network with the Pi as gateway. This basically enables the "router" feature. If your Raspberry Pi is directly connected to both networks – and if both networks use different addresses – you can just think of it as a router, as connecting two networks is exactly what a router does.Įnable the "IP forwarding" setting in Linux via sysctl.
