example of nat/rdr rules for load balancing

From: sam (samwun_at_hgcbroadband.com)
Date: 06/26/04


Date: Sat, 26 Jun 2004 11:53:47 +0800

Hi,

I m not sure the following rules are defined correct or not, I will test
it later.

nat on $ext_if from $int_net to any -> \
         { 10.1.2.1, 10.1.2.3 } round-robin sticky-address
rdr on $ext_if from any to $ext_if -> \
         { 192.168.0.4/30 } random sticky-address

pass in on $ext_if proto tcp to $webserver-1 port www flags S/SA \
         keep state (source-track, max-src-states 3, max-src-nodes 10)
pass in on $ext_if proto tcp to $webserver-2 port www flags S/SA \
         keep state (source-track, max-src-states 3, max-src-nodes 10)

If I use the rdr rule as described above, can I get rid of all of the
specific rdr rules as illustrated below?

rdr on $ext_if proto tcp \
         from any to $ext_ip/32 port 25 -> 192.168.0.1 port 25
rdr on $ext_if proto tcp \
         from any to $ext_ip/32 port 20 -> 192.168.0.1 port 20
rdr on $ext_if proto tcp \
         from any to $ext_ip/32 port 21 -> 192.168.0.1 port 21
rdr on $ext_if proto tcp \
         from any to $ext_ip/32 port 110 -> 192.168.0.1 port 110
rdr on $ext_if proto tcp \
         from any to $ext_ip/32 port 143 -> 192.168.0.1 port 143
rdr on $ext_if proto tcp \
         from any to $ext_ip/32 port 53 -> 192.168.0.1 port 53
rdr on $ext_if proto tcp \
         from any to $ext_ip/32 port 2222 -> 192.168.0.1 port 22

Thanks
sam

Thanks
sam



Relevant Pages

  • PF DMZ and Webserver question
    ... and my webserver is accessible from the ... rdr on $ext_if proto tcp from any to ... traffic between int_net and dmz servers ...
    (comp.unix.bsd.openbsd.misc)
  • Re: example of nat/rdr rules for load balancing
    ... sam wrote: ... > set timeout src.track 900 ... If I use the rdr rule as described above, can I get rid of all of the ... rdr on $ext_if proto tcp \ ...
    (comp.unix.bsd.freebsd.misc)
  • Re: pf and ftp from gateway
    ... no rdr on $int_if proto tcp to $int_ip port ftp ... destination IP is the LAN-IP of the gateway machine". ...
    (comp.unix.bsd.openbsd.misc)
  • ftpd: Passive mode isnt working
    ... # cat /etc/inetd.conf ... rdr on $int_if proto tcp from any to any \ ... from any to port 53 ...
    (freebsd-questions)
  • example of nat/rdr rules for load balancing
    ... pass in on $ext_if proto tcp to $webserver-2 port www flags S/SA \ ... set timeout src.track 900 ...
    (comp.unix.bsd.freebsd.misc)