Hi,
I'd like to implement load-balancing NAT between 2 NAT servers using pf and carp (FreeBSD 9.2 release). Basically I've got a lot of subscribers in private IPs, that I want to NAT with 4-5 public IPs.
Scheme:
LBNAT1 LAN (bge0): 192.168.1.1
LBNAT1 SYNC (bge2): 10.10.10.1
LBNAT1 WAN (bge1): 192.168.2.1
LBNAT2 LAN (bge0): 192.168.1.2
LBNAT2 SYNC (bge2): 10.10.10.2
LBNAT2 WAN (bge1): 192.168.2.2
LBNAT CARP0 LAN: 192.168.1.3
LBNAT CARP1 WAN: 192.168.2.3 (and alias 2.4, 2.5, 2.6, 2.7)
For the WAN side: actually I'm using public IP range, but for the description here I've replaced public IP range with private IP.
For the LAN side: I've put a /24 here for the description, but in reality it's a /18.
So my purpose is to perform load-balancing NAT. However I'm not sure about what rules I should implement:
LBNAT1 and LBNAT2: pf.conf (I'm just putting here rules and interfaces definitions concerning NAT and CARP)
Is anyone trying to implement something like this? And will pf use the IP alias of carp1 to perform NAT too, or only the main IP on carp1?
Let me know your thoughts about it, thanks guys
I'd like to implement load-balancing NAT between 2 NAT servers using pf and carp (FreeBSD 9.2 release). Basically I've got a lot of subscribers in private IPs, that I want to NAT with 4-5 public IPs.
Scheme:
LBNAT1 LAN (bge0): 192.168.1.1
LBNAT1 SYNC (bge2): 10.10.10.1
LBNAT1 WAN (bge1): 192.168.2.1
LBNAT2 LAN (bge0): 192.168.1.2
LBNAT2 SYNC (bge2): 10.10.10.2
LBNAT2 WAN (bge1): 192.168.2.2
LBNAT CARP0 LAN: 192.168.1.3
LBNAT CARP1 WAN: 192.168.2.3 (and alias 2.4, 2.5, 2.6, 2.7)
For the WAN side: actually I'm using public IP range, but for the description here I've replaced public IP range with private IP.
For the LAN side: I've put a /24 here for the description, but in reality it's a /18.
So my purpose is to perform load-balancing NAT. However I'm not sure about what rules I should implement:
LBNAT1 and LBNAT2: pf.conf (I'm just putting here rules and interfaces definitions concerning NAT and CARP)
Code:
extcarp_if = "carp1"
int_if = "bge0"
ext_if = "bge1"
syn_if = "bge2"
table <POOL_SUBS1> { 192.168.1.0/24 }
nat pass log on $ext_if from <POOL_SUBS1> to any -> $extcarp_if source-hash
#CARP SYNCHRO
pass quick on { syn_if } proto pfsync keep state (no-sync)
pass on { int_if ext_if } proto carp keep state
Is anyone trying to implement something like this? And will pf use the IP alias of carp1 to perform NAT too, or only the main IP on carp1?
Let me know your thoughts about it, thanks guys