Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #
- # Blocks list of IP addresses using macOS/BSD PF firewall.
- #
- # Enable: sudo pfctl -ef ./pf_block.conf
- #
- # Disable: sudo pfctl -d (completely disable firewall)
- # sudo pfctl -f /etc/pf.conf (reset rules)
- #
- blocked_ips = "{ \
- 1.2.3.4 \
- 5.6.7.8 \
- }"
- set block-policy return
- block out proto tcp to { $blocked_ips } port { 80, 443 }
Add Comment
Please, Sign In to add comment