0

My topology is like this..

Server (PC) with 2 Network Connection

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

Client (PC)

  • 192.168.5.104 (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 192.168.5.101. 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 (192.168.5.101) will be change using NETSH into (192.168.5.106) 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
0

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

(http://windowsitpro.com/windows-server/top-10-windows-firewall-netsh-commands)

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.