DSTNAT to multiple addresses - load balancing?
Posted: Tue Dec 06, 2016 4:47 pm
Okay, so I have a requirement to redirect an inbound connection. Basically a dstnat rule, to an address.
What I'd like however is to redirect to a list of addresses, and have it round robin them in some way:-
Is something like that doable?
The idea being that I can spread the load, and possibly use some scripting / netwatch to identify if any of the destinations is offline, and disable the specific target rule, taking it out of rotation.
Note also, I don't particularly want to use a range of IP addresses (123.123.123.10-123.123.123.50), but rather a non continuous list.
Thoughts?
What I'd like however is to redirect to a list of addresses, and have it round robin them in some way:-
Code: Select all
/ip firewall nat
add action=dst-nat chain=dstnat dst-address=123.123.123.123 dst-port=25 \
in-interface=public protocol=tcp to-addresses=10.10.10.20 to-ports=25
add action=dst-nat chain=dstnat dst-address=123.123.123.123 dst-port=25 \
in-interface=public protocol=tcp to-addresses=10.10.10.30 to-ports=25
add action=dst-nat chain=dstnat dst-address=123.123.123.123 dst-port=25 \
in-interface=public protocol=tcp to-addresses=10.10.10.40 to-ports=25
add action=dst-nat chain=dstnat dst-address=123.123.123.123 dst-port=25 \
in-interface=public protocol=tcp to-addresses=10.10.10.50 to-ports=25
add action=dst-nat chain=dstnat dst-address=123.123.123.123 dst-port=25 \
in-interface=public protocol=tcp to-addresses=10.10.10.60 to-ports=25
The idea being that I can spread the load, and possibly use some scripting / netwatch to identify if any of the destinations is offline, and disable the specific target rule, taking it out of rotation.
Note also, I don't particularly want to use a range of IP addresses (123.123.123.10-123.123.123.50), but rather a non continuous list.
Thoughts?