Created
September 9, 2012 03:25
-
-
Save IvanTorresEdge/3682393 to your computer and use it in GitHub Desktop.
IP Tables for Postgresql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # become root | |
| sudo -i | |
| # flush all existing rules | |
| iptables -F | |
| # Accept traffic from existing connections | |
| iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT | |
| # accept SSH connections | |
| iptables -A INPUT -p tcp --dport ssh -j ACCEPT | |
| # allow connections from our servers | |
| iptables -A INPUT -i eth1 -p tcp -s 000.000.000.000 --dport 5432 -j ACCEPT | |
| # drop the remaining traffic | |
| iptables -A INPUT -j DROP | |
| # listen for loopback traffic | |
| iptables -I INPUT 1 -i lo -j ACCEPT | |
| # list rules | |
| iptables -L -v | |
| # store iptables rules | |
| iptables-save > /etc/iptables.rules | |
| # finish root session | |
| exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment