I need to get the interface I'm using, in Windows I can do:
InetAddress.getLocalHost ()
But in Linux it does not work, unless you add to etc / hosts
the IP of my computer.
So, I use NetworkInterface.getNetworkInterfaces ()
to get the list of my interfaces, but I can not differentiate between whether my interface is an ethernet connection or a wifi connection.
I need to know the type of connection to always get first the ethernet connection, if I had it.
Thanks.