## 配置IP地址
修改配置文件vi /etc/sysconfig/network-scripts/ifcfg-ens33(动态IP地址)
```
BOOTPROTO=dhcp
ONBOOT=yes
```
释放当前IP地址
```
dhclient -r
```
重新获取IP地址
```
dhclient -v
```
修改配置文件vi /etc/sysconfig/network-scripts/ifcfg-ens33(静态IP地址)
```
BOOTPROTO=static
ONBOOT=yes
IPADDR=192.168.10.71
NETMASK=255.255.255.0
GATEWAY=192.168.10.1
DNS1=114.114.114.114
```
## 双网卡绑定 bond0
mode=0 round-robin 轮转策略
**mode=1 active-backup 主备策略**
mode=2 XOR 基于所选择的hash策略,提供负载均衡和容错能力
mode=3 broadcast 广播策略,向所有的slave接口发送数据包,供容错能力
mode=4 802.3ad 动态链路聚合,根据802.3ad标准利用所有的slave建立聚合链路
**mode=5 balance-tlb Adaptive transmit load balancing(适配器传输负载均衡)**
**mode=6 balance-alb Adaptive load balancing(适配器适应性负载均衡)**
mode 1,5,6不需要交换机设置
mode 0,2,3,4需要交换机设置
修改ifcfg-bond0配置vi /etc/sysconfig/network-scripts/ifcfg-bond0
```
DEVICE=bond0
ONBOOT=yes
TYPE=Bond
BOOTPROTO=none
BONDING_OPTS="miimon=100 mode=0"
BONDING_MASTER=yes
IPADDR=192.168.10.71
NETMASK=255.255.255.0
GATEWAY=192.168.10.1
DSN1=192.168.10.10
DNS2=192.168.10.11
```
修改ifcfg-eth0配置vi /etc/sysconfig/network-scripts/ifcfg-eth0
```
DEVICE=eth0
HWADDR=XX:XX:XX:XX:XX:XX
TYPE=Ethernet
UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
MASTER=bond0
SLAVE=yes
```
修改ifcfg-eth1配置vi /etc/sysconfig/network-scripts/ifcfg-eth1
```
DEVICE=eth1
HWADDR=XX:XX:XX:XX:XX:XX
TYPE=Ethernet
UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
MASTER=bond0
SLAVE=yes
```
## 修改MAC Address
方式一
```
ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx
```
方式二(修改ifcfg-eth0配置文件vi /etc/sysconfig/network-scripts/ifcfg-eth0)
```
MACADDR=XX:XX:XX:XX:XX:XX
```