Add option to select network interface to use
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mtr |
Triaged
|
Wishlist
|
Unassigned |
Bug Description
MTR currently has the --address option to select the source address used for packets. The documentation implies that this lets you pick the specific interface to be used, but this is not always the case.
In my setup I have a OpenVPN connection to a VPN server on the tun0 interface. The LAN interface is eth0, with Internet access via a gateway.
I use the redirect-gateway def1 option. This routes all traffic through the VPN by creating 0.0.0.0/1 and 128.0.0.0/1 routes on tun0. These override the default gateway route, but also preserve it. A route to the VPN server (a.b.c.d/32) via the default gateway preserves routing for encrypted VPN packets.
This unfortunately causes problems when trying to do traceroutes on over the WAN. Normally packets would go over the VPN, so it needs to be specified that I want to use the eth0 interface.
Ping works fine if I set the source interface by name (ping -I eth0 8.8.8.8). However if I set the source address by IP, packets are still subject to the normal routing table and thus still go over the VPN (ping -I $ETH0_IP 8.8.8.8).
MTR has the same behaviour - "mtr -a $ETH0_IP 8.8.8.8" gets routed through tun0, not eth0. However unlike ping I cannot set the eth0 interface by name. It is therefore not possible to run a MTR traceroute in this setup.
Changed in mtr: | |
importance: | Undecided → Wishlist |
status: | New → Triaged |
My current workaround is to add a 8.8.8.8/32 during the traceroute and remove it afterwards.
However this isn't sufficient - while this is ok if that IP is not in use by anything using the VPN, it does temporarily interfere with VPN users if they are also trying to use that same IP.