More than one network card under Linux to bind multiple network cards share a single IP and IP

2011-07-20  来源:本站原创  分类:OS  人气:112 

Under Linux sometimes need a network card to bind multiple IP, this article describes Redhat series (redhat, Fedora Core, Centos) in the implementation and a kind of Gentoo Linux and other commonly applied methods.

1, a single card to bind multiple IP in Redhat series implementation assumptions need to bind multiple IP network card is eth0, in the / etc / sysconfig / network-scripts directory create a file called ifcfg-eth0: 0 file,

Contents of the sample as follows:

DEVICE = "eth0: 0"
IPADDR = "192.168.0.2"
BROADCAST = "172.168.0.255"
NETMASK = "255.255.255.0"
ONBOOT = "yes"

Where DEVICE is the device name, IPADDR this device's IP address, BROADCAST a broadcast address, NETMASK is the subnet mask, ONBOOT that start automatically at boot time.

If you need to bind more than one IP address, just put the file name and the DEVICE in the eth0: x-plus-one can.

LINUX can support up to 255 IP alias 2, universally applicable single-NIC binding multiple IP implementation ifconfig eth0: 1 192.168.0.3 broadcast 192.168.0.255 netmask 255.255.255.0

The command can be added to the startup file from running inside, is under Gentoo / etc / conf.d / local.start, and some versions of Linux is / etc / rc.d / rc.local.

3 more cards share a single IP implementations use multiple network cards into a virtual network card, have the same IP address. In fact, the technology already exists in the sun and cisco are called Trunking and etherchannel technology, linux , this technique called bonding. because the bonding has been included in kernel 2.4.x, and only at compile time to network device option selected in the Bonding driver support on it.

Then, recompile the kernel, restart your computer, execute the following command:

ismod bonding
ifconfig eth0 down
ifconfig eth1 down
ifconfig bond0 ipaddress
ifenslave bond0 eth0
ifenslave bond0 eth1

Now has two network cards work the same as the one, this can increase the data transfer between the cluster nodes.

You'd better put a few words written in a script, then / etc / rc.d / rc.local or / etc / conf.d / local.start call for a boot on the force.

bonding for the server to be a better choice, when in the absence of Gigabit Ethernet, 100 MB card with twenty-three for bonding, can greatly improve the server to exchange bandwidth between machines. But the need to switch on the machine to set the connection bonding the two hole cards with a virtual interface map.

