Welcome to the Slackware Documentation Project

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Last revision Both sides next 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 00:58 (UTC)]
astrogeek Removed UFW syntax added by others - added policy lines
Line 14: Line 14:
  
 <​code>​ <​code>​
 +--policy INPUT DROP
 +--policy FORWARD DROP
 +--policy OUTPUT DROP
 +
 -A INPUT -m state --state INVALID -j DROP -A INPUT -m state --state INVALID -j DROP
 -A INPUT -m state --state ESTABLISHED,​RELATED -j ACCEPT -A INPUT -m state --state ESTABLISHED,​RELATED -j ACCEPT
Line 55: Line 59:
  
 To install these rules as your firewall save them to a text file using <​code>​iptables-save >/​etc/​firewall.rules</​code>​ then load that file using iptables-restore as shown below. This will replace any currently existing iptables rules with those in the file. To install these rules as your firewall save them to a text file using <​code>​iptables-save >/​etc/​firewall.rules</​code>​ then load that file using iptables-restore as shown below. This will replace any currently existing iptables rules with those in the file.
- 
-<​note>​If you get a "line 1 failed"​ error message you probably tried using the above example for your firewall.rules file. If you want to do this, you will need to add the following to the beginning of the file  
-<​code>​*filter 
-:INPUT DROP [0:0] 
-:FORWARD DROP [0:0] 
-:OUTPUT ACCEPT [0:0] 
-</​code>​ 
-and to the end of the file, add <​code>​COMMIT</​code>​ on a line on its own. 
-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!</​note>​ 
  
 There are many preferences for saving and loading firewall scripts. I generally use /​etc/​firewall.rules for my own systems and will use that for this example. There are many preferences for saving and loading firewall scripts. I generally use /​etc/​firewall.rules for my own systems and will use that for this example.

In Other Languages
QR Code
QR Code howtos:network_services:postfix_dovecot_mysql:email_firewall (generated for current page)