After the network configuration OpenWrt Brush

EDITORIAL:
This article aims to summarize the backup, to facilitate future inquiries, as is the personal summary, if wrong, please correct me; in addition, most of the content from the Internet, books, and various manuals, should please inform the infringement, immediately delete posts to apologize.

 

Before that a TP-wr703N TTL Brush and brush u-boot / breed course record , a record of saving brick tutorial; update later, download the package need to use the network, so now while there is time, make up the record; Let me talk about later on, according to a good brush openwrt, normal use can make the following operations, otherwise there may not succeed

 

The latter is the command line to modify the program, also can be modified by the appropriate file with WinSCP putty, in fact, two of the operation is the same, to achieve the effect of network configuration, configuration: System Network Configuration roughly divided into two may be connected to external networks through the route, but a higher level router must be connected to the router via the LAN port; a second landing routable IP address, the interface directly into the LuCl operation, the router is connected to the upper brush router wifi, and to relay PC connection mode and the higher router, switch network can not reach the external networks; the first major brush applied openwrt original document, without LuCl interface, the second is to change the brush has brought the magic altar Friends there LuCl interface, of course, you can not LUI interface configuration, with the first way configuration is also OK

 

To said first (via the LAN port on the router Brush to external networks, using network cable is connected to the upper routing):

If you are the original OpenWrt brush, then you can use this kind of operation, because the original LuCI interface without first using a network cable is connected to port 703N Lan your computer and provided to the computer DHCP mode. Then run cmd.exe
input telent 192.168.1.1

 

The specific method enabling the dhcp server are as follows:

1, pressing an "WIN + R" key, "cmd", click the OK button in the operation input box.

2, in the command box enter "services.msc", and press Enter.

3, after waiting a few seconds will pop up a service window, scroll down the mouse wheel or drag the slider to the right.

4, find the name of "DHCP Client" item, double-click the left mouse button.

5, in the pop-up window, click on the "OK" button, this time dhcp server will be set up successful.

Dhcp server start over from Baidu, Baidu although not want to play the ad, but still statement about the source of it!

 

After starting the DHCP Client, as seen above Telent look, OpenWrt welcome screen appears after successful:
 
then change the root password:
Enter passwd
to change the root password dropbear (SSH service) on the run, enter exit to exit telent
then went through ssh management OpenWrt

Because I brush the firmware is not the official website, so this step is not operated, the specific own tossing about,

1, using the putty vin configuration commands:

       After setting the route in accordance with the above landing a good password, open the putty this software, we landed inside; what you do not log in? Not a fancy one; after landing in, and then modify the configuration with vi (not vim with the students of the tragedy). But do not worry, followed by operation on the line

First modify / etc / config / wireless file

Input vi / etc / config / wireless Enter

Because I was LuCI configured to use other modes, so the information obtained is not the same, the specific see figure below right

Positive start drawing ↓


 
注释掉# option disabled 1
 
进入此界面后按i进入修改模式,改成如图所示
改好后按esc,然后输入:wq保存退出
然后修改 /etc/config/network文件。
首先修改 lan接口配置,注释掉此行:
# option ifname 'eth0'
然后增加wan接口,如果你上级网络是DHCP的,则文件的末尾添加:
config interface 'wan'
    option ifname 'eth0'
    option proto 'dhcp'


如果你上级网络是静态IP,则在文件的末尾添加:
config interface 'wan'
    option ifname 'eth0'
    option proto 'static'                          //静态模式
    option ipaddr '192.168.1.102'          //上级路由IP
    option netmask '255.255.255.0'
    option gateway '192.168.1.1'           //指向上级路由网关
    option dns '8.8.8.8'                          //指向上级路由 dns(没有可不设)
 
此图为修改为静态ip模式
然后将路由器的 Lan/Wan口接到上级网络中,重启路由器。
这时便可以通过电脑寻找SSID为 OpenWrt的无线网络,加入后电脑便可以通过703N上网了。
接着ssh 到路由器
登陆后输入

opkg update
opkg install luci

