Community discussions

MikroTik App
 
LdB
Member Candidate
Member Candidate
Topic Author
Posts: 145
Joined: Thu May 20, 2021 4:23 pm

How to set Mikrotik default IP

Tue Jul 18, 2023 3:43 am

Just a question that has always perplexed me how to set default IP that tik itself uses ... this is a generic problem no exact config will help you sort of have to follow the problem.

Explaination:
On most tik setups we have at least one WAN gateway and at least one Monitoring gateway but those are via transit IP's.

So if you open just a terminal and type "ping 8.8.8.8" it will fail because it uses the transit IP of the default route
If I use "ping 8.8.8.8 src-address=xxx.xxx.xxx.xxx" from one of the public IP's it will work fine.

So the issue it creates for me is the NTP client on the tik won't work to public servers by default unless I do some hijinx with a mangle or have
access to an NTP server on the monitor network.

If I set preferred source IP on the default route that solves that problem but creates route issues for transit traffic.

So I guess what I am really chasing is a way to set the source IP of the TIK services traffic.
 
fragtion
Member Candidate
Member Candidate
Posts: 260
Joined: Fri Nov 13, 2009 10:08 pm
Location: Johannesburg, South Africa

Re: How to set Mikrotik default IP

Tue Jul 18, 2023 1:39 pm

It just follows the routing of the main routing table, doesn't it? Besides that, as you say, output mangle rules and routing rules can be used to override if the main table isn't configured in your favour
 
LdB
Member Candidate
Member Candidate
Topic Author
Posts: 145
Joined: Thu May 20, 2021 4:23 pm

Re: How to set Mikrotik default IP

Thu Jul 20, 2023 5:18 pm

You miss the point you can't select what source IP some services use !!!!!

The source IP has zero to do with route table.

So lets do it...I have 2 simple static routes
0.0.0.0/0 next hop is some public IP xxx.xxx.xxx.xxx
192.168.0.0/0 next hop is some management gateway

I have two addresses on the router
1.) a transit public IP /30 that has the internet on it.
2.) 192.168.0.1/24 as the gateway for the management range

Now lets setup the NTP client on that screen I get to enable it and now enter time server IP or DNS names.

So which IP is the service going to use the transit IP or the 192.168.0.1 ?????

There is no way to know and I can tell you half the time it won't be what you expect !!!!!!!

What is missing on the NTP client screen is the ability for me to tell it what source IP to use.

The only way I can >>> guarantee <<< the NTP client will work is set up two time servers
1.) Public NTP server
2.) a private IP NTP time server out via the management gateway

Then whichever one the tik decides today there is a time server there but it's a pain in the butt.
 
User avatar
k6ccc
Forum Guru
Forum Guru
Posts: 1497
Joined: Fri May 13, 2016 12:01 am
Location: Glendora, CA, USA (near Los Angeles)
Contact:

Re: How to set Mikrotik default IP

Thu Jul 20, 2023 8:58 pm

Sounds like you have messed up something in the config. It absolutely SHOULD work 100% of the time (it does on my RB4011 with multiple WANs). Export and post your config.
To export and paste your configuration (and I'm assuming you are using WebFig or Winbox), open a terminal window, and type (without the quotes) "/export hide-sensitive file=any-filename-you-wish". Then open the files section and right click on the filename you created and select download in order to download the file to your computer. It will be a text file with whatever name you saved to with an extension of .rsc. Suggest you then open the .rsc file in your favorite text editor and redact any sensitive information. Then in your message here, click the code display icon in the toolbar above the text entry (the code display icon is the 7th one from the left and looks like a square with a blob in the middle). Then paste the text from the file in between the two code words in brackets.

Who is online

Users browsing this forum: akakua, biki73, dervomsee and 114 guests