检测IP是静态还是从busybox获取DHCP [英] Detect if IP is static or obtained from DHCP on busybox
本文介绍了检测IP是静态还是从busybox获取DHCP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
系统使用ip命令获取地址。
我想从我的C程序中找出设备
ip静态还是从DHCP服务器接收。如何做?
amit
解决方案
环境,我建议设置一个env变量,或者在设置IP地址时,在某个地方创建一个标志文件。
I am working on embedded device who run BusyBox. The system is getting its address by using the ip command. I want to figure out from my C program whether the device ip static or received from DHCP server. How do I do that ?
amit
解决方案
If you control the enviroment, I suggest setting an env variable, or creating a flag file somewhere you can stat, when the IP adress is set.
这篇关于检测IP是静态还是从busybox获取DHCP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文