当前位置:网站首页>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 
边栏推荐
- Peak store app imitation station development play mode explanation source code sharing
- 解压 .log.gz 文件
- i. Construction of mx6ull C language environment
- Dynamic programming [4] (counting class DP) example: integer partition
- Take stock of some easy-to-use and niche markdown editors
- 深入理解 happens-before 原则
- word文本框换页
- 面试突击60:什么情况会导致 MySQL 索引失效?
- 浏览器cookie转selenium cookie登录
- Topic37——64. Minimum path sum
猜你喜欢

JMETER连接DM8

动态规划【三】(区间dp)石子合并

Nifi from introduction to practice (nanny level tutorial) - identity authentication

Interview shock 60: what will cause MySQL index invalidation?

Histrix工作原理
Interview shock 60: what will cause MySQL index invalidation?

如何修改 node_modules 里的文件

DM8:达梦数据库-锁超时

Peak store app imitation station development play mode explanation source code sharing

号称史上最难618,淘宝数据盘点你做对了吗?
随机推荐
Jwas: a Bayesian based GWAS and GS software developed by Julia
.NET6接入Skywalking链路追踪完整流程
树莓派 3b+ 学习
Getting started with go web programming: validators
Secyun won the "2022 AI analysis · it operation and maintenance vendor panorama report" as the representative vendor of intelligent operation and maintenance aiops Market
动态规划【三】(区间dp)石子合并
全志A13折腾备忘
esp32s3 IPERF例程测试 esp32s3吞吐量测试
uni-app 使用escook/request-miniprogram插件发请求说明
Uni app sends request instructions using the escook / request miniprogram plug-in
MapReduce principle analysis (in-depth source code)
pull request
Online bidding of Oracle project management system
Nifi from introduction to practice (nanny level tutorial) - identity authentication
Research Report on the overall scale, major producers, major regions, products and application segments of swine vaccine in the global market in 2022
MySQL learning 1: installing MySQL
记一次 .NET 某物管后台服务 卡死分析
Usage of rxjs mergemap
Interview shock 60: what will cause MySQL index invalidation?
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%