Linux dual NIC Binding network Setup Method _unix Linux

Source: Internet
Author: User
Tags nameserver
Set the host name and domain name of the Linux host
/etc/hosts
Example
127.0.0.1 localhost.localdomain localhost

In general, the content of hosts in the host name (hostname) of the definition, each behavior of a host, each row consists of three parts, each part by a space separated. The lines at the beginning of the # number are described and are not interpreted by the system.

The first part: Network IP address;
Part II: Host name. Domain name, note the point between the host name and the domain name, such as Localhost.localdomain
The second part: host name (hostname alias), in fact, is the host name;

Of course, each line can also be two parts, is the host IP address and host name; like 192.168.1.195 Debian
=================================

Setting the Linux host Domain name resolution
/etc/resolv.conf
Example: (Up to 3 sets)
NameServer 202.96.134.133
NameServer 202.96.128.143
NameServer 202.96.68.38

=====================================
Set Network card Bindings
The first thing to edit is the NIC configuration file, which is located in the following directory:
/etc/sysconfig/network-scripts
Binding configuration file: Ifcfg-bond0 the contents are as follows:
Device=bond0
ipaddr=10.0.0.210
netmask=255.255.255.0
broadcast=10.0.0.255
network=10.0.0.0
gateway=10.0.0.1
Onboot=yes
Type=ethernet
==============================
Configuration file for Nic: Ifcfg-ethx contents are as follows:
Device=ethx
Onboot=yes
Bootproto=none
#MASTER =bond0
#slave =yes
===============================
When these are configured, you configure the/etc/modprobe.conf file and add the following:
Alias Bond0 Bonding
Options Bond0 miimon=100 mode=0
Note: Miimon is used for link monitoring. For example: miimon=100, then the system every 100MS monitoring link connection state, if there is a line does not pass on to another line; Mode's value represents the working mode, he has 0,1,2,3 four modes, commonly used for 0, 12 kinds.
Mode=0 indicates that the load balancing (round-robin) is loaded in a balanced way and both cards work.
Mode=1 means that fault-tolerance (active-backup) provides redundancy, working in a way that is normally done, which means that by default only one network card works and the other is backed up.
==================================================
Finally, edit the/etc/rc.d/rc.local file and add the following:
Ifenslave bond0 eth0 eth1

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.