OpenWrt鏡像製作

場景

最近想弄一箇舊筆記本的OpenWrt路由器,所以這裏需要使用OpenWrt官網鏡像文件製作一個u盤的OpenWrt啓動盤。

步驟

下載鏡像

在OpenWrt官網的所有固件鏡像下載頁面,下載X86-64的固件鏡像文件,如下圖:
OpenWrt官網固件X86-64鏡像
具體下載地址如下:
https://downloads.openwrt.org/releases/19.07.2/targets/x86/64/
但這裏涉及一個版本選擇但問題,到底該選擇下那個版本?
這裏看一下引用一下官網的文章介紹:

combined-squashfs.img.gz This disk image uses the traditional OpenWrt layout, a squashfs read-only root filesystem and a read-write partition where settings and packages you install are stored. Due to how this image is assembled, you will have only 230-ish MB of space to store additional packages and configuration, and Extroot does not work.
combined-ext4.img.gz This disk image uses a single read-write ext4 partition with no read-only squashfs root filesystem, which allows to enlarge the partition. Features like Failsafe Mode or Factory Reset won’t be available as they need a read-only squashfs partition to function.

簡單來說,就是squashfs版本有重置的功能,ext4沒有,ext4改了就改了。squashfs最大空間就只有230MB空間,ext4可以擴容。

etcher製作鏡像

這裏是使用etcher來製作u盤啓動鏡像。然後,在就筆記本設置從u盤啓動,這樣就不用推掉筆記本原有的系統,這樣對筆記本原有系統沒有任何影響。

設置路由器ip

啓動系統成功後,在舊筆記本網口上面插上網線,遠程電腦連接這個網線,遠程的電腦獲得的ip段應該爲192.168.1.x段的,然後在遠程電腦瀏覽器中敲入192.168.1.1就可以使用root賬號登錄,這個web界面就是OpenWrt的原生web界面。
我們還可以用ssh方式的root賬號進行登錄,登錄成功後,使用如下命令設置路由器luc的界面訪問IP地址:

uci set network.lan.ipaddr=192.168.2.1
uci commit network
ifup lan

總結

openwrt原生系統也很好用,網上資料也挺多的,雖然中文內容關於原生openwrt不多,不過官方教程博客還是很豐富的。

參考

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章