Обрабатывать событие получения IP в скрипте.
udhcpc -i vlan2 -p /var/run/udhcpc2.pid -s /tmp/udhcpc -b
Code:
udhcpc [-Cfbnqtv] [-c CID] [-V VCLS] [-H HOSTNAME] [-i INTERFACE] [-p pidfile] [-r IP] [-s script]
-c, --clientid=CLIENTID Set client identifier
-C, --clientid-none Suppress default client identifier
-V, --vendorclass=CLASSID Set vendor class identifier
-H, --hostname=HOSTNAME Client hostname
-h, Alias for -H
-f, --foreground Do not fork after getting lease
-b, --background Fork to background if lease cannot be immediately negotiated
-i, --interface=INTERFACE Interface to use (default: eth0)
-n, --now Exit with failure if lease cannot be immediately negotiated
-p, --pidfile=file Store process ID of daemon in file
-q, --quit Quit after obtaining lease
-r, --request=IP IP address to request (default: none)
-s, --script=file Run file at dhcp events (default: /usr/share/udhcpc/default.script)
-t, --retries=NUM Send up to NUM request packets
-v, --version Display version