Skip to content

Instantly share code, notes, and snippets.

@fay
Last active October 11, 2015 17:08
Show Gist options
  • Save fay/3891856 to your computer and use it in GitHub Desktop.
Save fay/3891856 to your computer and use it in GitHub Desktop.
iptables
加入白名单:
sudo iptables -I INPUT -i lo -p tcp -s 192.168.1.0/24 -j ACCEPT --dport 6379
删除规则:
sudo iptables -D INPUT 2
拒绝某个端口的任何访问,黑名单:
sudo iptables -A INPUT -p tcp --dport 6379 -j REJECT
端口转发:
iptables -t nat -A OUTPUT -p tcp -d 10.0.2.15 --dport 8001 -j DNAT --to 127.0.0.1:8000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment