当前位置:网站首页>Nmcli team bridge basic configuration
Nmcli team bridge basic configuration
2022-06-27 12:28:00 【I was naughty when I was a child】
nmcli
NetworkManager It is a dynamic network controller and configuration system , It operates network devices while they remain available and connected . The order is nmcli, stay RHEL7 in , A network card device can have multiple connection Connect , But only one of them can be enabled at a time connection Connect . Create a new connection at a time , Will be in /etc/sysconfig/network-scripts/ Create a new file under the directory . This benefit is for a network interface , You can set up multiple network connections , For example, static IP And dynamic IP, Then activate the response as needed connection.
nmcli [OPTION] OBJECT {COMMAND | help}0
OBJECT and COMMAND You can use the full name or the short name , You can use at least one letter , The first three letters are recommended .OBJECT The most commonly used one is connection and device.device Called network interface , It's a physical device .connection Is the connection . Multiple connection Can be applied to the same device, But only one of them can be enabled at a time connection. This benefit is for a network interface , We can set up multiple network connections , For example, static IP And dynamic IP, And then use the corresponding connection
nmcli [OPTIONS…] {help | general | networking | radio | connection | device | agent | monitor}
1.device
conneciton device The most commonly used
connection: Connect
device: equipment ( network card : Physical network card and virtual network card )
There can be multiple connections on the network card ( To configure )connection
When configuring the connection , The physical network card must be specified .
nmcli device
Optional fields :
connect disconnect lldp monitor set status
delete help modify reapply show wifi
connect: Connect , Activate the current network card
disconnect: disconnect Disconnect this network card
delete: Delete
modify: modify
reapply: Reapply
show: Display network card information
status: state
Use OBJECT: device, connection The abbreviation can be used when : One letter or three letters , Or all .
nmcli device connect ens160 Use ens160
nmcli device disconnect ens160 To break off ens160
nmcli device reapply Restart the network card load configuration
2.connection: Connect
Multiple connections , Corresponding to multiple configurations , At the same time, only one connection is valid .
For connection objects :
nmcli connection
Optional fields :
add: Add a network connection
delete: Delete
edit: edit
load: Load from configuration file
show: Exhibition
clone: clone
down: Disconnect the current connection
export: export
import: Import
modify: modify
reload: Reload
up: Activate
Commonly used : add, delete, modify, reload, show, up , down
1. Add connection
nmcli c add type ethernet con-name connect ifname ens160 ipv4.addresses 192.168.10.100/24
ipv4.gateway 192.168.10.2 ipv4.dns 114.114.114.114 ipv4.method manual
nmcli
2. View connections
nmcli con show
3. disconnect
nmcli con down connect
4. Activate connection
nmcli con up connect
5. Modify connection
nmcli con modify con-name connect + Something modified
6. Reload the connection
nmcli con reload
type Options
· wifi
· ethernet
· wimax
· pppoe
· gsm
· cdma
· infiniband
· bluetooth
· vlan
· bond
· bond-slave
· team
· team-slave
· bridge
· bridge-slave
· vpn
· olpc-mesh
· adsl
· tun
· ip-tunnel
· macvlan
· vxlan
· dummy
Give me a few common types
example 1 ethernet
Suppose you create two new connections : rhce_static, rhce_auto
ipv4.method :(manual auto) manual static state auto Automatic access to
con-name: Connection name
ifname: Interface name ( network card )
Concrete IP To configure :ip Address , Subnet mask , gateway ,dns, Use static or dynamic
If it's dynamic : No configuration required ip, gateway , Subnet mask
Static connections :
nmcli c add type ethernet con-name rhce_static ifname ens160 ipv4.addresses 192.168.10.100/24
ipv4.gateway 192.168.10.2 ipv4.dns 114.114.114.114 ipv4.method manual
Dynamic connectivity :
nmcli c add type ethernet con-name rhce_auto ifname ens160 ipv4.method auto
If something goes wrong , It can be used modify modify
nmcli con modify con-name ipv4.dns 8.8.8.8
Then activate the connection
nmcli con up rhce_static
Be careful : If there are more than one 1 Connect , There is a configuration autoconnect yes: If it is enabled, it will automatically connect to the configuration autoconnect The connection of
example 2 team
Team Mode of NetGroup :
broadcast: Each network card transmits packets
roundrobin: Each network card transmits data in polling mode
activebackup: There are active and standby network cards , Master transfer packet , The standby does not transmit , Main network card down 了 , Standby transmission
loadbalance: Monitor traffic and use hash functions , Make the data packets transmitted by each network card equal
lacp: You need a switch , Achieve advanced load balancing
**1.** First of all, there must be a virtual network card : External services , This means that it needs to be configured IP, To configure IP Is configured on the connection .
Produce a team Virtual network card , The corresponding connection should be configured , Configure on the connection IP Just add a connection , And specify the virtual network card : At the same time that the connection is made , A virtual network card is generated
and team Related connection types :
· team
· team-slave
team Connection on virtual network card
team-slave: The connection on the bound physical network card
In itself team0 This device does not exist , Virtual ( Based on our type Configure to team)
config: To configure team The mode of mechanism ,json Format
nmcli c add type team con-name team0 ifname team0 config '{"runner": {"name": "activebackup","hwaddr_policy":"by_active"}}'
ipv4.addresses 192.168.10.100/24 ipv4.gateway 192.168.10.2 ipv4.dns 114.114.114.114 ipv4.method manual
2. When the configuration is complete : There are two things
One is team0 This virtual device
One is team0 This connection , The connection depends on our virtual network card team0
then team0 Connect externally provided ip by 192.168.10.100
The actual physical network card must be bound to our virtual network card , This does not require configuration IP
Two physical network cards :ens160, ens224
nmcli c add type team-slave con-name team_port1 ifname ens160 master team_dev
nmcli c add type team-slave con-name team_port2 ifname ens224 master team_dev
3. Activate our physical network card , And our virtual network card ( What is actually activated is the connection )
When activated , Activate first team-slave, And then activate team
nmcli c up team_port1
nmcli c up team_port2
nmcli c up team_conn
4. result , Disconnecting and reconnecting will only result in a brief seizure , Normal communication will not be affected 
example 3 bridge( The bridge )
and team Is essentially the same
The configuration is as follows :
result : use tcpdump Grab ens160,ens224 NIC icmp data ,ping 4 A package , You can grab them separately 8 A packet 
边栏推荐
猜你喜欢

JMETER连接DM8

Operators are also important if you want to learn the C language well

In 2021, the global carbon graphite brush revenue is about US $2366million, and it is expected to reach US $2701.8 million in 2028

alibaba jarslink
![Dynamic programming [III] (interval DP) stone merging](/img/a4/82c4d63b8df5d092a96b80dd497147.jpg)
Dynamic programming [III] (interval DP) stone merging

Sword finger offer 04 Find in 2D array

uni-app开发微信小程序动态渲染页面,动态改变页面组件模块顺序

一个有趣的网络掩码的实验

号称史上最难618,淘宝数据盘点你做对了吗?

Peak store app imitation station development play mode explanation source code sharing
随机推荐
How to participate in openharmony code contribution
解开C语言的秘密《关键字》(第六期)
2022ciscn central China Web
Neo4j:入门基础(一)之安装与使用
全球最快下载工具 XDM
Mit6.031 software construction7 reading notesdesigning specifications
Hands on API development
word文本框换页
A brief talk on cordola tree
Building crud applications in golang
Dynamic programming [4] (counting class DP) example: integer partition
建木持续集成平台v2.5.0发布
namespace ‘rlang’ 0.2.0 is being loaded, but >= 0.3.0 is required
MapReduce原理剖析(深入源码)
Dm8: Dameng database - lock timeout
In 2021, the global professional liability insurance revenue was about USD 44740million, and it is expected to reach USD 55980million in 2028. From 2022 to 2028, the CAGR was 3.5%
亚马逊测评掉评、留不上评是怎么回事呢?要如何应对?
How to find the movie and TV clips with the same lines? These 8 movies search for artifact, and find the corresponding segment in one line
esp32s3 IPERF例程测试 esp32s3吞吐量测试
JMeter connection DM8