Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

i need to do a setting a bit unusual.

I have 3 machines with public Ips. I want to use one of them as a load balancer for the 2 others.

My machine >> machine1 who redirect the connection to machine 2 or 3.

If machine1 has 1 private ip on a network card and another network card with a public ip it work without any problem using very simple rules like :

share|improve this question
1  
umm... like what? –  xenoterracide Jun 25 '11 at 5:29
    
Please add more details and clarify the question or suggest it for deletion. The quality is so low as to be unhelpful for others searching for pf help. –  polynomial Sep 23 '11 at 6:58
add comment

1 Answer

I'm having a hard time understanding exactly what you want to do here... a network diagram and more detail would be extremely helpful. To redirect traffic using pf you need to use the rdr-to directive.

Here's an example where I'm redirecting traffic through my firewall to my webserver on the other side:

# redirect external web traffic to darkstat
pass in log on $ext_if inet proto tcp to ($ext_if) port 8080 \
rdr-to 192.168.0.250 port 80

(I'm using NAT so these rules look a little different than if you were just matching and redirecting ingress traffic... see the manpage for details).

To do basic Layer-3/4 load balancing you might try something like this. If you need a Layer-7 aware approach consider using relayd.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.