I'm looking for a command I can use via ssh to temporarily disconnect or block all IP connections except for mine. Something similar to blackholing, but for all connections rather than individual IPs.
I found this command, which does disconnect all incoming IPs, but it also disconnects my ssh connection:
I tried adding a pass in for my IP, but it returns a stdin:1: syntax error:
Is there a way to modify this to maintain my ssh connection whilst temporarily disconnecting all other IPs?
Thanks in advance.
I found this command, which does disconnect all incoming IPs, but it also disconnects my ssh connection:
echo "block in all" | pfctl -f -
I tried adding a pass in for my IP, but it returns a stdin:1: syntax error:
echo "block in all" "pass in from <my IP> to any" | pfctl -f -
Is there a way to modify this to maintain my ssh connection whilst temporarily disconnecting all other IPs?
Thanks in advance.