How can I determine the IP of my router/gateway in Java?

前端 未结 16 2193
无人及你
无人及你 2020-11-27 06:43

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

16条回答
  •  抹茶落季
    2020-11-27 07:15

    On windows parsing the output of IPConfig will get you the default gateway, without waiting for a trace.

提交回复
热议问题