Difference between revisions of "Configuring iptables"
Jump to navigation
Jump to search
PeterHarding (talk | contribs) (New page: =IMAP= * http://www.cyberciti.biz/tips/linux-iptables-13-how-to-allowopen-imap-serverprotocol.html) |
PeterHarding (talk | contribs) |
||
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
=IMAP= | =IMAP= | ||
Runs on port 143, so... | |||
<pre> | |||
iptables -A INPUT -p tcp -s 0/0 --sport 1024:65535 -d 202.54.1.20 --dport 143 -m state --state NEW,ESTABLISHED -j ACCEPT | |||
iptables -A OUTPUT -p tcp -s 202.54.1.20 --sport 143 -d 0/0 --dport 1024:65535 -m state --state ESTABLISHED -j ACCEPT | |||
</pre> | |||
See: | |||
* http://www.cyberciti.biz/tips/linux-iptables-13-how-to-allowopen-imap-serverprotocol.html | * http://www.cyberciti.biz/tips/linux-iptables-13-how-to-allowopen-imap-serverprotocol.html | ||
=Flushing Rules= | |||
<pre> | |||
#!/bin/sh | |||
echo "Stopping firewall and allowing everyone..." | |||
iptables -F | |||
iptables -X | |||
iptables -t nat -F | |||
iptables -t nat -X | |||
iptables -t mangle -F | |||
iptables -t mangle -X | |||
iptables -P INPUT ACCEPT | |||
iptables -P FORWARD ACCEPT | |||
iptables -P OUTPUT ACCEPT | |||
</pre> | |||
See: | |||
* http://www.cyberciti.biz/tips/linux-iptables-how-to-flush-all-rules.html | |||
[[Category:Firewalls]] |
Latest revision as of 12:33, 3 June 2016
IMAP
Runs on port 143, so...
iptables -A INPUT -p tcp -s 0/0 --sport 1024:65535 -d 202.54.1.20 --dport 143 -m state --state NEW,ESTABLISHED -j ACCEPT iptables -A OUTPUT -p tcp -s 202.54.1.20 --sport 143 -d 0/0 --dport 1024:65535 -m state --state ESTABLISHED -j ACCEPT
See:
Flushing Rules
#!/bin/sh echo "Stopping firewall and allowing everyone..." iptables -F iptables -X iptables -t nat -F iptables -t nat -X iptables -t mangle -F iptables -t mangle -X iptables -P INPUT ACCEPT iptables -P FORWARD ACCEPT iptables -P OUTPUT ACCEPT
See: