Specify public IP

Hi!

I have a problem make MT router do connection from some specified LAN address to WAN using other provider given IP address than other addresses using to connect WAN.

So Providers given adresses: XX.XX.XX.100; XX.XX.XX.101

Configuration:
RouterOS v3.28
LAN 192.168.2.X
WAN XX.XX.XX.100
Using NAT/Masquerade

[admin@MikroTik] /ip address> pri
Flags: X - disabled, I - invalid, D - dynamic 
 #   ADDRESS            NETWORK         BROADCAST       INTERFACE             

 0   192.168.2.1/24     192.168.2.0     192.168.2.255   ether2                
 1   XX.XX.XX.100/24  XX.XX.XX.0    XX.XX.XX.255  ether1



[admin@MikroTik] /ip route> pri
Flags: X - disabled, A - active, D - dynamic, 
C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme, 
B - blackhole, U - unreachable, P - prohibit 
 #      DST-ADDRESS        PREF-SRC        GATEWAY-STATE GATEWAY              DISTANCE INTERFACE    

 0 A S  0.0.0.0/0                          reachable     XX.XX.XX.1         1        ether1       
 1 ADC  192.168.2.0/24     192.168.2.1                                        0        ether2       
 2 ADC  XX.XX.XX.0/24    XX.XX.XX.100                                     0        ether1



[admin@MikroTik] /ip firewall nat> pri
Flags: X - disabled, I - invalid, D - dynamic 

0   chain=srcnat action=masquerade out-interface=ether1

Is any solution configuration from LAN’s IP 192.168.2.33 access internet with IP XX.XX.XX.101
while other LAN’s adresses still - XX.XX.XX.100 ?

Using NAT Netmap? What i need to change in Ether1 IP address? Something in IP routing?
Thanks

Try this:

/ip address
add address=xx.xx.xx.101/24 interface=ether1

/ip firewall nat
add chain=srcnat action=src-nat src-address=192.168.2.33 to-addresses=xx.xx.xx.101
add chain=srcnat action=src-nat to-addresses=xx.xx.xx.100

If you want to access 192.168.2.33 with xx.xx.xx.101 from the internet then

add chain=dstnat action=dst-nat dst-address=xx.xx.xx.101 to-addresses=192.168.2.33 place-before=0

Once you add the second ip to ether1, your current “action=masquerade” rule will become unreliable. I would remove it. Order is important here. If they end up in the wrong order, use the ‘move’ command, like
“move 3 1” will move line 3 to line 1, and move all lines from line 1 down one place.

WARNING: Some ISPs do not allow more than one ip per mac address. If you have challenges with getting both ips on one interface, check with your ISP to insure you are allowed to do that.

Thanks, working so far

no problems with ISP