Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【Linux】CentOS 7 设置静态IP #54

Open
SilenceHVK opened this issue Oct 16, 2018 · 0 comments
Open

【Linux】CentOS 7 设置静态IP #54

SilenceHVK opened this issue Oct 16, 2018 · 0 comments
Labels

Comments

@SilenceHVK
Copy link
Owner

  1. 验证网络管理器服务的状态
$ systemctl status NetworkManager.service
  1. 检查受网络管理器管理的网络接口
$ nmcli dev status 
  1. 进入 /etc/sysconfig/network-scripts 文件,找到配置文件
# 设置为静态
BOOTPROTO=static
# 定义 IP 地址
IPADDR=192.168.129.159
# 定义网卡
NETMASK=255.255.255.0
# 定义网关
GATEWAY=172.16.79.2
# 接口将通过该配置文件进行设置
NM_CONTROLLED=no
# 启动时开启该接口
ONBOOT=yes
  1. 编辑 /etc/resolv.conf
nameserver 0.0.0.0
nameserver 114.114.114.114
search localhost
  1. 重启 network 服务
$ systemctl restart network.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant