想给网卡配置IP,发现传统的方式报错了:

  1. root@wn:~ # ifconfig msk0 192.168.2.33/24
  2. ifconfig: ioctl (SIOCAIFADDR): Invalid argument

研究一下ifconfig的man,发现命令改了,要加inet:

  1. root@wn:~ # ifconfig msk0 inet 192.168.2.33/24

添加第二个IP就更麻烦了,浪费了我半天的时间,甚至重新编译了两次内核和world,就在放弃的时候,仔细研读了man,发现语法竟然变了:

root@wn:~ # ifconfig msk0 alias inet 192.168.2.33/24
ifconfig: can't set link-level netmask or broadcast

无论怎么设置,也是报这个错误。

看正确的吧,你都想像不到:

点击(此处)折叠或打开

  1. root@wn:~ # ifconfig re0 inet 192.168.2.33/24 add

删除:

  1. root@wn:~ # ifconfig re0 inet 192.168.2.33/24 -alias








--鄙视一下开发人员,弄个命令乱折腾啥?



--end--
10-03 12:33
查看更多