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

推荐订阅源

美团技术团队
D
DataBreaches.Net
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
D
Docker
N
Netflix TechBlog - Medium
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
C
Check Point Blog
腾讯CDC
Stack Overflow Blog
Stack Overflow Blog
V
Visual Studio Blog
IT之家
IT之家
月光博客
月光博客
U
Unit 42
K
Kaspersky official blog
T
Threatpost
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
GbyAI
GbyAI
P
Proofpoint News Feed
Last Week in AI
Last Week in AI
云风的 BLOG
云风的 BLOG
酷 壳 – CoolShell
酷 壳 – CoolShell
I
InfoQ
Engineering at Meta
Engineering at Meta
Recorded Future
Recorded Future
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
S
Security @ Cisco Blogs
MyScale Blog
MyScale Blog
大猫的无限游戏
大猫的无限游戏
Security Archives - TechRepublic
Security Archives - TechRepublic
Webroot Blog
Webroot Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Hacker News - Newest:
Hacker News - Newest: "LLM"
S
Schneier on Security
S
Secure Thoughts
The Register - Security
The Register - Security
B
Blog RSS Feed
The Last Watchdog
The Last Watchdog
P
Palo Alto Networks Blog
爱范儿
爱范儿
B
Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
N
News and Events Feed by Topic
阮一峰的网络日志
阮一峰的网络日志
L
LINUX DO - 热门话题
C
Cisco Blogs
Spread Privacy
Spread Privacy
F
Full Disclosure
博客园 - 聂微东
T
The Blog of Author Tim Ferriss

博客园 - 白马黑衣

网络安全3 - Easy RSA重新签发客户端证书 RHEL - 笔记本合盖不休眠 RHEL - yum cache JFrog Artifactory 系列6 --- 其他配置 Node.js - 配置npm Rocky Linux 升级失败 Nginx 系列2 --- 配置 Linux --- firewalld 2 - nfttables Linux - DNS Apache HTTP Server 关闭SELinux Linux --- 查看PID 判断端口是否已经被占用 Maven 常用命令 Jenkins 系列3 --- pipeline Git自签名证书的验证 iptables Jenkins 系列2 --- Node/Agent Jenkins 系列1 --- 安装与配置
RHEL - 设置hostname和IP地址
白马黑衣 · 2023-11-26 · via 博客园 - 白马黑衣

一、概要

1. 环境

Rocky Linux 9.3

二、配置

1. hostname

sudo hostnamectl set-hostname <hostname>

2. IP

(1) 找到当前网卡

GENERAL.DEVICE为当前网卡。

(2) 查看当前网卡信息

(3) 设置自动获取IP地址

su
nmcli con mod enp1s0 ipv4.gateway '' && nmcli con mod enp1s0 ipv4.address '' && nmcli con mod enp1s0 ipv4.method auto && nmcli con down enp1s0 && nmcli con up enp1s0

(4) 设置静态IP地址

su
nmcli con mod enp1s0 ipv4.gateway '192.168.28.1' && nmcli con mod enp1s0 ipv4.dns '192.168.28.1' && nmcli con mod enp1s0 ipv4.address '192.168.28.75' && nmcli con mod enp1s0 ipv4.method manual && nmcli con down enp1s0 && nmcli con up enp1s0

或:

sudo nmcli connection modify enp1s0 ipv4.method manual ipv4.address '192.168.28.77/24' ipv4.gateway '192.168.28.1' ipv4.dns '192.168.28.1'
sudo nmcli con down enp1s0 && sudo nmcli con up enp1s0

3. 测试

三、参考

https://docs.rockylinux.org/guides/network/basic_network_configuration/

https://developer-old.gnome.org/NetworkManager/stable/settings-ipv4.html