In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Ubuntu and centos network card bridging and multiple network card binding
1.ubuntu
Bridging is to simulate a new network card and get the ip address that should be configured on the real network card to the bridge network card, which is mainly used for linux virtualization.
Ubuntu has abandoned the fixed IP configuration in / etc/network/interfaces and changed it to netplan square since 17.10. The configuration file is: / etc/netplan/01-netcfg.yaml
(1) configure single Nic bridging
Vim / etc/netplan/01-netcfg.yaml
Network: version: 2 renderer: networkd ethernets: eth0: dhcp4: no dhcp6: no bridges: br0: dhcp4: no dhcp6: no addresses: [172.18.3.18 dhcp4 16] gateway4: 172.18.0.1 nameservers: addresses: [223.6.6.6] interfaces:-eth0
Note: the yaml format has strict requirements for format indentation.
Then use the netplan apply command to make it effective.
(2) configure multiple network cards for bridging and routing
Vim / etc/netplan/01-netcfg.yaml
Network: version: 2 renderer: networkd ethernets: eth0: dhcp4: no dhcp6: no eth2: dhcp4: no dhcp6: no bridges: br0: dhcp4: no dhcp6: no addresses: [172.18.3.18 gateway4 16] gateway4: 172.18.0.1 nameservers: addresses: [223.6.6.6] routes:-to: 10.8 .0.0 16 via: 10.20.0.1 interfaces:-eth0 br1: dhcp4: no dhcp6: no addresses: [10.20.3.18 interfaces 16] routes:-to: 172.20.0.0 to 16 via: 10.20.0.1-to: 10.20.0.0 16 via: 10.20 .0.1-to: 10.2.0.0 to 16 via: 10.20.0.1 interfaces:-eth2
Nteplan apply makes it effective
(3) double Nic binding
In the case of a network card, there are many inconveniences. The network card binding technology can be understood as logically combining several network cards into a network card to improve performance and fault tolerance.
Seven bond modes describe:
The first mode: mod=0, that is: (balance-rr) Round-robin policy (balanced cycle strategy)
Features: the order of transmitting data packets is to transmit in turn (that is, the first packet goes eth0, the next packet goes eth2. . It goes on and on until the last pass
This mode provides load balancing and fault tolerance.
The second mode: mod=1, namely: (active-backup) Active-backup policy (master-backup strategy)
Features: only one device is active, when one goes down and the other is immediately switched to the primary device by backup. The mac address is visible from the outside.
It appears that the MAC address of the bond is unique to avoid confusion in the switch (switch). This mode only provides fault tolerance; this shows that this algorithm
The advantage is that it can provide high availability of network connections, but its resource utilization is low, only one interface is working, and there are N networks.
In the case of the interface, the resource utilization is 1max N.
The third mode: mod=2, namely: (balance-xor) XOR policy (balancing strategy)
Features: data packets are transmitted based on the specified transmission HASH policy. The default policy is: (source MAC address XOR destination MAC address)% number of slave.
Other transport policies can be specified through the xmit_hash_policy option, which provides load balancing and fault tolerance.
The fourth mode: mod=3, namely: broadcast (broadcast strategy)
Features: each packet is transmitted on each slave interface, and this mode provides fault tolerance.
The fifth mode: mod=4, namely: (802.3ad) IEEE 802.3adDynamic link aggregation (IEEE 802.3ad dynamic)
Link aggregation)
Features: create an aggregation group that shares the same speed and duplex settings. Multiple slave work in the same active cluster according to the 802.3ad specification
Fit.
Necessary conditions:
Conditional 1:ethtool supports getting the rate and duplex settings for each slave.
Conditional 2:switch (switch) supports IEEE 802.3ad Dynamic link aggregation.
Condition 3: most switch (switches) require specific configuration to support 802.3ad mode.
The sixth mode: mod=5, that is: (balance-tlb) Adaptive transmit load balancing (adapter transmission load is uniform
Heng)
Features: do not need any special switch (switch) support channel bonding. On each slave based on the current load (according to the speed meter
Calculate) allocate outbound traffic. If the slave that is receiving data fails, another slave takes over the MAC address of the failed slave.
The necessary conditions for this model:
Ethtool supports getting the rate of each slave
The seventh mode: mod=6, namely: (balance-alb) Adaptive load balancing (Adapter Adaptive load balancing)
Features: this mode includes balance-tlb mode, plus receiving load balancing (receive load balance) for IPV4 traffic
Rlb), and does not require any switch (switch) support.
The more commonly used mode is 125.
Ubuntu 18.04 dual network card binding configuration.
needs to install the bridge command in advance.
Vim / etc/netplan/01-netcfg.yaml
Network: version: 2 renderer: networkd ethernets: eth0: dhcp4: no dhcp6: no eth2: dhcp4: no dhcp6: no bonds: bond0: interfaces:-eth0-eth2 addresses: [172.18.3.18no dhcp6 16] gateway4: 172.18.0.1 nameservers: addresses: [223.6.6223.5.5.5] Parameters: mode: active-backup mii-monitor-interval: 100
netplan apply takes effect
2.centos
(1) Bridge Network Card
vim / etc/sysconfig/network-scripts/ifcfg-br0
DEVICE=br0TYPE=BridgeBOOTPROTO=staticIPADDR=192.168.238.3NETMASK=255.255.255.0GATEWAY=192.168.238.2DNS1=180.76.76.76ONBOOT=yes
vim / etc/sysconfig/network-scripts/ifcfg-ens33
YPE=EthernetPROXY_METHOD=noneBROWSER_ONLY=noBOOTPROTO=staticNAME=eth0UUID=480f65c7-d513-42d6-91ed-575996fe120fDEVICE=eth0ONBOOT=yesBRIDGE=br0
Just restart the network card for systemctl restart network.
(2) Network Card binding
modifies the configuration file of single network card
vim / etc/sysconfig/network-scripts/ifcfg-ens33
DEVICE=eth0BOOTPROTO=noneMASTER=bond0SLAVE=yesUSERCTL=no
generates Bond network card configuration file
vim / etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0BOOTPROTO=noneBONDING_OPTS= "miimon=100 mode=1" IPADDR=***GATEWAY=***DNS1=***ONBOOT=yes
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.