✔ 最佳答案
$ /sbin/ifconfig eth0:0 192.168.0.4
$ /sbin/route add -host 192.168.0.4 dev eth0:0
(replace that IP with the one you'd like to add)
This change will no longer be in effect after rebooting. Thereforyou must add the two commands to the bottom of your /etc/rc.local file. Your NIC should now be listening and responding on both this and the original IP address found in /etc/sysconfig/network-scripts/ifcfg-eth0
If you want to add add more than one additional IP address, continuelike this:
$ /sbin/ifconfig eth0:0 192.168.0.4
$ /sbin/ifconfig eth0:1 192.168.0.5
$ /sbin/ifconfig eth0:2 192.168.0.6
$ /sbin/route add -host 192.168.0.4 dev eth0:0
$ /sbin/route add -host 192.168.0.5 dev eth0:1
$ /sbin/route add -host 192.168.0.6 dev eth0:2