相关文章
  • More than one network card under Linux to bind multiple network cards share a single IP and IP 2011-07-20

    Under Linux sometimes need a network card to bind multiple IP, this article describes Redhat series (redhat, Fedora Core, Centos) in the implementation and a kind of Gentoo Linux and other commonly applied methods. 1, a single card to bind multiple I

  • look at how the actual network card under linux traffic 2010-10-13

    Look at the actual flow in the linux sar's really a good choice. ethtool should be able to see the rate card, and I try again. # Sar-n DEV-u 1 10 Look at the current network traffic I went online to find articles to use sar articles: Using the UNIX o

  • a network card under linux configure multiple IP 2010-10-13

    Text console below netconfig, there are tools ifconfig, netconfig convenient graphical slightly, but not the document, configure a ip can cope, but if you configure multiple IP to get it working, and can only use the ifconfig # Ifconfig eth0 192.168.

  • Linux network card detection and setting 2010-03-18

    This is my depressing thing at least a week, write to you, as you accumulate experience points, anyway, I was in the boss down the technology No bad habits (PS: To be honest, I am also doing development, the results let me engage in deployment). Firs

  • Linux network card binding 2010-06-24

    SUSE mainstream manufacturers recommended method, individuals are more respected! First, configure the network card driver added In / etc / sysconfig / kernel in MODULES_LOADED_ON_BOOT parameters with the network card driver, for example, MODULES_LOA

  • Linux network card bound to achieve (load balancing and redundancy backup) 2010-08-19

    1 Create a network card configuration file, obtained by binding the logical (virtual) network adapter name is bondx, where x values 0,1,1 ,..., bound for the first group, the logical name of the network card bond0, the corresponding The configuration

  • Configure network card and restart 2010-04-30

    Reprinted from: http://blog.sina.com.cn/s/blog_4b0a62670100921z.html In the Linux environment, configure the card, most use the ifconfig and netconfig to configure the network card. For Linux systems, each of its service, each component will have its

  • 3g network card installed on the process of ubuntu10.04 2010-07-31

    Recently purchased books thinkpad sl410k, get our hands on the grid immediately after win7, directly on the ubuntu10.4, very fortunately, did not actually install any drivers manually, beautiful pictures and to hear came out, but this machine indepen

  • VMware virtual machine dual card dual network card connected physical realization 2010-12-28

    VMware virtual machine dual card dual network card connected physical realization 1, the virtual and physical dual-card dual-LAN connection VMware, click the "Edit" column, "Virtual Network Settings", open the "Virtual Network Edi

  • Linux boot network card 2010-02-06

    Linux ifconfig command can be used to view the activities of NIC and IP address, subnet mask, or mac address and other information [[email protected] ~]# ifconfig eth0 Link encap:Ethernet HWaddr 08:00:27:D4:71:2D inet addr:192.168.1.104 Bcast:255.255.25

  • redhat linux network card a fixed ip setting 2010-04-30

    redhat linux network card a fixed ip setting Before xwindow under redhat-config-network to set a fixed ip network card was found does not work, set up after the ping is unreasonable. To look for some information, change / etc/sysconfig/network-script

  • linux network card bind multiple IP address (change) 2010-06-17

    Bind a number of IP card linux network device configuration files are located in / etc / sysconfig / network-scripts which, For the first Ethernet network device, configure the file name is generally ifcfg-eth0. If you need more than the first networ

  • linux environment, changes need to be restarted after the network card IP 2010-10-31

    linux environment, changes need to be restarted after the network card IP Command is: service network restart

  • bind more than one network card ip linux 2010-12-13

    Linux network card bound to a method of multiple IP 1.Redhat series (redhat, Fedora Core, Centos) method assumes that the implementation need to bind multiple IP network card is eth0, in the / etc / sysconfig / network-scripts directory create a file

  • linux network card is not compatible with the next issue redhatlinux 2011-01-09

    Today are installed with linux in a virtual machine network card can not be activated encountered the problem of the Internet to find the reason, now Zhuantie as follows: VMware4.5 Redhat 9 or more above and between the network card driver is not com

  • linux network card is not compatible with the problem under redhatlinux 2011-01-09

    Today are installed with linux in a virtual machine having the problem can not activate the card, the Internet to find the reason, now Zhuantie as follows: VMware4.5 between above and Redhat 9 above, some network card drivers are not compatible: Redh

  • linux network card driver. doc 2011-03-22

    linux network card driver. doc

  • linux network card driver analysis 2011-08-30

    linux network card driver analysis Learning should be a first simplification of the problem, the problem in the complex process. Start tackling complex issues, it is inevitable people are nervous, stretched feeling. Read Linux network card drivers as

  • linux way to add ip or network card 2010-05-25

    cd / etc / sysconfig / network-scripts ls ifcfg-eth0 * Can see that there is ifcfg-eth0 If you've had with other ip, may be ifcfg-eth0: 0 ifcfg-eth0: 1, etc. If not, edit a ifcfg-eth0: 0 file, if so, to the maximum add a few. Content of the document:

  • linux tools to view real-time traffic network card 2010-11-20

    nload is a network traffic statistical tool, the current version is 0.7.2. Download: http://sourceforge.net/project/showfiles.php?group_id=35865 Can also be installed using yum. yum install nload Source Installation wget http://heanet.dl.sourceforge.