-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Choose interface on multihomed hosts #75
Comments
Hi @rapier1 , making this OS-independent could be tricky, but it's easily doable on Linux at least. We can use SO_BINDTODEVICE on the outgoing socket for the Go version of the tool, and I'm pretty sure that libtins allows setting the outgoing interface, for the C++ version |
OS independence is always the tricky part. If you do get the chance to look at this I would appreciate it - even if its just a one off for linux. As to why I"m interested in this: A number of the users we support are using multihomed systems (often a 10Gbps link to a high performance research and education network and a 1Gbps to the regular internet). We want to ensure that the paths we are testing are the correct paths. |
How about specifying the source IP and using policy routing for choosing the internet? I think it will work properly. I think that all that's needed to change is this code for the sourceip: You need to specify the local IP address you want to bind to instead of 0, according to the documentation here: http://libtins.github.io/tutorial/sending/
Which is exactly like the implementation in UDPv4Probe::forge() :) So we just need to patch the argument in from the command line, defaulting to |
Actually, the interface can also be chosen there: https://github.com/insomniacslk/dublin-traceroute/blob/master/src/udpv4probe.cc#L58 |
Apparently libtins ignores the network interface parameter, https://github.com/mfontanini/libtins/blob/master/src/ip.cpp#L393 . This seems to be confirmed by my experiments |
For IP packets, it makes sense not to allow you to specify the egress interface. I just hope they implemented policy routing table lookup properly :) https://www.tldp.org/HOWTO/Adv-Routing-HOWTO/lartc.rpdb.simple.html |
For IPv6 libtins now does look at the interface: mfontanini/libtins@a619e4f#diff-b23b9d060c719b60ce59dccae8ef233bf13ae3b2cedfa7610b0f202b5a9e39b5 |
Is it possible to extend this to allow the user to specify the non-default interface? This would be helpful on systems that are attached to multiple networks. I've taken a look at the code and if I can figure it out I'll let you know but I'm a C guy; C++ is still a new world for me.
Thanks
The text was updated successfully, but these errors were encountered: