How can I determine the IP of my router/gateway in Java? I can get my IP easily enough. I can get my internet IP using a service on a website. But how can I determine my gat
You may be better off using something like checkmyip.org, which will determine your public IP address - not necessarily your first hop router: at Uni I have a "real" IP address, whereas at home it is my local router's public IP address.
You can parse the page that returns, or find another site that allows you to just get the IP address back as the only string.
(I'm meaning load this URL in Java/whatever, and then get the info you need).
This should be totally platform independent.