Fri Nov 09, 2018 4:40 pm
Lets assume WAN interface with 4 ips 24.100.20.101/102/103/104
LAN1 is 192.168.10.0/24
Machine IP is 192.168.10.50
SourceNAT Rules.
(1) add chain=srcnat action=src-nat to-addresses=24.100.20.101 out-interface=WAN
(2) add chain=srcnat src-address=192.168.10.50 action=src-nat to-addresses=24.100.20.102 out-interface=WAN
( I dont think you need to explicitly exclude the machine IP from the first rule and hoping someone else can clarify but if necessary
( (1) add chain=srcnat src-address=!machineIP action=src-nat to-addresses=IP1 out-interface=WAN
Step 1: So this explains the private to public translations to the router.
Step2: Need to tell the router the routing paths
Step3: Need to port forward - Destination NAT
Step3:
Add chain=dstnat (protocol tcp or udp) Destination address=24.100.20.102 Destination port(s) in-interface=wan action=dst-nat to-addresses=192.168.0.50
(if you can its best to limit who on the internet can access this server by creating an address list called "server access"
server access - ip1
server acess - ip2
server access - ip3
server access - ip range
and then the rule would look like
Add chain=dstnat (protocol tcp or udp) Destination address=24.100.20.102 Destination port(s) in-interface=wan \
src-address-list=server access action=dst-nat to-addresses=192.168.0.50
Step 2. Thats a bit harder, but since you dont require failover............ it may be best to.
a. mark connections for the machine IP Called "server traffic", and then associate these connections with a routing mark called "MachineMark".
b. use the routing mark in a routing rule along with preferred source of 24.100.20.102
You would need two rules,,,,,,,,,, one for the general LAN
add distance=2 dst-address=0.0.0.0/0 gateway=of WAN scope=10 preferred source=24.100.20.101
and one for the machine.
add distance=4 dst-address=0.0.0.0/0 gateway=of WAN scope=10 routing-mark=MachineMark preferred source=24.100.20.102
Notes:
1- I am not sure if one needs to put the general LAN distance lower (higher priority) as the preferred source is marked but I dont think it does any harm.
2- I am unsure of what to put in for dst-address but the OP in this case.