虚拟机双网卡绑定

------本文指针对虚拟机双网卡绑定做介绍-----

在两台物理机上做双网卡绑定照这文档修改绑定网卡的配置文件即可,但是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/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/26764973/viewspace-1654111/

你可能感兴趣的:(运维)