Specifically, I am interested in a programmatic way for acquiring a list of IP addresses such as those returned by ifconfig
.
Preferably, the solution would be cross-platform.
Open a terminal window to get to the command line. Enter the command arp -a to get a list of all IP addresses on your network.
From the desktop, navigate through; Start > Run> type "cmd.exe". A command prompt window will appear. At the prompt, type "ipconfig /all". All IP information for all network adapters in use by Windows will be displayed.
Check out the pnet crate:
extern crate pnet;
use pnet::datalink;
fn main() {
for iface in datalink::interfaces() {
println!("{:?}", iface.ips);
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With