Skip to content

Commit

Permalink
openwrt没有网络问题
Browse files Browse the repository at this point in the history
  • Loading branch information
ChenSino committed Dec 10, 2024
1 parent f9af745 commit a2dcb43
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions docs/myserver/OpenWRT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: OpenWRT
date: 2024-12-10
author: chensino
publish: true
isOriginal: true
---

### 问题1:新安装的openwrt没有网络

> 表现为`/etc/resolv.conf`中的dns解析配置nameserver是127.0.0.1,这时ping baidu.com是不通的,但是ping外网ip是可以的,如果手动修改nameserver为
192.168.1.1则发现openwrt网络恢复,但是过一会这个nameserver会被还原为127.0.0.1。说明问题就出现在dns解析上

**解决方法:**

在openwrt设置页面,网络——DHCP/DNS设置页面,把dns转发填写为192.168.1.1,或者其他114.114.114.114之类的dns服务即可。

原理就是当nameserver配置127.0.0.1使用的其实是openwrt自带的dnsmasq提供dns服务,但是没给这个服务设置上游dns所以无法解析。

0 comments on commit a2dcb43

Please sign in to comment.