<p>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 gateway's IP?</p>

<p>This is somewhat easy in .NET if you know your way around. But how do you do it in Java?</p>

That is not as easy as it sounds.  Java is platform independent, so I am not sure how to do it in Java.  I am
guessing
that .NET contacts some web site which reports it back.  There are a couple ways to go.  First, a deeper look into the ICMP protocol may give you the information you need.  You can also trace the IP you go through (your route).  When you encounter an IP that is not in the following ranges:
10.0.0.0 – 10.255.255.255
172.16.0.0 – 172.31.255.255
192.168.0.0 – 192.168.255.255
it is the IP one hop away from yours, and probably shares a few octets of information with your IP.
Best of luck.  I'll be curious to hear a definitive answer to this question.