How to bind a network to a Linux dual-nic

Source: Internet
Author: User

Set the Host Name and domain name of a Linux host
/Etc/hosts
Example
127.0.0.1 localhost. localdomain localhost

Generally, the hosts content defines the Host Name (hostname). Each act is a host. Each line consists of three parts, separated by spaces. The line starting with # is not explained by the system.

Part 1: network IP address;
Part 2: Host Name. Domain Name. Note that there is a halfwidth between host name and domain name, such as localhost. localdomain
Part 2: Host Name (host name alias) is actually the host name;

Of course, each line can also be two parts, namely the Host IP address and host name; for example, 192.168.1.195 Debian
======================================

Configure domain name resolution for a Linux host
/Etc/resolv. conf
Example: (up to 3)
Nameserver 202.96.134.133
Nameserver 202.96.128.143
Nameserver 202.96.68.38

=================================================
set Nic binding
the NIC configuration file must be edited first, directory:
/etc/sysconfig/network-scripts
bind the configuration file: The ifcfg-bond0 content is 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
============================== =
Nic configuration file: ifcfg-ethx:
device = ethx
onboot = Yes
bootproto = none
# Master = bond0
# slave = Yes
============ ==================< br> after these configurations are complete, configure/etc/modprobe. CONF file, add the following content:
alias bond0 bonding
options bond0 miimon = 100 mode = 0
Note: miimon is used for link monitoring. For example: miimon = 100, The system monitors the link connection status every Ms. If one line fails, it is transferred to another line. The value of mode indicates the working mode, which has a total, two or three modes, commonly used: 0, 1.
mode = 0 indicates that load balancing (round-robin) is a load balancing method, and both NICs work.
mode = 1 indicates that fault-tolerance (Active-Backup) provides redundancy, working in the active/standby mode, that is, by default, only one network card works, another one is used for backup.
================================================= ================< br> last edited/etc/rc. d/RC. add the following content to the local file:
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.