RG100A-AA 中大校园网上网及远程配置

  因为无线网卡用得不爽,wifi常常断,因此想整个路由器,造福群众。在朋友介绍下购得一台已经刷好 Openwrt 的上海贝尔RG100A-AA路由器,根据下面的简单步骤,就能链接上校园网。node

1、准备工做linux

  1.一电脑,系统windows和Linux都行。windows要有能够远程linux的软件(putty、Xshell)shell

  2.两网线,一根连路由器(lan4)和墙上网络端口,一根连路由器(lan1/2/3)和电脑windows

2、配置network浏览器

  1. 先远程进入路由器:本人是在windows操做的,使用的是Xshell,连的是路由器发出的wifi(OpenWrt-DreamBox),命令:ssh root@192.168.1.1。网络

  2. 复制下面的文本,并覆盖到/etc/config/network,重启网络服务,可能会断开ssh链接。ssh

  建议:先将该network文件以及下列步骤中的cp.ipk 和nj.ipk拷进u盘,再将u盘插到路由器上,再进入挂载点/mnt/sda1拷贝进路由器。oop

config 'interface' 'loopback'
    option 'ifname' 'lo'
    option 'proto' 'static'
    option 'ipaddr' '127.0.0.1'
    option 'netmask' '255.0.0.0'

config 'switch' 'eth1'
    option 'reset' '1'
    option 'enable_vlan' '1'

config 'switch_vlan'
    option 'device' 'eth1'
    option 'vlan' '0'
    option 'ports' '0 1 2 5*'

config 'switch_vlan'
    option 'device' 'eth1'
    option 'vlan' '1'
    option 'ports' '3 5*'

config 'interface' 'lan'
    option 'type' 'bridge'
    option 'ifname' 'eth1.0'
    option 'proto' 'static'
    option 'netmask' '255.255.255.0'
    option 'nat' '1'
    option 'ipaddr' '192.168.1.1'

config 'interface' 'wan'
    option 'ifname' 'eth1.1'
    option 'proto' 'dhcp' 

3、安装njit-client测试

  1.安装libcap:libcap是njit-client 的依赖包,下载 cp.ipk并传输到路由器内,使用opkg install cp.ipk安装。this

  2.安装njit-client:下载 nj.ipk,传输到路由器内,使用opkg install nj.ipk 安装。可在这里下载。(感谢@灵动grace提供)

4、测试链接校园网

  网线接lan4,在ssh终端中输入:

njit-client inode帐号 inode密码 eth1.1 & 

  看是否能正常拨号,并测试网页是否能打开。

5、设置开机自启动校园网链接

  打开/etc/rc.local,修改以下

# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.

(njit-client inode帐号 inode密码 eth1.1) & 
exit
0

理论上,到这里你就能正常的上网了^0^,以上内容参考自大神的博客:Gracece Blog.

固然电脑少不了远程嘛,要怎么从实验室、教学楼、图书馆远程宿舍电脑呢?继续看下去....

6、路由器端口映射

      Attention: 小伙伴,请把你电脑的防火墙关了~~

  为了从外面远程宿舍电脑,需对路由器端口进行映射。在浏览器中输入:http://192.168.1.1/可进入路由器管理页面,初始用户为root,密码admin。

  进入“网络”->“端口映射”,添加一下几条记录:其中外部端口是远程时使用的端口(可本身设定),内部端口是本机端口,22为linux远程端口,3389为windows远程端口。

  从其余地方远程宿舍电脑时,若为linux,命令为: ssh IP地址:9999;  windows请打开远程桌面链接,输入:IP地址:4000。(此处的IP地址为路由器ip,进入路由器输命令ifconfig,eth1.1 对应IP为路由器IP)。

  基本内容到此结束!感谢小伙伴Grace、Gavin、Gccon支持。

相关文章
相关标签/搜索
本站公众号
   欢迎关注本站公众号,获取更多信息