OPENWRT入门之四------openwrt命令行模式命令及其工具

来源:互联网 发布:淘宝 clarks小公主 编辑:程序博客网 时间:2024/05/18 02:35

OPENWRT入门之四------openwrt命令行模式命令及其工具

 

本文转自:http://blog.chinaunix.net/uid-9688646-id-5025317.html

需要学会用ssh登录路由器用linux命令查看。
  ps 命令查看当前系统运行的进程信息
  free 命令查看内存使用和swap挂载情况
  ls 查看目录和文件
  cd 进入退出目录
  vi 查看编辑配置文件
  安装命令:
  1. #opkg update
  2. #opkg install nano
  3. + N2 U! x4 e% G. O- k
  4. uci set network.lan.ipaddr=[lan ip]
复制代码
使用pppoe设置
  Shell代码
  1. uci set network.wan.proto=pppoe    //设置wan口类型为pppoe
  2. uci set network.wan.username=[上网帐户] 
  3. uci set network.wan.password=[上网密码]    //这两行设置pppoe用户名和密码
复制代码
如果要挂在上级路由下面,就需要进行下面的设置
  Shell代码
  1. uci set network.wan.proto=none    //关掉wan 
  2. uci set network.lan.gateway=[上级路由ip]    //网关指向上级路由
  3. uci set network.lan.dns=[上级路由ip]    //dns指向上级路由  :
  4. uci set dhcp.lan.ignore=1    //关掉lan的dhcp
复制代码
最后对无线网络进行配置
  Shell代码
  1. uci set wireless.@wifi-device[0].disabled=0    //打开无线  )
  2. uci set wireless.@wifi-device[0].txpower=17    //设置功率为17dbm 太高会烧无线模块
  3. uci set wireless.@wifi-device[0].channel=6    //设置无线信道为6 
  4. uci set wireless.@wifi-iface[0].mode=ap    //设置无线模式为ap 
  5. uci set wireless.@wifi-iface[0].ssid=[自己设置SSID]    //设置无线SSID 
  6. uci set wireless.@wifi-iface[0].network=lan    //无线链接到lan上
  7. uci set wireless.@wifi-iface[0].encryption=psk2    //设置加密为WPA2-PSK
  8. uci set wireless.@wifi-iface[0].key=[密码]    //设置无线密码
复制代码
提交应用配置
  Shell代码
  1. uci commit    //应用
  2. /etc/init.d/network restart    //重启网络服务
复制代码
安装luci管理界面
  Shell代码
  1. opkg update // 更新软件列表 
  2. opkg list-installed // 查看已安装软件
  3. opkg install luci // 安装LUCI 
  4. opkg install luci-i18n-chinese // 支持中文
  5. luci-app-firewall - 0.10.0-1
  6. luci-i18n-english - 0.10.0-1
  7. luci-lib-core - 0.10.0-1
  8. luci-lib-ipkg - 0.10.0-1
  9. luci-lib-lmo - 0.10.0-1
  10. luci-lib-nixio - 0.10.0-1
  11. luci-lib-sys - 0.10.0-1
  12. luci-lib-web - 0.10.0-1
  13. luci-mod-admin-core - 0.10.0-1
  14. luci-mod-admin-full - 0.10.0-1
  15. luci-proto-core - 0.10.0-1
  16. luci-proto-ppp - 0.10.0-1
  17. luci-sgi-cgi - 0.10.0-1
  18. luci-theme-base - 0.10.0-1
  19. luci-theme-openwrt - 0.10.0-1
复制代码
即可完成LUCI的安装。
  输入以下命令开启支持web服务的uhttpd,并设置其为自启动:
  Shell代码
  1. /etc/init.d/uhttpd enable # 开机自启动
  2. /etc/init.d/uhttpd start # 启动uhttpd
复制代码
- Wifidog
  你可以尝试执行以下命令安装Wifidog
  1. opkg update # Optional
复制代码
--sftp安装
  1. opkg update
  2. opkg install vsftpd openssh-sftp-server
  3. /etc/init.d/vsftpd enable
  4. /etc/init.d/vsftpd start
复制代码
小米端口转发命令:
  通过修改 /etc/config/firewall 这个文件来实现开放自己需要的端口到外网
  1. config rule 'httpdwan'
  2.         option src 'wan'
  3.         option dest_port '8088'
  4.         option proto 'tcp'
  5.         option target 'ACCEPT'
  6.         option name ''\''httpd wan accept tcp port 8088'
复制代码
保存后,执行 /etc/init.d/firewall restart 重启防火墙。
  SSH工具:
  1.WINSCPWinSCP.rar (7.7 MB, 下载次数: 47)
  2.putty中文版putty.rar (233.87 KB, 下载次数: 28)中文的使用的难度相对低一点
  3.熟练一些的用户推荐 SecureCRT
  操作多台设备的时候,十分的方便。这个自行搜索安装吧~
  附VI命令图:
本文转载自:小米社区
0 0
原创粉丝点击