4

debian 系统下,有没有简单的办法检测指定网卡配置是 dhcp/static/manual?

 2 years ago
source link: https://www.v2ex.com/t/810117
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

V2EX  ›  Linux

debian 系统下,有没有简单的办法检测指定网卡配置是 dhcp/static/manual?

  skinny · 2 小时 48 分钟前 · 236 次点击

我想到的是通过查找网卡配置文件 /etc/network/interfaces 的内容来判定,但是网卡配置可能写到了 /etc/network/interfaces.d 下的某个文件,而且配置文件内容的一行要是被拆成了奇形怪状的好几行怎么办?虽然多写几句 bash script 也能搞定,但是想问问有没有别的办法。

那个 ifquery 命令我试过,没有用,按 help 输出和 manpage 操作,要么输出为空,要么根本不能正常解析它自己的选项,连示例都不能运行。


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK