Detecting a change of IP address in Linux

前端 未结 7 1347
轮回少年
轮回少年 2020-12-29 10:53

Does anyone know a way to detect a change of IP address in Linux. Say I have dhcpcd running, and it assigns a new IP address, is there a way I can get a notification when it

7条回答
  •  粉色の甜心
    2020-12-29 11:07

    I think you can use dbus to do this on modern Linux distributions. If your distribution uses NetworkManager, see this document for information about its dbus interface:

    http://people.redhat.com/dcbw/NetworkManager/NetworkManager%20DBUS%20API.txt

提交回复
热议问题