以centos7.2为例
centos7服务器主网卡绑定多ip实践演示:
https://cloud.tencent.com/developer/article/1360461
centos7服务器添加辅助网卡绑定多ip实践演示:
https://cloud.tencent.com/developer/article/1360462
Windows服务器主网卡绑定多ip实践演示:
https://cloud.tencent.com/developer/article/1360445
Windows服务器添加辅助网卡及绑定多ip实践演示:
https://cloud.tencent.com/developer/article/1360457
### 备份
[root@VM_1_62_centos ~]# cp /etc/sysconfig/network-scripts/ifcfg-eth0{,.bak}
### 修改网卡配置
[root@VM_1_62_centos ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0
# Created by cloud-init on instance boot automatically, do not edit.
#
# 此处修改为static
BOOTPROTO=static
DEVICE=eth0
#
# 注释此行
# HWADDR=52:54:00:8a:7a:64
#
# 添加如下几行
#
# 配置主ip
IPADDR0=10.2.1.62
NETMASK0=255.255.255.0
# 配置辅助ip1
IPADDR1=10.2.1.101
NETMASK1=255.255.255.0
# 配置辅助ip2
IPADDR2=10.2.1.102
NETMASK2=255.255.255.0
# 配置网关
GATEWAY=10.2.1.1
#
NM_CONTROLLED=no
ONBOOT=yes
TYPE=Ethernet
USERCTL=no
PERSISTENT_DHCLIENT=yes
### 重启网卡
[root@VM_1_62_centos ~]# systemctl restart network.service
### 查看ip
[root@VM_1_62_centos ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 52:54:00:8a:7a:64 brd ff:ff:ff:ff:ff:ff
inet 10.2.1.62/24 brd 10.2.1.255 scope global eth0
valid_lft forever preferred_lft forever
inet 10.2.1.101/24 brd 10.2.1.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet 10.2.1.102/24 brd 10.2.1.255 scope global secondary eth0
valid_lft forever preferred_lft forever
如果有错误之处,请您指正!
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。