给网卡eth0指定多个ip,一个为内网ip,一个为外网ip。具体操作如下:
[root@localhost network-scripts]# cp ifcfg-eth0 ifcfg-eth0:1
[root@localhost network-scripts]# vim ifcfg-eth0:1
# Intel Corporation 82540EM Gigabit Ethernet Controller
DEVICE=
eth0:1
BOOTPROTO=none
ONBOOT=yes
HWADDR=08:00:27:c5:df:40
NETMASK=
255.255.252.0
IPADDR=
172.16.0.232
GATEWAY=172.16.0.1
TYPE=Ethernet
USERCTL=no
IPV6INIT=no
PEERDNS=yes
转载于:https://blog.51cto.com/learon/982749