Enjoy Slackware 15.0!
Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
howtos:network_services:postfix_dovecot_mysql:email_firewall [2015/06/10 08:10 (UTC)] tim typo fix and clarification of example firewall.rules file |
howtos:network_services:postfix_dovecot_mysql:email_firewall [2018/02/06 01:17 (UTC)] astrogeek [Firewall Rules For Virtual Mail Server] |
||
---|---|---|---|
Line 8: | Line 8: | ||
<note important> | <note important> | ||
- | You should first use iptables -L to check for pre-existing rules and merge those below into your existing | + | You should first use iptables -L to check for pre-existing rules and __merge |
- | If you have no existing firewall and need to allow http and ssh, uncomment the lines for those also included here.</ | + | If you have no existing firewall and/or need to allow http and ssh, uncomment the --policy |
- | Following is a minimal set of iptables rules to provide a firewall for your email server. | + | Following is a **minimal** set of iptables rules to provide a firewall for your email server. |
< | < | ||
+ | #--policy INPUT DROP | ||
+ | #--policy FORWARD DROP | ||
+ | #--policy OUTPUT ACCEPT | ||
+ | |||
-A INPUT -m state --state INVALID -j DROP | -A INPUT -m state --state INVALID -j DROP | ||
-A INPUT -m state --state ESTABLISHED, | -A INPUT -m state --state ESTABLISHED, | ||
Line 55: | Line 59: | ||
To install these rules as your firewall save them to a text file using < | To install these rules as your firewall save them to a text file using < | ||
- | |||
- | < | ||
- | < | ||
- | :INPUT DROP [0:0] | ||
- | :FORWARD DROP [0:0] | ||
- | :OUTPUT ACCEPT [0:0] | ||
- | </ | ||
- | and to the end of the file, add < | ||
- | As per the note above, don't forget to uncomment the ssh rule if the server is not sitting in front of you, or you'll lock yourself out!</ | ||
There are many preferences for saving and loading firewall scripts. I generally use / | There are many preferences for saving and loading firewall scripts. I generally use / |