My topology is like this..

Server (PC) with 2 Network Connection

  • / Broadband Stick (Broadband / Internet Access)
  • (Local Network Connection / No Internet Access)

Client (PC)

  • (Local Network Connection / No Internet Access)

I created a batch file running in the Client side that will ping the Server, particularly the IP Address If it detects loss, it will turn offline (Java Program).

Same in Server, a batch file will ping to google.com (sample) to check if there is an internet connection. And if ever the reply is timed out or unreachable, the Local Network Connection IP Address ( will be change using NETSH into ( so that the Client will know that there is no Internet Connection (and it will turn offline).

The problem now here is that the changing of IP Address will take time and it will take more than 30 seconds for the Client to turn offline. Is there another way of doing this without changing the IP Address? If no, is there another way to speed up the changing of IP Address. Thank You.

  • An internal (DNS) Name Server is designed for this. When the ip address update the DNS entry for that host, this way you always are trying to ping, the same host. Have the host whom's address is changing update its own entry. – Ramhound Mar 10 '16 at 16:49

You can use netsh to control how and if a given system responds to ping requests. The following two netsh commands show how you can block and then open Windows Firewall to ping requests:

netsh advfirewall firewall add rule name="All ICMP V4" dir=in action=block protocol=icmpv4

netsh advfirewall firewall add rule name="All ICMP V4" dir=in action=allow protocol=icmpv4


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.