- 论坛徽章:
- 7
|
- 1. For a channel bonding interface to be valid, the bonding module must be loaded. To ensure that the module is loaded when the channel bonding interface is brought up, create a new file as root named +bonding.conf+** in the +/etc/modprobe.d/+ directory. Note that you can name this file anything you like as long as it ends with a .conf extension. Insert the following line in this new file:
- /etc/modprobe.d/bonding.conf :
- alias bond<N> bonding
- Replace <N> with the interface number, such as 0. For each configured channel bonding interface, there must be a corresponding entry in your new /etc/modprobe.d/<bonding>.conf file.
- 2. To create a channel bonding interface, create a file in the /etc/sysconfig/network-scripts/ directory called ifcfg-bond<N> , replacing <N> with the number for the interface, such as 0. The contents of the file can be identical to whatever type of interface is getting bonded, such as an Ethernet interface. The only difference is that the DEVICE= directive must be bond<N> , replacing <N> with the number for the interface.
- The following is a sample channel bonding configuration file:
- DEVICE=bond0
- IPADDR=192.168.1.1
- NETMASK=255.255.255.0
- ONBOOT=yes
- BOOTPROTO=none
- USERCTL=no
- BONDING_OPTS="<bonding parameters separated by spaces>"
- 3. After the channel bonding interface is created, the network interfaces to be bound together must be configured by adding the MASTER= and SLAVE= directives to their configuration files. The configuration files for each of the channel-bonded interfaces can be nearly identical. For example, if two Ethernet interfaces are being channel bonded, both eth0 and eth1 may look like the following example:
- DEVICE=eth<N>
- BOOTPROTO=none
- ONBOOT=yes
- MASTER=bond0
- SLAVE=yes
- USERCTL=no
- In this example, replace <N> with the numerical value for the interface.
- 4. Restart the service network and make the bond0 up.
- service network restart
- *Note :*
- Parameters for the bonding kernel module must be specified as a space-separated list in the BONDING_OPTS="<bonding parameters>" directive in the ifcfg-bond<N> interface file. Do not specify options for the bonding device in /etc/modprobe.d/<bonding>.conf, or in the deprecated /etc/modprobe.conf file.
复制代码 按RH的方式来吧,试试。路由尽量别写RC.LOCAL,这文件只在开机时候执行一次。其他时候网卡一重启就丢路由了。建议路由写到配置文件里。 |
|