Ubuntu14配置Bonding多网卡

Installation

sudo apt-get install ifenslave

Interface Configuration

Step 1: Ensure kernel support

Before Ubuntu can configure your network cards into a NIC bond, you need to ensure that the correct kernel module bonding is present, and loaded at boot time.
Edit your /etc/modules configuration:

sudo vi /etc/modules
Ensure that the bonding module is loaded:
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.

loop
lp
rtc
bonding

Step 2: Configure network interfaces

Ensure that your network is brought down:

sudo stop networking
Then load the bonding kernel module:
sudo modprobe bonding
Now you are ready to configure your NICs.
Edit your interfaces configuration:
 sudo vi /etc/network/interfaces
For example, to combine eth0 and eth1 as slaves to the bonding interface bond0 using a simple active-backup setup, with eth0 being the primary interface:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
#auto eth0
#iface eth0 inet dhcp
# This is an autoconfigured IPv6 interface
#iface eth0 inet6 auto

# eth0 is manually configured, and slave to the "bond0" bonded NIC
auto eth0
iface eth0 inet manual
    bond-master bond0
    bond-primary eth0

# eth1 ditto, thus creating a 2-link bond.
auto eth1
iface eth1 inet manual
    bond-master bond0

# bond0 is the bonding NIC and can be used like any other normal NIC.
# bond0 is configured using static network information.
auto bond0
iface bond0 inet dhcp
   # address 192.168.1.10
   # gateway 192.168.1.1
   # netmask 255.255.255.0
    bond-mode active-backup
    bond-miimon 100
    bond-slaves none
Next Start/Restart network service to take effect the changes:
/etc/init.d/networking start
Bring up bond0:
ifup bond0

Checking the bonding interface

Link information is available under /proc/net/bonding/. To check bond0 for example:
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

Bonding Mode: fault-tolerance (active-backup)
Primary Slave: eth0 (primary_reselect always)
Currently Active Slave: eth0
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: eth0
MII Status: up
Speed: Unknown
Duplex: Unknown
Link Failure Count: 0
Permanent HW addr: 00:16:3e:6d:3c:4b
Slave queue ID: 0


参考自: UbuntuBonding




















  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值