3.3 网络服务管理

3.3 网络服务管理 #

网络管理工具常用的有 2 套,一个是 network,另一个是 networkManger。在 Centos 6 中只有 network,在某些 Centos 7 机器中可能 2 套都存在,不要把 2 套工具都 enable,在工作中,一般只用一个禁用另外一个。

systemctl disable NetworkManager
systemctl enable NetworkManager

service network status
service network restart

一般在服务器上常用 network 工具。networkManager 常用在个人电脑上。

3.3.1 设置主机名 #

临时修改主机名:hostname 临时主机名 系统重启后会被重置。

永久修改主机名:hostnamectl 永久主机名 是对 /etc/hostname 文件的内容进行修改。

3.3.1 service #

参考 #