[FreeBSD] firewall et nat

firewall et nat [FreeBSD] - Linux et OS Alternatifs

Marsh Posté le 28-04-2002 à 12:06:52    

1)
cd /usr/src/sys/i386/conf
cp GENERIC FIREWALL
 
j'y rajoute :
 
options IPFIREWALL
options IPFIREWALL_VERBOSE
options IPFIREWALL_VERBOSE_LIMIT=100
options IPDIVERT
options TCP_RESTRICT_RST  (pour le synflood)
options TCP_DROP_SYNFIN    (pour empêcher le nmap, mais pas conseillé dans LINT pour un webserver, qu'en pensez-vous ?)
 
2)
/etc/rc.conf
firewall_enable="YES"
firewall_script="/etc/firewall/fwrules"
natd_enable="YES"
natd_interface="ed0" (ed0 étant connectée au net)
natd_flags=""
 
3)
/etc/firewall/fwrules
mkdir /etc/firewall
vi fwrules
fwcmd="/sbin/ipfw"  
$fwcmd -f flush
$fwcmd add divert natd all from any to any via ed0  
$fwcmd add allow ip from any to any via lo0
$fwcmd add allow ip from any to any via fxp0 (fxp0= interface interne)
 
$fwcmd add allow tcp from any to any out xmit ed0 setup  
 
$fwcmd add allow tcp from any to any via ed0 established  
 
$fwcmd add allow tcp from any to any 80 setup
$fwcmd add allow tcp from any to any 22 setup  
$fwcmd add allow tcp from any to any 21 setup  
 
$fwcmd add reset log tcp from any to any 113 in recv ed0  
 
$fwcmd add allow udp from any to x.x.x.x 53 out xmit ed0  
$fwcmd add allow udp from x.x.x.x 53 to any in recv ed0
 
(comme j'hoste mon primary ns, comment ca se passe ? et comment permettre aux dns2 et dns3 (les slaves) de se connecter pour vérifier le serial de bind ?)
 
$fwcmd add 65435 deny log ip from any to any (je deny le reste)
 
4)
/usr/local/etc/rc.d
je rajoute :
natd -interface ed0
 
5)
reboot :)
 
C'est un mix de ce que j'ai pu trouver sur le net mais j'aimerais savoir si ca fonctionnerait (car je sais pas le tester ici) pour partager ma connection et sécuriser ma passerelle qui fait serveur web, serveur ftp et hostant mon dns.
J'ai une ip fixe.
Merci de votre aide

Reply

Marsh Posté le 28-04-2002 à 12:06:52   

Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed