# 上网设置的图文教程

### 设置OpenWrt的上网方式

设置OpenWrt的上网方式，从而让它能够连接到互联网。

进入【网络】-【接口】，选择【WAN】后面的【修改】

![](https://pic2.zhimg.com/80/v2-93cbfb58753ae8a0b8314ce88d7d1235_720w.jpg)

修改【WAN】的上网方式

常用的上网方式有三类：

* DHCP客户端（默认）：也就是常见的【自动获取IP】，由上游路由器或者DHCP服务器分配IP地址
* 静态地址：IP地址需要手动设置
* PPPoE：普通家庭最常见的【宽带拨号上网】，输入宽带用户名和密码就能上网

![](https://pic4.zhimg.com/80/v2-6dd0eedad845269d2a10faed988e51af_720w.jpg)

改变协议之后，点击【切换协议】即可切换到选择的协议。

#### 第一种上网方式：DHCP客户端

DHCP客户端设置，没啥好设置的

![](https://pic1.zhimg.com/80/v2-aedcbc62908574c3fca6c26f4376faf4_720w.jpg)

#### 第二种上网方式：静态地址

静态地址中的【IPv4地址】、【IPv4子网掩码】、【IPv4网关】、【DNS服务器】四项是必须要设置的

![](https://pic4.zhimg.com/80/v2-45697e77117e6f7b7bc54bf816b1ab63_720w.jpg)静态地址的设置

#### 第三种上网方式：PPPoE

宽带拨号设置中，只需要设置【宽带账号（用户名）】和【宽带密码】即可。

![](https://pic3.zhimg.com/80/v2-bfc734641b88664123a7f01172c5fbaa_720w.jpg)PPPoE拨号的设置

设置好之后，一定要点击【保存&应用】哦！

**啥？您不知道您家是哪种上网方式？**

* 请您进入您家旧路由的管理界面，看一下上网设置。
* 如果是【动态IP】或【自动获取IP地址】，那么对应【DHCP客户端】
* 如果是【静态IP】或【固定IP地址】，那么对应【静态地址】
* 如果是【PPPoE】或【宽带拨号上网】，那么对应【PPPoE】

**啥？WAN6是干嘛用的？**

一般情况下没作用，可以关闭或删除。

### 三、连接网线，开始上网

#### 基础连接方法

![](https://pic3.zhimg.com/80/v2-8860d8c6691dc8c191c71ed80115087e_720w.jpg)基础连线方式

请确保其他路由的管理IP不能与光猫和OpenWrt的IP重复哦！


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mmensee.gitbook.io/r2s-r4s/master/shang-wang-she-zhi-de-tu-wen-jiao-cheng.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
