Closed Geobert closed 4 years ago
route -n get default
?
Thank you, but I mean by using the crate's API
You can check which adapter has gateways (>0). It's already exposed in master but not in version 0.2.1, so I'll release it now for you :) Does it help?
Yeah it does thanks! Unfortunately, the project I was working on and needed that is cancelled ^^' But I will be handy to have anyway!
Windows uses the adapter with the lowest metric.
oops, sorry for posting in an old thread. there's already an example https://github.com/liranringel/ipconfig/blob/master/examples/priority_list.rs
Hi,
thank you very much for this useful crate :D
I'm trying to get the local ip address of the computer and as I have VirtualBox installed, I have multiple interfaces.
How can I distinguish the real one from the virtual one? Both are
EthernetCsmacd
.I'd like to create a server which as the IP address of my computer :)