Linux IP alias and multi-nic binding

Source: Internet
Author: User

Linux IP alias and multi-nic binding (I) Nic advanced command www.2cto.com ① mii-tool eth0: View Nic status ② ethtool view Nic settings ethtool-I eth0: View NIC Driver ethtool eth0: view the physical characteristics of the network card ethtool-S eth0: view the underlying status of the network card (IP alias) Multiple IP addresses are configured on one physical network card to implement functions similar to sub-interfaces, an IP alias is used to assign different IP addresses or linux routers to multiple network segments on the linux DHCP server. You may need to configure multiple IP addresses on one physical interface www.2cto.com (1) step_1 redhat by default, NetworkManager is used manage, however, only the most basic functions are required. To bind an IP alias or multiple NICs, disable [SQL] [root @ localhost ~]. # Service NetworkManager stop the NetworkManager daemon: [OK] [root @ localhost ~] # Chkconfig NetworkManager off [root @ localhost ~] # Service NetworkManager status NetworkManager is stopped (2) step_2 [SQL] [root @ localhost ~] # Ifconfig eth0 eth0 Link encap: Ethernet HWaddr 00: 0C: 29: 5E: 10: AB inet addr: 192.168.1.112 Bcast: 255.255.255.255 Mask: 255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU: 576 Metric: 1 RX packets: 520 errors: 0 dropped: 0 overruns: 0 frame: 0 TX packets: 287 errors: 0 dropped: 0 overruns: 0 carrier: 0 collisions: 0 txqueuelen: 0 RX bytes: 82430 (80.4 KiB) TX bytes: 35734 (34.8 KiB) [root @ localhost ~] # Ip addr add 192.168.1.200/24 dev eth0 label eth0: 0 [root @ localhost ~] # Ifconfig eth0 Link encap: Ethernet HWaddr 00: 0C: 29: 5E: 10: AB inet addr: 192.168.1.112 Bcast: 255.255.255.255.255 Mask: 255.255.0 UP BROADCAST RUNNING MULTICAST MTU: 576 Metric: 1 RX packets: 700 errors: 0 dropped: 0 overruns: 0 frame: 0 TX packets: 395 errors: 0 dropped: 0 overruns: 0 carrier: 0 collisions: 0 txqueuelen: 0 RX bytes: 105711 (103.2 KiB) TX bytes: 48168 (47.0 KiB) eth0: 0 Link encap: Ethernet HWaddr 00: 0C: 29: 5E: 10: AB inet addr: 192.168.1.200 Bcast: 0.0.0.0 Mask: 255.255.255.0 up broadcast running multicast mtu: 576 Metric: 1 if you want to add an IP alias permanently, then you can add the alias configuration file: www.2cto.com configuration file name: ifcfg-eth0: 0 content: DEVICE = eth0: Under/etc/sysconfig/network-scripts: 0 IPADDR = 192.168.1.200 PREFIX = 24 // subnet mask ONPARENT = yes // dependency (3) Multi-nic binding linux supports binding multiple physical NICs to one logical Nic, to improve bandwidth and stability, the bound physical Nic does not directly use the IP address configured on the bound logical Nic. wlan cannot bind the NIC binding mode: Mode 0: balanced round robin-increase bandwidth Mode 1: active backup-increase stability, use only one network card mode 2: broadcast-generally, the logical network card without binding is named bondn, n is numbered, such as/dev/bond0 and/dev/bond1. If the two NICs are on different routers, you cannot use Nic binding to increase the bandwidth server. If there are two addresses connected to different network segments, the simplest way for the client to access the server Load balancer is to use DNS for the Server Load balancer client to access the server through the domain name, in DNS, resolve the domain name to the IP addresses of the two NICs on the specified server. (1) configure the logical Nic In Step 1: /eth/sysconfig/network-scripts/ifcfg-bond0 DEVICE = bond0 IPADDR = 192.168.1.200 PREFIX = 24 ONBOOT = yes BOOTPROTO = none USERCTL = no BONDING_OPTS = "mode = 0 miimon = 50" (2) step_2 stop each network card first: ifdown eth0, eth1 and then modify the configuration file of each physical network card that belongs to the logical network card: /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE = eth0 BOOTPROTO = none ONBOOT = yes MASTER = bond0 SLAVE = yes USERCTL = no second Nic eth1 add driver/etc /modprobe. d/bonding. conf alias bond0 bonding (4) step_4 service network stop service network start ifup bond0 watch-n 1 ifconfig

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.