/etc/init.d/uhttpd enable
/etc/init.d/uhttpd start
就有luci(WEB)界面了~
完后就可以通过浏览器访问192.168.1.1来配置路由器了
 

上面说了,如果你不想用命令行进行编辑,你可以用 WinSCP对文件进行修改,修改内容跟上图的设置一样的,同样的登陆 WinSCP并打开,然后进入 /etc/config/ 修改network的配置和 wireless的配置

右键,点击 Open打开修改,编辑完后保存一下就好了

参数别跟着上图的修改,我的是其他模式的,具体的参数配置还是看最上面给出的 putty的图进行修改

 

现在来说第二种,基于 LuCI界面来修改(通过路由器的wan口连接外网(中继连接))

用网线连接PCTP703N路由器,此时PC已经断开其他网络

在浏览器里输入 http://192.168.1.1 (某人路由的访问地址)

如果是刚刷完自带 LuCI界面的,登陆路由就会出现上图那样,然后我们按 Login登陆一下,如果你之前没有 Telent路由,设置过密码(带LuCI界面的固件,好像 Telent不进去,不知为啥,反正我是进不去,哈哈哈),那么就有上面方框的的提示,登陆,如果没有设置过密码,默认是admin然后点击箭头指向的地方配置一下密码,如果点击了还是当前页面,那就在下面登陆那里输入 Username:root,Password:root(不知为啥,不是admin也可以,你们可以试试其他的),点Login进去,来到密码配置这里

输完两次密码后,在底部按下保存&应用就设置好了我们的路由密码了

接着就正式进入我们操作吧

按上图步骤点击,来到接口这里,这里只有一个 LAN网络

点击Edit,进入里面的配置,设置LanIp

值得注意的是,要设置和上级路由不通的网段,不然后面配置不成功,因为我的上级路由 IP 192.168.2.1,所以本例不用修改它的 IP(依然是192.168.1.1),如果你的上级路由 IP 192.168.1.1,那就要修改它的 IP了;如果你是要修改 IP的(例如修改成:192.168.10.1),那么在保存应用后,你刷新一下网页你会发现进入不了 openwrt的界面了,别担心,并没有死机变砖;拔掉TP703的电源,进入网络配置那里设置一下以太网的路段,改成下面的

记得要对应好你在 TP703设的IP,然后再回到浏览器打开你之前设置的IP地址,你会发现可以进入openwrt界面了

 

选择Network-> Wifi,查找并配置上级路由的AP

根据上图步骤操作,选择上级无线路由的AP,然后点击Join Network 按钮

输入上级路由的访问密码,并选择wan选项,然后点击submit 提交

建立连接后,页面会跳转到下图的界面

但你会发现中间方框的信号是没有的(不知是我的问题还是。。。。),然后再看下右上角的,配置好像没有成功,我们在底部按一下 Save&Apply,保存应用一下

???这是啥,先不管,点确认;我们去点那个右上方框住的蓝色提示那里,接着就得到了下图

什么都不用管,点保存应用,等它配置完

然后在Network-> Interface页面里查看刚才创建的wan的信息,如果连接成功上级的路由会自动分配一个IP给当前的703N,显示如下图

你看,上图的两个IP是不一样的,这就是为什么上面提到要与上级路由IP不一样,不然就分配不了IP给中继了

到此我们可以看到,上级的路由作为Client,703N路由作为master。

此时,因为之前还没通过中继连接到上级路由,细心的你可以发现在配置的过程中,你的电脑右下角的网络标志是有叹号的,当配置完连上后,电脑网络就好了,这样也可以检测你是否配置成功,当然,你也可以在 putty上键入命令 opkg update,看是否可以更新软件包

 

最后,放上一些参考链接:

https://www.geek-workshop.com/thread-2418-1-1.html

https://www.iteye.com/blog/codyjava-2184378

https://blog.csdn.net/bailyzheng/article/details/38345363

https://blog.csdn.net/eversimon/article/details/9261993

发布了29 篇原创文章 · 获赞 12 · 访问量 1万+

Guess you like

Origin blog.csdn.net/qq_42992084/article/details/103943058