Community discussions

MikroTik App
 
IntLDaniel
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 56
Joined: Thu Apr 04, 2019 7:21 pm

Redirect traffic to the IP in the same subnet

Mon Sep 26, 2022 8:25 pm

Similar topic were discused here, but I think not my case. So briefly situation - I had a router on local IP i.e. 192.168.100.1/23. One day I had established new one and set it's IP to 192.168.101.1/23 (so still the same network) and started to move clients one by one to the new router and then the old router was removed. The old/new router is running services including DNS and NTP server. Many devices in the network has static settings of DNS or NTP to IP of old router 192.168.100.1/23. So first solution to keep reachability of DNS nad NTP was to set old IP 192.168.100.1/23 of the router to local LAN interface of the new router together with the new IP 192.168.101.1/23.

Now I would like to remove the old IP from the new router, but keep reachability of NTP and DNS for devices which refer to old IP. Normaly it would be simple task for dst-nat with action redirect. But the problem is that the redirected old IP is in the same subnet like the current router IP and mentioned solution does not work. Am I able to make it work without asigning the old IP to current router LAN interface? Thanks for help!
 
Sob
Forum Guru
Forum Guru
Posts: 9119
Joined: Mon Apr 20, 2009 9:11 pm

Re: Redirect traffic to the IP in the same subnet  [SOLVED]

Mon Sep 26, 2022 8:41 pm

Just keep the old address. You need the router to respond to ARP requests for it, so you can't reuse it elsewhere anyway. And simplest way to do it is when router has it. You can change its mask to /32, to avoid router using it as source when connecting to other devices.
 
IntLDaniel
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 56
Joined: Thu Apr 04, 2019 7:21 pm

Re: Redirect traffic to the IP in the same subnet

Mon Sep 26, 2022 9:08 pm

Thanks at least for the /32 hint beacuse avoiding router to using old IP as the source when connecting to other devices was my main effort :D So now it will never be used?
 
Sob
Forum Guru
Forum Guru
Posts: 9119
Joined: Mon Apr 20, 2009 9:11 pm

Re: Redirect traffic to the IP in the same subnet

Mon Sep 26, 2022 10:56 pm

For now I'll go with shouldn't. It's one of those things where I think I'm sure, but when I think about a bit more, I'm not exactly sure why I'm sure. ;)
 
IntLDaniel
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 56
Joined: Thu Apr 04, 2019 7:21 pm

Re: Redirect traffic to the IP in the same subnet

Mon Sep 26, 2022 11:54 pm

I have found one bad side effect of this "workaround" - if I disable the "new" IP address 192.168.101.1/23, related dynamic route disappear from route list (OK) but when I enable it again, dynamic route for this network is not recreated. The only solution is to disable the old address 192.168.100.1/32 as well and enable both together or at least the new one first. It seems that this behaviour is ROS 6.49.x related only. I have tested the same on other router on ROS 7.2.1 and there is no "pref. source" value used anymore. If I add another IP address /32 to LAN from the same subnet then another dynamic route is added to the route list with /32. So then I can see one with /23 and other with /32. Which one will be used for reply to clients..?
 
Sob
Forum Guru
Forum Guru
Posts: 9119
Joined: Mon Apr 20, 2009 9:11 pm

Re: Redirect traffic to the IP in the same subnet

Tue Sep 27, 2022 12:46 am

When you changed the mask, you kept original network=192.168.100.0, right? Get rid of it, it will be auto-filled as 192.168.100.1 and the problem with route goes away. At least it's what I see with my quick test.

Who is online

Users browsing this forum: Amazon [Bot], Bing [Bot] and 92 guests