作者:尹正杰
版权声明:原创作品,谢绝转载!否则将追究法律责任。
一.子网划分
1>.对nat网络进行子网划分
2>.对仅主机网络进行子网划分
二.添加四块网卡并配置bond模式
1>.添加四块网卡
2>.对四块网卡进行配置
[root@openstack.yinzhengjie.org.cn ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
BOOTPROTO=static
NAME=eth0
DEVICE=eth0
ONBOOT=yes
NM_CONTROLLED=no
MASTER=bond0
USERCTL=no
SLAVE=yes
[root@openstack.yinzhengjie.org.cn ~]#
[root@openstack.yinzhengjie.org.cn ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth1
TYPE=Ethernet
BOOTPROTO=static
NAME=eth1
DEVICE=eth1
ONBOOT=yes
NM_CONTROLLED=no
MASTER=bond1
USERCTL=no
SLAVE=yes
[root@openstack.yinzhengjie.org.cn ~]#
[root@openstack.yinzhengjie.org.cn ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth2
TYPE=Ethernet
BOOTPROTO=static
NAME=eth2
DEVICE=eth2
ONBOOT=yes
NM_CONTROLLED=no
MASTER=bond0
USERCTL=no
SLAVE=yes
[root@openstack.yinzhengjie.org.cn ~]#
[root@openstack.yinzhengjie.org.cn ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth3
TYPE=Ethernet
BOOTPROTO=static
NAME=eth3
DEVICE=eth3
ONBOOT=yes
NM_CONTROLLED=no
MASTER=bond1
USERCTL=no
SLAVE=yes
[root@openstack.yinzhengjie.org.cn ~]#
[root@openstack.yinzhengjie.org.cn ~]#
3>.配置bond卡
[root@openstack.yinzhengjie.org.cn ~]# cat /etc/sysconfig/network-scripts/ifcfg-bond0
TYPE=Ethernet
BOOTPROTO=static
DEVICE=bond0
ONBOOT=yes
BONDING_MASTER=yes
BONDING_OPTS="miimon=100 mode=1"
IPADDR=192.168.7.111
NETMASK=255.255.248.0
GATEWAY=192.168.7.254
DNS1=192.168.7.254
[root@openstack.yinzhengjie.org.cn ~]#
[root@openstack.yinzhengjie.org.cn ~]# cat /etc/sysconfig/network-scripts/ifcfg-bond1
TYPE=Ethernet
BOOTPROTO=static
NAME=bond1
DEVICE=bond1
ONBOOT=yes
BONDING_MASTER=yes
BONDING_OPTS="miimon=100 mode=1"
IPADDR=172.30.7.111
NETMASK=255.255.248.0
[root@openstack.yinzhengjie.org.cn ~]#
[root@openstack.yinzhengjie.org.cn ~]#
三.验证bond模式
1>.查看IP地址信息
2>.将eth3网卡关闭
[root@openstack.yinzhengjie.org.cn ~]# ifconfig eth3 down
[root@openstack.yinzhengjie.org.cn ~]#
[root@openstack.yinzhengjie.org.cn ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
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
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond0 state UP qlen 1000
link/ether 00:0c:29:4a:57:78 brd ff:ff:ff:ff:ff:ff
inet6 fe80::20c:29ff:fe4a:5778/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond1 state UP qlen 1000
link/ether 00:0c:29:4a:57:82 brd ff:ff:ff:ff:ff:ff
inet6 fe80::20c:29ff:fe4a:5782/64 scope link
valid_lft forever preferred_lft forever
4: eth2: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond0 state UP qlen 1000
link/ether 00:0c:29:4a:57:78 brd ff:ff:ff:ff:ff:ff
inet6 fe80::20c:29ff:fe4a:5778/64 scope link
valid_lft forever preferred_lft forever
5: eth3: <BROADCAST,MULTICAST,SLAVE> mtu 1500 qdisc pfifo_fast master bond1 state DOWN qlen 1000
link/ether 00:0c:29:4a:57:82 brd ff:ff:ff:ff:ff:ff
6: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
link/ether 00:0c:29:4a:57:78 brd ff:ff:ff:ff:ff:ff
inet 192.168.7.111/21 brd 192.168.7.255 scope global bond0
valid_lft forever preferred_lft forever
inet6 fe80::20c:29ff:fe4a:5778/64 scope link tentative dadfailed
valid_lft forever preferred_lft forever
7: bond1: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
link/ether 00:0c:29:4a:57:82 brd ff:ff:ff:ff:ff:ff
inet 172.30.7.111/21 brd 172.30.7.255 scope global bond1
valid_lft forever preferred_lft forever
inet6 fe80::20c:29ff:fe4a:5782/64 scope link tentative dadfailed
valid_lft forever preferred_lft forever
[root@openstack.yinzhengjie.org.cn ~]#
3>.验证外网可以ping通