Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Advanced Network configuration-bond/team/ bridged Network

2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

one. Learn to configure bond network interfaces

Red Hat Enterprise Linux allows administrators to bind multiple network interfaces to a single channel using bonding kernel modules and special network interfaces called channel binding interfaces. Depending on the binding mode selected, channel binding uses two or more network interfaces as one network interface, thereby increasing bandwidth and / or providing redundancy

1. Using nmcli command to manage bond

Nm-connection-editor

Delete all network interfaces

Nmcli connection add type bond con-name bond0 ifname bond0 mode active-backup ip4 172.25.254.199/24

Ifconfig

Watch-n 1 cat / proc/net/bonding/bond0

Nmcli connection add type bond-slave con-name eth0 ifname eth0 master bond0

Nmcli connection add type bond-slave con-name eth2 ifname eth2 master bond0

Ifconfig eth0 down

two。 Select Linux Ethernet binding mode

Mode 0 (balanced Round Robin balance-rr)-Round robin policy in which all interfaces transmit packets in all Slave using round robin; any Slave can receive

Mode 1 (active backup active-backup)-Fault tolerance. Only one Slave interface can be used at a time, but if that interface fails, another Slave will replace it

Mode 3 (broadcast broadcast)-Fault tolerance. All packets are broadcast over all Slave interfaces

3. Active backup configuration exampl

3-1 establish the binding interface bond0 configuration file:

/ etc/sysconfig/network-scripts/ifcfg-bond0

-BOOTPROTO= "none"

-IPADDR= "10.1.1.250"

-PREFIX= "24"

-ONBOOT= "yes"

-BONDING_OPTS= "mode=1 miimon=50"

3-2 establish the Slave interface eth0 configuration file:

/ etc/sysconfig/network-scripts/ifcfg-eth0

-DEVICE= "eth0" # hardware Nic name

-BOOTPROTO= "none"

-ONBOOT= "yes"

-MASTER= "bond0"

-SLAVE= "yes"

3-3 establish the Slave interface eth2 configuration file:

/ etc/sysconfig/network-scripts/ifcfg-eth2

-DEVICE= "eth2"

-BOOTPROTO= "none"

-ONBOOT= "yes"

-MASTER= "bond0"

-SLAVE= "yes"

3-4 configure the system to load the binding module:

/ etc/modprobe.d/bonding.conf

-alias bond0 bonding

Ifenslave bond0 eth0 eth2

Systemctl stop NetworkManager

Systemctl restart network

View bonding status

-cat / proc/net/bonding/bond0

two. Learn to configure team network interfaces

1.Team interface

Team and bond0 are similar in function

Team does not need to manually load the corresponding kernel module

Team is more expansive.

-support 8 fast network cards

Types of 2.Team

Broadcast broadcast fault tolerance

Roundrobin polling

Activebackup active / standby

Loadbalance load balancing

3. Set team through nmcli

Nmcli connection add type team con-name team0 ifname team0 config'{"runner" {"name": "loadbalance"}} 'ip4 172.25.254.198

Nmcli connection add con-name eth0 ifname eth0 type team-slave master team0

Nmcli connection add con-name eth2 ifname eth2 type team-slave master team0

4. Monitor team0 and test

Teamctl team0 stat

Ifconfig eth0 down

Ifconfig eth0 up

Ifconfig eth2 down

Ifconfig eth2 up

three. Learn to configure network bridging

1. Network bridging

Using Network Bridge to share Internet hosts and clients in addition to using software, you can also use the network bridge of the system to establish a connection and use a machine with dual network cards as the host.

two。 Configuration of network bridging

Vim / etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0 # device name, may be different

ONBOOT=yes

BOOTPROTO=none

BRIDGE=br0 # key points, must be stated

Vim / etc/sysconfig/network-scripts/ifcfg-br0

DEVICE=eth0

ONBOOT=yes

BOOTPROTO=none

TYPE=Bridge # key points, must be stated

IPADDR=172.25.254.198

3. Management commands for network bridging

Brctl

# bridging Management commands

-show # display

-addbr # add a bridge

-delbr # delete the bridge

-addif # add a bridge connection

-delif # delete bridge connection

Uninstall the bridge interface process

Brctl show

Brctl delif br0 eth0

Brctl show

Brctl delbr br0

Ifconfig br0 down

Brctl show

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.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report