Linux中配置网络地址,主机名
临时设置主机名 # hostname hello
exit退出终端,再重新进入生效
永久设置主机名
echo "hello" > /etc/hostname 或
vim /etc/hostnam
cat /etc/hostname
hello
重启计算机生效
reboot
检查结果
hostname
hello
配置静态ip地址参数
1.查看当前主机的网卡设备
nmcli connection show
名称 UUID 类型 设备
System eth0 5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03 802-3-ethernet eth0
2.修改连接 "System eth0" 的配置
nmcli connection modify "System eth0" ipv4.method manual ipv4.addresses "172.25.0.11/24" connection.autoconnect yes
3.重新激活连接 "System eth0 ",通过 up指令激活,必要时可以先down再up
nmcli connection up "System eth0"
4.确保系统服务NetworkManager开机自启:
systemctl restart NetworkManager
systemctl enable NetworkManager
5.4)检查修改结果,确认无误
检查IP地址:
ifconfig eth0
继续阅读与本文标签相同的文章
上一篇 :
关于实时架构的一点想法
下一篇 :
AJAX工作原理及其优缺点
-
如何修改DNN默认的DOCTYPE
2026-05-25栏目: 教程
-
DotNetNuke安装大全-如何安装DNN StartKit、Install、Source包。(转载)
2026-05-25栏目: 教程
-
用 Go 写一个轻量级的 ssh 批量操作工具
2026-05-25栏目: 教程
-
如何汉化DNN--中文语言包的使用
2026-05-25栏目: 教程
-
DNN皮肤对象[LINKS]和[BREADCRUMB]区别
2026-05-25栏目: 教程
