Skip to content

Instantly share code, notes, and snippets.

@doubledouble
Created May 31, 2015 16:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save doubledouble/7723f67e18efba06f0cf to your computer and use it in GitHub Desktop.
Save doubledouble/7723f67e18efba06f0cf to your computer and use it in GitHub Desktop.
iptables
[root@Iven sysconfig]# cat iptables
# Generated by iptables-save v1.4.7 on Mon Jun 1 00:04:12 2015
*nat
:PREROUTING ACCEPT [49:4737]
:POSTROUTING ACCEPT [2:144]
:OUTPUT ACCEPT [2:144]
-A PREROUTING -p tcp -m tcp --dport 22222 -j REDIRECT --to-ports 22
COMMIT
# Completed on Mon Jun 1 00:04:12 2015
# Generated by iptables-save v1.4.7 on Mon Jun 1 00:04:12 2015
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [241:30194]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
# Completed on Mon Jun 1 00:04:12 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment