谷动谷力

 找回密码
 立即注册
查看: 1149|回复: 0
打印 上一主题 下一主题
收起左侧

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

[复制链接]
跳转到指定楼层
楼主
发表于 2022-3-4 21:24:12 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 sunsili 于 2022-11-15 10:54 编辑

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


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



需要学会用ssh登录路由器用linux命令查看。

  ps 命令查看当前系统运行的进程信息
  free 命令查看内存使用和swap挂载情况
  ls 查看目录和文件
  cd 进入退出目录
  vi 查看编辑配置文件
  安装命令:
  • #opkg update
  • #opkg install nano
  • + N2 U! x4 e% G. O- k
  • uci set network.lan.ipaddr=[lan ip]


使用pppoe设置
  Shell代码uci set network.wan.proto=pppoe    //设置wan口类型为pppoe
uci set network.wan.username=[上网帐户]
uci set network.wan.password=[上网密码]    //这两行设置pppoe用户名和密码



如果要挂在上级路由下面,就需要进行下面的设置
  Shell代码uci set network.wan.proto=none    //关掉wan  
uci set network.lan.gateway=[上级路由ip]    //网关指向上级路由
uci set network.lan.dns=[上级路由ip]    //dns指向上级路由  :
uci set dhcp.lan.ignore=1    //关掉lan的dhcp


最后对无线网络进行配置
  Shell代码
uci set wireless.@wifi-device[0].disabled=0    //打开无线  )
uci set wireless.@wifi-device[0].txpower=17    //设置功率为17dbm 太高会烧无线模块
uci set wireless.@wifi-device[0].channel=6    //设置无线信道为6  
uci set wireless.@wifi-iface[0].mode=ap    //设置无线模式为ap  
uci set wireless.@wifi-iface[0].ssid=[自己设置SSID]    //设置无线SSID  
uci set wireless.@wifi-iface[0].network=lan    //无线链接到lan上
uci set wireless.@wifi-iface[0].encryption=psk2    //设置加密为WPA2-PSK
uci set wireless.@wifi-iface[0].key=[密码]    //设置无线密码


提交应用配置
  Shell代码
uci commit    //应用
/etc/init.d/network restart    //重启网络服务


安装luci管理界面
  Shell代码
opkg update // 更新软件列表  
opkg list-installed // 查看已安装软件
opkg install luci // 安装LUCI  
opkg install luci-i18n-chinese // 支持中文
luci-app-firewall - 0.10.0-1
luci-i18n-english - 0.10.0-1
luci-lib-core - 0.10.0-1
luci-lib-ipkg - 0.10.0-1
luci-lib-lmo - 0.10.0-1
luci-lib-nixio - 0.10.0-1
luci-lib-sys - 0.10.0-1
luci-lib-web - 0.10.0-1
luci-mod-admin-core - 0.10.0-1
luci-mod-admin-full - 0.10.0-1
luci-proto-core - 0.10.0-1
luci-proto-ppp - 0.10.0-1
luci-sgi-cgi - 0.10.0-1
luci-theme-base - 0.10.0-1
luci-theme-openwrt - 0.10.0-1

即可完成LUCI的安装。
  输入以下命令开启支持web服务的uhttpd,并设置其为自启动:
  Shell代码
/etc/init.d/uhttpd enable # 开机自启动
/etc/init.d/uhttpd start # 启动uhttpd

复制代码
- Wifidog
  你可以尝试执行以下命令安装Wifidog
opkg update # Optional


--sftp安装
opkg update
opkg install vsftpd openssh-sftp-server
/etc/init.d/vsftpd enable
/etc/init.d/vsftpd start


小米端口转发命令:
  通过修改 /etc/config/firewall 这个文件来实现开放自己需要的端口到外网
config rule 'httpdwan'
        option src 'wan'
        option dest_port '8088'
        option proto 'tcp'
        option target 'ACCEPT'
        option name ''\''httpd wan accept tcp port 8088'


保存后,执行 /etc/init.d/firewall restart 重启防火墙。


+10
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|深圳市光明谷科技有限公司|光明谷商城|Sunshine Silicon Corpporation ( 粤ICP备14060730号|Sitemap

GMT+8, 2024-5-28 04:15 , Processed in 0.074942 second(s), 35 queries .

Powered by Discuz! X3.2 Licensed

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表