Community discussions

MikroTik App
 
Fi011
just joined
Topic Author
Posts: 15
Joined: Sat Dec 16, 2017 1:17 am

Changing the default source IP for Ping

Sun Oct 21, 2018 2:18 pm

Hello,

I have a problem with the source IP of ICMP requests.
We use BGP and we have a peeering with a default route. When I try to ping google, it will always select BGP peer address as a source IP address.

Here is why. Quote:
"If we are pinging out across the Internet, the router will select the lowest IP address on the WAN interface and inject that into the source address field of the packet."

Let's say the peer address is 1.1.1.0/30, and the loopback address is 2.2.2.2/32. Since peer address is lower than the loopback address, it will use it for ping and trace route per default.
But that IP address belongs to ISP and they are having firewall filters blocking ICMP. So how to change the default interface to the Loopback interface? Of course, IP on the Loopback interface is IP address advertised through BGP and it's working great. I want to have it chosen by default by the router as a source IP for ICMP.
Is it possible?
Please help.
 
Fi011
just joined
Topic Author
Posts: 15
Joined: Sat Dec 16, 2017 1:17 am

Re: Changing the default source IP for Ping

Thu Oct 25, 2018 3:04 pm

Mikrotik community. So helpful.
 
upower3
Member
Member
Posts: 425
Joined: Thu May 07, 2015 11:46 am

Re: Changing the default source IP for Ping

Thu Oct 25, 2018 5:37 pm

You can look at cli syntax of ping at https://wiki.mikrotik.com/wiki/Manual:Tools/Ping and do something like
/ping 8.8.8.8 src-address=2.2.2.2
Or maybe you need to specify
interface=Loopback0
for your case?