【OpenWRT】使用命令行进行简单设置

一台新装的OpenWRT一般没有WEB管理界面(luci),那么我们需要通过SSH、Telnet或者Serial等方式连接进行简单配置。

  • 设置LAN IP(路由器管理IP):
uci set network.lan.ipaddr=[lan ip]
  • 设置pppoe上网方式:
uci set network.wan.proto=pppoe
uci set network.wan.username=[username]
uci set network.man.password=[password]
  • 作为二级路由的设置:
uci set network.wan.proto=none
uci set network.lan.getway=[last route ip]
uci set network.lan.dns=[last route ip]
uci set dhcp.lan.ignore=1    //close lan's DHCP
  • 提交应用配置:
uci commit
/etc/init.d/network restart
  • 安装luci管理界面:
opkg update    //update software list
opkg list-installed    //installed software
opkg install luci    //install luci
opkg install luci-i18n-chinese    //luci chinese(brfore 15.05)
opkg install luci-i18n-base-zh-cn    //luci chinese
  • 开启web服务的uhttpd,并设置为自启动:
/etc/init.d/uhttpd enable
/etc/init.d/uhttpd start

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注