Page 1 of 1

IP and DHCP on same interface masqed

Posted: Fri Mar 03, 2017 1:35 am
by JoePolgar
Hello,

maybe its a bit strange what i want to do but:

i need to figure out how to masquerade range2 to display as range1 IP

so i have a simple wan on ether1 net working, no problem

subnet 15.0/24 on ether2 added 2 ips, 1 is 15.1 as gw for 15.0/24 range and added 15.2/24 < i want this ip for masquerade
subnet 16.0/24 on ether3 dhcp server working, everything ok

what i want is when somebody in the network from range 16.0/24 connects to the 15.0/24 all other devices must see IP 15.2/24

router is 2011, is that even possible ? thanks for help

Re: IP and DHCP on same interface masqed

Posted: Fri Mar 03, 2017 2:51 am
by Sob
That does not qualify for "strange". :)
/ip firewall nat
add action=src-nat chain=srcnat dst-address=192.168.15.0/24 src-address=192.168.16.0/24 \
    to-addresses=192.168.15.2

Re: IP and DHCP on same interface masqed

Posted: Fri Mar 03, 2017 2:58 am
by JoePolgar
That does not qualify for "strange". :)
/ip firewall nat
add action=src-nat chain=srcnat dst-address=192.168.15.0/24 src-address=192.168.16.0/24 \
    to-addresses=192.168.15.2
Thanks for quick reply, just tried it, still seeing the 16.0/24 ip in torch on other router

Re: IP and DHCP on same interface masqed

Posted: Fri Mar 03, 2017 3:30 am
by Sob
What other router? Also it can be influenced by other srcnat rules, if there's some that matches this traffic before this one, it won't do anything.

Re: IP and DHCP on same interface masqed

Posted: Fri Mar 03, 2017 4:00 am
by JoePolgar
What other router? Also it can be influenced by other srcnat rules, if there's some that matches this traffic before this one, it won't do anything.
no other src-nat rules, they connect from 16.0 range to other mikrotiks from 15.0 range, and there i see the ip, i want 15.2 but there is 16.xx

Re: IP and DHCP on same interface masqed

Posted: Fri Mar 03, 2017 8:54 pm
by Sob
But it's the most basic srcnat setup, nothing should go wrong with that. Maybe there's some little and seemingly unimportant detail missing from your description. You can always post your whole config ("/export hide-sensitive" in terminal) a hopefully someone will see what's wrong.