You're expecting too much of the -a option. It does not do source
routing at all. When using "mtr -a", "ping -I", "traceroute -s", etc.,
the source IP address will change, but the destination route is still
chosen by the system routing table. This is useful when the remote end
treats the various IPs on your system differently (for example if it has
a route to one interface's subnet but not to the other).

This is not a regression - I've confirmed that 0.92 and 0.87 behave
identically in this regard.

To do what you want you'll need to either change the routing table or
configure policy-based routing like so:

# Create a new routing table with a default route towards [interface]
ip route add table 10 default dev [interface]
# Send all traffic with a particular IPTables MARK tag to this new
routing table
ip rule add from all fwmark 10 lookup 10
# Mark all local outbound traffic originating from this source IP so
that it uses the new routing table
iptables -t mangle -A OUTPUT -s [sourceip] -j MARK --set-mark 10

On 11/21/2017 07:06 AM, Tom Hetmer wrote:
> Package: mtr
> Version: 0.92-1
> Severity: normal
>
> Hi,
>
> there is a regression in 0.92.
> Specifying an interface with --address is broken.
>
>  -a, --address ADDRESS      bind the outgoing socket to ADDRESS
>
> ie.
>
> mtr -4 --address 213.198.94.174 ic.cz
>
> will not get routed through the interface with the 213.198.94.174
> address but instead uses the default route on the system.
>
> This does not happen with mtr_0.87-1~bpo8+1_amd64.deb.
>
>
> -- System Information:
> Debian Release: 8.9
>   APT prefers oldstable
>   APT policy: (800, 'oldstable')
> Architecture: amd64 (x86_64)
>
> Kernel: Linux 3.16.0-4-amd64 (SMP w/8 CPU cores)
> Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
> Shell: /bin/sh linked to /bin/dash
> Init: sysvinit (via /sbin/init)
>
> Versions of packages mtr depends on:
> ii  libc6               2.19-18+deb8u10
> ii  libcap2             1:2.24-8
> ii  libgdk-pixbuf2.0-0  2.31.1-2+deb8u6
> ii  libglib2.0-0        2.42.1-1+b1
> ii  libgtk2.0-0         2.24.25-3+deb8u2
> ii  libncurses5         6.0+20170902-1
> ii  libtinfo5           6.0+20170902-1
>
> mtr recommends no packages.
>
> mtr suggests no packages.
>
> -- no debconf information

Reply via email to