虛擬機器雙網路卡繫結

huzhichengforce發表於2015-05-14
------本文指標對虛擬機器雙網路卡繫結做介紹-----

在兩臺物理機上做雙網路卡繫結照這文件修改繫結網路卡的配置檔案即可,但是vmware 虛擬機器需要另作設定。

------------------------------------------------------------------------------------------------------------------------------------------------
[root@db ~]# more /etc/modprobe.conf
alias scsi_hostadapter mptbase
alias scsi_hostadapter1 mptspi
alias scsi_hostadapter2 ata_piix
alias scsi_hostadapter3 ahci
alias eth0 e1000
alias eth1 e1000
alias bond0 bonding
options bond0 mode=1 miimon=100 fail_over_mac=1
----------------------------------------------------------------------------------------------------------------------------------------------
[root@db network-scripts]# more ifcfg-bond0
DEVICE=bond0
BOOTPROTO=static
IPADDR=192.168.142.130
NETMASK=255.255.255.0
BROADCAST=192.168.142.255
ONBOOT=yes
TYPE=Ethernet
----------------------------------------------------------------------------------------------------------------------------------------------
[root@db network-scripts]# more ifcfg-eth0
# Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)
DEVICE=eth0
ONBOOT=yes
MASTER=bond0
BOOTPROTO=static
---------------------------------------------------------------------------------------------------------------------------------------------
[root@db network-scripts]# more ifcfg-eth1
# Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)
DEVICE=eth1
ONBOOT=yes
MASTER=bond0
BOOTPROTO=static
-------------------------------------------------------------------------------------------------------------------------------------------

#service network restart
-------------------------------------------------------------------------------------------------------------------------------------------
[root@db network-scripts]# more /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.4.0 (October 7, 2008)

Bonding Mode: fault-tolerance (active-backup) (fail_over_mac active)
Primary Slave: None
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
Link Failure Count: 0
Permanent HW addr: 00:0c:29:d3:cc:26

Slave Interface: eth1
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:0c:29:d3:cc:30
-----------------------------------------------------------------------------------------------------------------------------------------
[root@db network-scripts]# ifconfig -a
bond0     Link encap:Ethernet  HWaddr 00:0C:29:D3:CC:26 ---------主備模式網路卡的MAC 地址
          inet addr:192.168.142.130  Bcast:192.168.142.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fed3:cc26/64 Scope:Link
          UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1
          RX packets:322 errors:0 dropped:0 overruns:0 frame:0
          TX packets:298 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:32407 (31.6 KiB)  TX bytes:37746 (36.8 KiB)

eth0      Link encap:Ethernet  HWaddr 00:0C:29:D3:CC:26 ---------------主備模式網路卡的MAC 地址
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
          RX packets:42 errors:0 dropped:0 overruns:0 frame:0
          TX packets:281 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:5193 (5.0 KiB)  TX bytes:35609 (34.7 KiB)

eth1      Link encap:Ethernet  HWaddr 00:0C:29:D3:CC:30  ------------主備模式網路卡的MAC 地址
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
          RX packets:288 errors:0 dropped:0 overruns:0 frame:0
          TX packets:26 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:27694 (27.0 KiB)  TX bytes:3555 (3.4 KiB)


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26764973/viewspace-1654111/,如需轉載,請註明出處,否則將追究法律責任。

相關文章