bond

Posted niwajiang1

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了bond相关的知识,希望对你有一定的参考价值。

#!/bin/bash
cat > /etc/sysconfig/network-scripts/ifcfg-bond0 <<EOF
TYPE=Bond
USERCTL=no
BOOTPROTO=none
ONBOOT=yes
BRIDGE=br0
BONDING_MASTER=yes
BONDING_OPTS="mode=1 miimon=100"
EOF

cat > /etc/sysconfig/network-scripts/ifcfg-em1 <<EOF
DEVICE=em1
USERCTL=no
ONBOOT=yes
MASTER=bond0
BOOTPROTO=none
EOF

cat > /etc/sysconfig/network-scripts/ifcfg-em2 <<EOF
DEVICE=em2
USERCTL=no
ONBOOT=yes
MASTER=bond0
BOOTPROTO=none
EOF


cat > /etc/sysconfig/network-scripts/ifcfg-br0 << EOF
TYPE=Bridge
BOOTPROTO=static
PEEDNS=yes
NAME=br0
DEVICE=br0
ONBOOT=yes
IPADDR=192.168.102.10
NETMASK=255.255.255.0
GATEWAY=192.168.102.254
DNS1=8.8.8.8
USERCTL=no
EOF
cat > /etc/sysconfig/network-scripts/ifcfg-em3 <<EOF
# Generated by dracut initrd
NAME="em3"
DEVICE="em3"
ONBOOT=yes
NETBOOT=yes
IPV6INIT=yes
BOOTPROTO=static
TYPE=Ethernet
BRIDGE=br1
EOF
cat > /etc/sysconfig/network-scripts/ifcfg-br1 << EOF
NAME="br1"
DEVICE="br1"
ONBOOT=yes
NETBOOT=yes
IPV6INIT=yes
BOOTPROTO=static
TYPE=Bridge
IPADDR=192.168.103.11
PREFIX=24
GATEWAY=192.168.103.254
DNS1=8.8.8.8
DEFROUTE=no
EOF

以上是关于bond的主要内容,如果未能解决你的问题,请参考以下文章

使用Composition时如何避免子类回调?