1. 加一个相同子网内的地址提示: ioctl (SIOCAIFADDR): File exists.
ifconfig -a可以看到该地址,但是ping不通
加一个不同子网内的地址:
ifconfig -a可以看到该地址,也能ping通
[参考]
alias Establish an additional network address for this interface. This
is sometimes useful when changing network numbers, and one wishes
to accept packets addressed to the old interface. If the address
is on the same subnet as the first network address for this in-
terface, a netmask of 0xffffffff has to be specified.
2. 在/etc/hosts中加不行吗?没试过的说