Hi there,
I hope I can find help here, because I’m stuck in combining functions…
First of all, I setup a RB450G and did all the basic things like added user and basic network configuration and here is what I would like to do:
I need to setup a system that acts as a server for the ip-address 192.168.2.10 port 5001 from the client address 192.168.2.5. My first task is to “shield” my physical server from the physical client network, what I used the router for. So what I did was adding a destinating NAT the passes the connection attempt through my router and translates the address.
/ip firewall nat add chain=dstnat dst-address=192.168.2.10 protocol=tcp dst-port=5001 action=dst-nat to-addresses=10.0.0.1 to-ports=5001 comment="destination nat"
What should work fine.
But it is unfortunately a bit more complicated. For redundancy reasons, there is not just one target behind the firewall to connect to. There are 4 computers, from what just one is active acting as server (they are powered up all the time) at the time and there is where I got stuck. I found an firewall configuration example where a “knock” is used as trigger event to openning the access to the router and finaly the internet.
My idea was to use this trigger event to change the NAT configuration.
Basically I ould like to use:
/ip firewall filter add chain=input protocol=tcp dst-port=1337 action=add-src-to-address-list address-list=server1 address-list-timeout=1m comment="" disabled=no
For the example 10.0.0.1 to 10.0.0.4 are my server addresses and 10.0.0.6 is the router address.
I also added 4 NAT configurations:
/ip firewall nat add chain=dstnat dst-address=192.168.2.10 protocol=tcp dst-port=5001 action=dst-nat to-addresses=10.0.0.1 to-ports=5001 comment="server1" disable=yes
/ip firewall nat add chain=dstnat dst-address=192.168.2.10 protocol=tcp dst-port=5001 action=dst-nat to-addresses=10.0.0.2 to-ports=5001 comment="server2" disable=yes
/ip firewall nat add chain=dstnat dst-address=192.168.2.10 protocol=tcp dst-port=5001 action=dst-nat to-addresses=10.0.0.3 to-ports=5001 comment="server3" disable=yes
/ip firewall nat add chain=dstnat dst-address=192.168.2.10 protocol=tcp dst-port=5001 action=dst-nat to-addresses=10.0.0.4 to-ports=5001 comment="server4" disable=yes
My idea is to to “knock” on a port from my servers to the router, put that in destination list and use that as trigger event to activate/deactivate the related translation.
I hope that there is someone out there who can help me, because I miss the link between the filter and the NAT configuration.
Thanks,
M
setup is: RouterBoard 450G with RouterOS 6.7
