Making Bulb indicator alarm using ip ping failure from router

Hi
I am looking for guidance on making one Light Bulb as Alarm when a network IP ping fails. Like if network goes down then the bulb should light up, using ESP8266 or something like that.

Please suggest.
Thanks

By "Light Bulb" do you mean one running on house/line current? If so, you should probably use a relay module to switch it.

Have you searched for how to do a 'ping' with the ESP8266?

Here is a library with an example:

Thanks for the reply ...me too while searching reached to same place. may be I have got the help . sometime connecting to the community make you reach answers.

Tried the code works well so far. Now will be incorporating relay into it.
thanks