Community discussions

MikroTik App
 
JoePolgar
just joined
Topic Author
Posts: 4
Joined: Tue Dec 14, 2010 12:33 am

IP and DHCP on same interface masqed

Fri Mar 03, 2017 1:35 am

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
 
Sob
Forum Guru
Forum Guru
Posts: 9188
Joined: Mon Apr 20, 2009 9:11 pm

Re: IP and DHCP on same interface masqed

Fri Mar 03, 2017 2:51 am

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
 
JoePolgar
just joined
Topic Author
Posts: 4
Joined: Tue Dec 14, 2010 12:33 am

Re: IP and DHCP on same interface masqed

Fri Mar 03, 2017 2:58 am

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
 
Sob
Forum Guru
Forum Guru
Posts: 9188
Joined: Mon Apr 20, 2009 9:11 pm

Re: IP and DHCP on same interface masqed

Fri Mar 03, 2017 3:30 am

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.
 
JoePolgar
just joined
Topic Author
Posts: 4
Joined: Tue Dec 14, 2010 12:33 am

Re: IP and DHCP on same interface masqed

Fri Mar 03, 2017 4:00 am

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
 
Sob
Forum Guru
Forum Guru
Posts: 9188
Joined: Mon Apr 20, 2009 9:11 pm

Re: IP and DHCP on same interface masqed

Fri Mar 03, 2017 8:54 pm

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.