Logo Page Web Française
Accueil Association BSD Linux Dev Reseau Infologisme Mac OSX
tl tr
Subject Firewall Date 2008-09-02
Title Webmin - Configure IPTables Firewall - Fedora FC8 Section BSD Linux
Article

Linux distribution Fedora 9 or FC9 see article: Webmin - Configure IPTables Firewall - Fedora FC9

With a Linux distribution Fedora 8 or FC8.

With Webmin to click on the icon Networking then Linux Firewall, the loading of the rules take a few seconds and one obtains a following table:

For the following peripherals and services:

DNS for Bind Domain Name Server, port 53.
HTTP for Apache Web server, port 80 and 443 to be useful in SSL.
FTP for ProFTPd sever, port 21.
SSH for OpenSSH, port 22.
SMTP for Postfix or Sendmail, port 25.

eth0, eth1, eth2... etc, which is the network lan adapters, very important if the station or the waiter is behind a router or uses a network SMB.


Incoming packets (INPUT)
Select all. | Invert selection.

Action Condition Move Add
Run chain RH-Firewall-1-INPUT Always
Select all. | Invert selection.

Forwarded packets (FORWARD)
Select all. | Invert selection.

Action Condition Move Add
Reject Always
Select all. | Invert selection.

Chain RH-Firewall-1-INPUT
Select all. | Invert selection.
Action Condition Move Add
Accept If input interface is lo
Accept If input interface is eth1
Accept If protocol is ICMP and ICMP type is any
Accept If protocol is UDP and destination is 224.0.0.251 and destination port is 5353
Accept If state of connection is ESTABLISHED,RELATED
Accept If protocol is TCP and destination port is 21 and state of connection is NEW
Accept If protocol is TCP and destination port is 22 and state of connection is NEW
Accept If protocol is TCP and destination port is 25 and state of connection is NEW
Accept If protocol is TCP and destination port is 53 and state of connection is NEW
Accept If protocol is UDP and destination port is 53 and state of connection is NEW
Accept If protocol is TCP and destination port is 80 and state of connection is NEW
Accept If protocol is TCP and destination port is 443 and state of connection is NEW
Reject Always
Select all. | Invert selection.
    
Click this button to make the firewall configuration listed above active. Any firewall rules currently in effect will be flushed and replaced
Click this button to reset the configuration listed above to the one that is currently active.
Yes No Change this option to control whether your firewall is activated at boot time or not.
Click this button to clear all existing firewall rules and set up new rules for a basic initial configuration.

The respect it order of the rules is of primary importance, it is not for nothing, that one can up them or descend them!

Add the new rule, simplest is to click on Accept line concerned, for example that of the interface of entry is lo, then to publish an identical rule with the button "Cloner the rule" which is in bottom of the form, to change the interface of entry lo for example eth1, to safeguard this new rule and to assemble it in the list.


Rules File of Firewall /etc/sysconfig/iptables


# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:RH-Firewall-1-INPUT - [0:0]
-A INPUT -j RH-Firewall-1-INPUT
-A RH-Firewall-1-INPUT -i lo -j ACCEPT
-A RH-Firewall-1-INPUT -i eth1 -j ACCEPT
-A RH-Firewall-1-INPUT -p icmp --icmp-type any -j ACCEPT
-A RH-Firewall-1-INPUT -p udp --dport 5353 -d 224.0.0.251 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 25 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 53 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 53 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT
-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
# Generated by webmin
*mangle
:FORWARD ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:PREROUTING ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
COMMIT
# Completed
# Generated by webmin
*nat
:OUTPUT ACCEPT [0:0]
:PREROUTING ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
COMMIT
# Completed



Warning to the syntax of this file /etc/sysconfig/iptables

Author
Eric Douzet
Début de page
bl br
C-extra.com v. 1.2.0 © 2003-2010, all rights reserved  -  Updated September 02, 2010 Infologism.com