I am connected to ISP using "IPoE" authentification.
It works this way. When a new network device is connected, it gets a local IP address (100.x.x.x) with 10 min lease, and there web authorization is required with user name and password.
After a successful authorization the router gets an internet IP with also a 10 min. lease.
When access to internet is closed, i.g. because a bill has not be paid, the wan interface gets back a 100.x.x.x. address. The access is only to internal resources.
I want to catch this kind of events by a script. It is quite easy to catch
ifdown events in
hotplug.d, but there is a problem.
In some cases when there is a problem on ISP side the lease expire, but the new address is not granted. WAN interface stays up, but without any address.
I get a log message
daemon.notice netifd: wan (1019): Lease lost, entering init state
What is a way to catch this event other that just parse logs?