Question

My project requires to identify whether the connected routers in the network supports IPv6. With loads of hours searching on the internet I found out that the following command,

root@linuxrouter:/# test -f /proc/net/if_inet6 && echo "Running kernel is IPv6 ready"

can be used in order to find the IPv6 ready status of Linux kernel routers. My query is, is there a way to do this problematically from a remote Linux box within the same network? where the user could execute application in which the application would send the request to the router (user inputs/ hard codes the IP of the target device) and obtain the "Running kernel is IPv6 ready" reply from the router to the application?

Any reference material or code segments from you experts will be very much appreciated as I am new to this field. Thank you very much :)

Was it helpful?

Solution

The information you need is reported through the pseudo-file you mentioned. Thus, you will need a remote shell access to query it (or, remote filesystem access of sort, but that's basically the same thing).

The situation is roughly identical on Windows, btw: while Windows has all kinds of fancy data reporting network APIs you still need to provide (local/domain) user credentials to access those.

As to how to establish a remote shell connection programmatically, you've got multiple options, libssh being a handy one: http://api.libssh.org/master/libssh_tutor_command.html

There's also an SNMP route, but unless you've got an existing working SNMP setup on your machines it's hardly worth the trouble (and secure SNMP connections require comprehensive authentication and TLS context, so ssh is definitely a much simpler approach).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top