Skip to content

Commit

Permalink
ipt_ubuntu
Browse files Browse the repository at this point in the history
  • Loading branch information
ppabc committed Jun 23, 2016
1 parent 224de03 commit cbbe6bb
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions iptables/ipt_ubuntu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
/sbin/iptables -F
/sbin/iptables -X

/sbin/iptables -A INPUT -s 127.0.0.1 -d 127.0.0.1 -j ACCEPT
/sbin/iptables -A INPUT -s 127.0.0.1 -j ACCEPT
/sbin/iptables -A INPUT -s 114.114.114.114 -j ACCEPT
/sbin/iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
/sbin/iptables -A OUTPUT -j ACCEPT
/sbin/iptables -A INPUT -s 114.114.114.114 -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT

/sbin/iptables -A INPUT -j REJECT
/sbin/iptables -A FORWARD -j REJECT

iptables-save

##iptables-save >/etc/iptables.up.rules
##iptables-restore </etc/iptables.up.rules

echo ok

0 comments on commit cbbe6bb

Please sign in to comment.