[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [openbsd-france-misc] petit conseil sur pf & rdr
Bonjour,
On Fri, Jun 04, 2004 at 11:39:02AM +0200, Patrick Noel wrote:
> dans pf.conf j'utilise rdr pour rediriger les requettes externe http
> vers un serveur interne. Pour autoriser l'http à entrer (si j'ai bien
> compris) il y a deux methodes :
>
> ext_if : interface externe
> dmz_if : interface interne
> http_www : adresse externe du serveur http
> http_dmz : adresse interne du serveur http
>
> rdr on ext_if proto tcp from any to $http_www port 80 -> $http_dmz port
> 80
>
> et
>
> pass in on ext_if proto tcp from any to $http_dmz port 80 keep state
> pass out on dmz_if proto tcp from any to $http_dmz port 80 keep state
>
>
> ou
>
> rdr pass on ext_if proto tcp from any to $http_www port 80 -> $http_dmz
> port 80
>
> et
>
> pass out on dmz_if proto tcp from any to $http_dmz port 80 keep state
Les 2 solutions sont équivalentes : la règle de translation "rdr pass on
ext_if proto tcp from any to $http_www port 80 -> $http_dmz port 80"
équivaut à la règle de translation + règle 'pass in' (avec suivi de
connexion).
Extrait de pf.conf :
Packets that match a translation rule are only automatically passed if
the pass modifier is given, otherwise they are still subject to block
and pass rules.
The state entry created permits pf(4) to keep track of the original ad-
dress for traffic associated with that state and correctly direct
return traffic for that connection.
Libre à vous de choisr une solution ou l'autre suivant la lisibilité
voulue pour vore conf PF.
A++ Foxy
--
Laurent Cheylus <foxy AT free POINT fr> OpenPGP ID 0x5B766EC2