惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

H
Hacker News: Front Page
S
Secure Thoughts
N
News | PayPal Newsroom
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
T
Threatpost
N
News and Events Feed by Topic
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
A
Arctic Wolf
Cisco Talos Blog
Cisco Talos Blog
V2EX - 技术
V2EX - 技术
L
LINUX DO - 热门话题
C
Cyber Attacks, Cyber Crime and Cyber Security
P
Proofpoint News Feed
TaoSecurity Blog
TaoSecurity Blog
N
News and Events Feed by Topic
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Hacker News - Newest:
Hacker News - Newest: "LLM"
NISL@THU
NISL@THU
H
Heimdal Security Blog
Webroot Blog
Webroot Blog
Martin Fowler
Martin Fowler
The Hacker News
The Hacker News
Engineering at Meta
Engineering at Meta
MongoDB | Blog
MongoDB | Blog
A
About on SuperTechFans
Stack Overflow Blog
Stack Overflow Blog
B
Blog RSS Feed
Vercel News
Vercel News
Blog — PlanetScale
Blog — PlanetScale
Google Online Security Blog
Google Online Security Blog
Schneier on Security
Schneier on Security
Cyberwarzone
Cyberwarzone
小众软件
小众软件
V
V2EX
K
Kaspersky official blog
Security Archives - TechRepublic
Security Archives - TechRepublic
博客园 - 三生石上(FineUI控件)
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
C
Cisco Blogs
S
Schneier on Security
Recorded Future
Recorded Future
阮一峰的网络日志
阮一峰的网络日志
AI
AI
Microsoft Security Blog
Microsoft Security Blog
H
Help Net Security
Simon Willison's Weblog
Simon Willison's Weblog
I
InfoQ
G
Google Developers Blog
博客园_首页
Hugging Face - Blog
Hugging Face - Blog

博客园 - 靖意风

使用QT 将可执行程序 进行打包 对使用的屏幕的整理 对mmc 设备进行分区 开发板启动时间优化 虚拟机下 安装 ubuntu 18.04 硬件基础知识__串口 字节对齐问题和 小端格式 在ubuntu下 编译23位的测试文件 31_了解 x6818开发板是 如何使用/dev/ttySAC0 进行打印log 10_linux dirver platform 框架 ubuntu24.04.02 下安装软件 记录 ubuntu 更新源 vmware 虚拟机的三种网卡 vmware 安装 ubuntu 24.04.02 07_linux 字符设备了解 04_kernel编程框架和 printk传参 05_使用linux内核的gpio库函数 03_uboot 命令整理 01_stm32 裸板程序 01_了解嵌入式开发
nmcli 设置网络配置
靖意风 · 2025-12-30 · via 博客园 - 靖意风

1> 查看设备和信息

nmcli device status
nmcli connection show
nmcli connection show --active
nmcli  -f  NAME,FILENAME connection show

2> 修改 connection-id
nmcli connection modify "Wired connection 1" connection.id net_eth0
nmcli connection modify "Wired connection 2" connection.id net_eth1

3> 通过connection-id 修改 等参数

nmcli connection modify net_eth0 ipv4.addresses "192.168.82.15/24"
nmcli connection modify net_eth0 ipv4.addresses "192.168.81.12/24" ipv4.gateway "192.168.81.1" ipv4.dns "8.8.8.8,1.1.1.1" ipv4.method manual 802-3-ethernet.speed 100 802-3-ethernet.duplex full 802-3-ethernet.auto-negotiate no

注意修改之后,需要重启才能生效
sudo nmcli connection down net_eth0
sudo nmcli connection up net_eth0

查看 脚本内容

# cat /etc/NetworkManager/system-connections/xx.nmconnection
[connection]
id=eth0-connection
uuid=d46876b6-14d7-4ef4-a7a2-d323fc66c695
type=ethernet
interface-name=eth0
permissions=
timestamp=1651364936

[ethernet]
mac-address-blacklist=

[802-3-ethernet]
speed=100
duplex=full
auto-negotiate=false


[ipv4]
address1=192.168.1.20/24
dns-search=
method=manual

[ipv6]
addr-gen-mode=stable-privacy
dns-search=
method=auto

[proxy]
#

4> 命令

ethtool -s eth0 autoneg off speed 1000 duplex full