配置 /etc/conf.d/net
#把 eth0 绑定2个ip:
config_eth0=("192.168.1.102 netmask 255.255.255.0" "192.168.2.102 netmask 255.255.255.0")
查看命令:
# ip addr
2
: eth0:
<
BROADCAST
,
MULTICAST
,
UP
,
LOWER_UP
>
mtu
1500
qdisc pfifo_fast qlen
1000
link
/
ether
00
:e0
:4c:
78
:3e:
40
brd ff
:ff:ff:ff:ff:ff
inet
192.168
.
1.102
/
24
brd
192.168
.
1.255
scope global eth0
inet
192.168
.
2.102
/
24
brd
192.168
.
2.255
scope global eth0
inet6 fe80
::
2e0:4cff:fe78:3e40/64 scope link
valid_lft forever preferred_lft forever
#把 eth0 绑定2个ip:
config_eth0=("192.168.1.102 netmask 255.255.255.0" "192.168.2.102 netmask 255.255.255.0")
查看命令:
# ip addr
![](https://i-blog.csdnimg.cn/blog_migrate/6810355c2f78c12e91b7997a8e8c583a.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/6810355c2f78c12e91b7997a8e8c583a.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/6810355c2f78c12e91b7997a8e8c583a.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/6810355c2f78c12e91b7997a8e8c583a.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/6810355c2f78c12e91b7997a8e8c583a.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/6810355c2f78c12e91b7997a8e8c583a.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/6810355c2f78c12e91b7997a8e8c583a.gif)