One Nic is bound to multiple IP addresses and multiple NICs are configured with one IP address.

Source: Internet
Author: User

One Nic is bound to multiple IP addresses and multiple NICs are configured with one IP address.

Commonly used is "one Nic is bound to multiple IP addresses"

One Nic is bound to multiple IP addresses

Linux network device configuration files are stored in/etc/sysconfig/network-scripts,
For the first network device over Ethernet, the configuration file name is generally a ifcfg-eth0.
To bind one more IP address to the first network device
/Etc/sysconfig/network-scripts directory to create a file named ifcfg-eth0: 0,
Content example:

Device = "eth0: 0"
Ipaddr = "211.100.10.119"
Netmask = "255.255.255.0"
Onboot = "yes"

The device is the device name,
The IP address of the device,
Netmask is the subnet mask.
Onboot indicates Automatic startup when the system starts.
If you need to bind another IP address,
You only need to add the file name and the eth0: X in the device in the file.
Linux supports up to 255 IP aliases

Bind one IP address to multiple NICs

You can use multiple NICs to create a network card with the same IP address.
This technology already exists in Sun and Cisco, respectively known as trunking and etherchannel technologies,
In Linux, this technology is called bonding.
Because bonding already contains the kernel 2.4.x,
You only need to select the bonding driver support option in the network device option during compilation.
Then, recompile the core, restart the computer, and execute the following command:

Ismod Bonding
Ifconfig eth0 down
Ifconfig eth1 down
Ifconfig bond0 IPaddress
Ifenslave bond0 eth0
Ifenslave bond0 eth1

Now the two NICs work like one, which can improve data transmission between cluster nodes.
You 'd better write these statements as a script and then call them by/etc/rc. d/rc. Local,
So that it takes effect immediately after it is started.
Bonding is a good choice for Servers. When there is no Gigabit Nic,
Using two or three 100 Mbit/s NICs as bonding can greatly increase the bandwidth between the server and the switch.
However, you need to set the two ports mapped to the same Virtual Interface on the vswitch to connect to the bonding Nic.

From: http://sujian.blog.51cto.com/8838/3901

Extension: http://www.chinaunix.net/jh/4/371049.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.