wiki-files/centos/problems.md

50 lines
931 B
Markdown
Raw Normal View History

2021-08-05 16:58:33 +08:00
---
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
```