Jawaban:
Jika Anda memiliki ifupdown
(kemungkinan besar jika Anda menggunakan Debian atau distro berbasis Debian) lihat man interfaces
:
post-up command
Run command after bringing the interface up. If this command fails then ifup aborts, refraining from marking the interface as con‐
figured (even though it has really been configured), prints an error message, and exits with status 0. This behavior may change in
the future.
Jadi di dalam /etc/network/interfaces
kamu dapat memiliki sesuatu seperti
auto eth0
iface eth0 inet dhcp
post-up /usr/local/sbin/my-custom-script
Ganti eth0 untuk antarmuka Anda yang sebenarnya.