diff --git a/centos/problems.md b/centos/problems.md new file mode 100644 index 0000000..89901da --- /dev/null +++ b/centos/problems.md @@ -0,0 +1,50 @@ +--- +title: 常见问题 +description: 常见问题和处理方法 +published: true +date: 2021-08-05T08:58:32.044Z +tags: centos +editor: markdown +dateCreated: 2021-08-05T08:58:32.044Z +--- + +# 新安装系统无法上网 +1. 确认网线已经插好 +2. 编辑IP配置文件 + +```bash +$ vim /etc/sysconfig/network-scripts/ifcfg-ens33 +``` + +3. `ONBOOT=no` 改为 `ONBOOT=yes` +4. 重启系统 + +![wx20210805-165432@2x.png](/wx20210805-165432@2x.png) + +# 设置静态IP +1. 编辑IP配置文件 + +```bash +$ vim /etc/sysconfig/network-scripts/ifcfg-ens33 +``` + +2. 编辑如下配置 + +```vim +# 使用静态IP地址,默认为dhcp +BOOTPROTO="static" +# 设置的静态IP地址 +IPADDR="192.168.0.100" +# 子网掩码 +NETMASK="255.255.255.0" +# 网关地址 +GATEWAY="192.168.0.1" +# DNS服务器(此设置没有用到,所以我的里面没有添加) +DNS1="8.8.8.8" +DNS2="114.114.114.114" +``` + +3. 重启服务 +```bash +$ systemctl restart network +``` \ No newline at end of file