Hi! Need help!
RB 750. RouterOS 5.16.
Three ip comes from my ISP - one is for common uses through gateway to lan, second and third to assign for access to certain servers in LAN.
ISP demands use dhcp-client and show three MAC for assign IP’s.
And i like assign second and third IP to Router on one interface, but not direct to servers.
How can i do this?
You have to use one-to-one nat to assign public IPs to internal servers with private IP.
In IP > Firewall, Nat you need both a dst-nat and src-nat rule.
Create a dst-nat rule, set Dst. Address to the public IP for your server. Also specify In. Interface. Action should be set to dst-nat and specify the private IP in the “To Addresses” field.
So now all incoming packets to your public server IP will be forwarded to your server. But the server’s outbound packets will be sent out with the ‘common’ public IP’s address. So:
Create a src-nat rule, set Src. Address to the private IP of your server. Specify the Out. Interface. Action should be set to src-nat and “To Addresses” should be the public IP of the server.
Finally, the issue you’ll have, is if your public IPs change because their dynamic, then the dst-nat and src-nat rules need to be updated manually - there is no automatic function for this (unless you create a script of some sort).
I have no public ip before they will be assigned by dhcp. In simple decision i connects WAN to switch and three cables from switch in router ports with dhcp-client enabled.
But i want show three different MAC on one interface, take traffic from all and forward them depending on destination IP addresses on different IP’s one LAN interface.