How to Detect Disconnected Client from Our Network

Tags: February 19, 2015 9:01 PM
0 comments

Overview

If you have a Linux box which act as gateway or Captive Portal, you might want to do something fancy when client get connected or disconnected from your box. As an example, you want to modify some iptables rules as soon as client leave your network.

Problem

You want to detect status of a machine as soon as it disconnected form your network. The arp command utility still displaying client which already gone from our network. The default cache time inside Linux kernel might be set for longer period of time.

Solution

Instead of using arp utility, we can use ip command utility as tool for displaying statistics of our "neighbors". Below is an example of showing status of our neighbors.

Share on Facebook Twitter