0%

openwrt筆記

需求

  • 便宜
  • 有線1gbps速度
  • 無線400mbps 以上
  • pppoe硬撥
  • pppoe穿透(讓後面的電腦可以pppoe撥號)
  • openvpn server(?)

編譯

一開始使用coolsnowwolf/lede來編譯,可是發現wifi性能很差,只有25MB/s,經過排查,發現可能是開源驅動的問題
後來改用openwrt主線編譯,就一切正常

編譯環境

使用linux,配置安裝環境會容易很多(包管理器install就好)
參考官方教學

安裝luci

openwrt預設是沒有web ui的,需要安裝luci

1
2
./scripts/feeds update packages luci
./scripts/feeds install -a -p luci

選擇要安裝的模組

1
make menuconfig

安裝才會有http界面

1
LuCI->Applications->luci-app-uhttpd

UI界面,建議全選

1
LuCI->Themes

語言

1
LuCI->Modules->Translations

編譯

第一次編譯應該使用單核心來編譯,以免發生錯誤(會很久)

1
make

之後有做修改,需要重新編譯可以用多核心編譯

1
make -j

j後面的數字代表要用多少核心,沒有數字代表全部核心一起編譯

pppoe穿透

先在make menuconfig中選擇pppoe-relay功能

1
Network->Dial-in/up->rp-pppoe-relay

安裝後的pppoe-relay會加入開機自動啟動名單中
但還是沒辦法用

需要在系統->開機自動執行->本地啟動中加入一行指令

1
pppoe-relay -S wan -C br-lan

wan是wan端口,br-lan指的是區網端口

不要使用opkg upgrade

官方建議不要使用opkg upgrade

Generally speaking, the use of opkg upgrade is very highly discouraged. It should be avoided in almost all circumstances. In particular, bulk upgrading is very likely to result in major problems, but even upgrading individual packages may cause issues. It is also important to stress that this is distinctly different from the sysupgrade path for upgrading OpenWrt releases (major versions as well as maintenance upgrades). opkg upgrade will not update the OpenWrt version. Only sysupgrade can do that. The two are not equivalent.