DDNS icon indicating copy to clipboard operation
DDNS copied to clipboard

增加指定网卡功能

Open mem0rz opened this issue 5 years ago • 4 comments

导入了一个netifaces库

mem0rz avatar Feb 09 '20 10:02 mem0rz

谢谢修改,两个问题

  1. 这个与数字(0,1,2,3等): 第 i 个网卡 ip这个功能是否有区别?
  2. 尽量避免引入库外部依赖,尽量简单,保证有python的环境即可执行。

NewFuture avatar Feb 11 '20 05:02 NewFuture

谢谢修改,两个问题

1. 这个与`数字(0,1,2,3等): 第 i 个网卡 ip`这个功能是否有区别?

2. 尽量避免引入库外部依赖,尽量简单,保证有python的环境即可执行。

数字0,1,2,3这个返回的是从/etc/hostname里读取的IP。不是真正的从网卡读取IP image 然后第二个问题的话我也没想到特别好的方法。好像这种读取系统硬件信息的方法都是要引入别的包。

mem0rz avatar Feb 11 '20 17:02 mem0rz

I don't think specifying the count of net interfaces is a good idea. Sometimes it would be annoying if new interfaces are added, causing the number changed

purerosefallen avatar Mar 21 '20 06:03 purerosefallen

I think adding a library could be acceptable. Because getting interface address in system way is better than parsing the command line output.

purerosefallen avatar Mar 21 '20 06:03 purerosefallen