修改主机名

如下命令

hostnamectl set-hostname Tianmoy.cn

其中 Tianmoy.cn 是要改的名称 当然也可以是Tianmoy
之后可以使用 bash 来刷新状态

修改静态IP

首先使用如下命令来进入网络配置文件

vi /etc/NetworkManager/system-connections/ens160.nmconnection

改为如下配置

[connection]
id=ens160
uuid=26d929de-cdfd-390e-b132-b34c711157cc
type=ethernet
autoconnect-priority=-999
interface-name=ens160
timestamp=1703146227

[ethernet]

[ipv4]
address=192.168.186.180/24,192.168.186.2
dns=119.29.29.29;
//method=auto
method=manual

[ipv6]
addr-gen-mode=eui64
method=auto

[proxy]

然后就是
刷新网络配置

nmcli connection load /etc/NetworkManager/system-connections/ens160.nmconnection

加载网络配置

nmcli connection up /etc/NetworkManager/system-connections/ens160.nmconnection

完成!

最后修改:2024 年 01 月 08 日
如果觉得我的文章对你有用,请随意赞赏