openwrt常用命令

openwrt 编译

1. 编译单个套件
make package/cups/{clean,compile,install} V=s

再make image

2. 全编

make V=s

3. 编译的时候查找错误

make V=s 2>&1 | tee build.log | grep -i '[^_-"a-z]error[^_-.a-z]' 

4. clean

make clean:删除/bin和/build_dr,而不会删除/targt
make distclean:删除所有已经编译的,以及下载的feeds和packets,.config文件也会被删掉
make target/linux/clean:删除linux
make package/base-files/clean:删除packets
make package/luci/clean:删除luci

软件包安装快速入门

将OpenWrt/LEDE固件刷入设备后,您可以通过SSH或LuCi使用'opkg'软件包管理器中安装其他软件包:

SSH:

  • 使用SSH登录。

  • 在命令行中运行一次 opkg update 命令以便从OpenWrt在线软件存储库中提取可用软件包的新列表。

  • 运行 opkg list 以显示可用软件包的列表(该列表对每个包也有一个非常简短的注释)。

  • 运行 opkg list | grep 'searchterm' 可以过滤软件包列表,仅显示名称或注释中包含'searchterm'的软件包。

  • 运行 opkg install packagename 以安装列表中对应名称的软件包。

  • 运行 opkg remove packagename 以卸载对应名称的软件包。

LuCi Web GUI:

  • LuCi(http:您的设备IP)提供了用于安装其他软件包的图形用户界面(GUI)。

  • 请注意,许多软件包有可选的LuCi GUI,但如果您需要额外的图形用户界面,通常需要安装额外的软件包。

  • 2
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
openwrt命令行模式命令及其工具 需要学会用ssh登录路由器用linux命令查看。 ps 命令查看当前系统运行的进程信息 free 命令查看内存使用和swap挂载情况 ls 查看目录和文件 cd 进入退出目录 vi 查看编辑配置文件 安装命令: #opkg update #opkg install nano 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 opkg install wifidog --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个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值