I have a network attached storage (NAS) implemented with a Raspberry Pi computer that connects to two different Wi-Fi networks, depending on its location (it is not anchored always in the same place). Normally, these Wi-Fi networks provide internet access to the computers connected to them. I cannot modify the settings of the Wi-Fi networks. For security reasons, I would like to configure the NAS such that
Is this possible? What is the best way to do it? I am not very knowledgeable about networks, so sorry if this is something that may be trivial.
I am trying with
However, it blocks not only the internet access but also the LAN access.
- it completely rejects any internet connection in both directions, no matter which Wi-Fi network it connects to, and
- it remains accessible from the Wi-Fi LAN.
Is this possible? What is the best way to do it? I am not very knowledgeable about networks, so sorry if this is something that may be trivial.
I am trying with
iptables
:
Bash:
iptables -A INPUT -s $NETWORK_ADDRESS/$MASK -j ACCEPT
iptables -A INPUT -j DROP
iptables -A OUTPUT -d $NETWORK_ADDRESS/$MASK -j ACCEPT
iptables -A OUTPUT -j DROP
Last edited: