iWIN 必須被解散!

Weil Jimmer's BlogWeil Jimmer's Blog


軟路由初體驗 在 PVE 8.0 上安裝 OpenWrt 22.03

-
更新於 2023-08-27 21:48:25

前言

時隔多年,久違的發了一篇文章,五年來第一篇文章。長久以來一直沒發文的理由很可笑,因為我的圖床死了,然後我懶得修,一直認為寫文章怎麼可以沒有圖片,既然不能上傳圖片那就乾脆不寫。說實話有點後悔,最近肝了好幾天自己網站的code,寫了新的圖床系統,不過這是題外話了。

最近心血來潮,一直想搞個家裡的網路環境,原本想搞 10 Gb/s 的高速網路,但顯然我沒這個摳摳。直接放棄,先弄個 1 Gb/s 出來就很不錯了。

我們的主角登場!

配備

這次我訂購的軟路由,CPU 選用 Intel 的 J4125,看不少人說用 x86 CPU 比較好,我也是看很久才挑這個。記憶體的部分隨便配,RAM 8 GB,SSD 128 GB。有四個 2.5 GbE 的乙太網孔。

插上電和網線後,直連 PVE 的 WebUI,結果令我很意外,一直都進不去阿。心想怪事,為什麼連不上,檢查好幾次,還去看交換器設定頁,應該都沒錯啊。直接插上螢幕和鍵盤,Debug 老半天看不出所以然,直到我又重新檢查網線,看到我接的網路孔上面的小字 ETH3

默默地坐回位子上,修改 /etc/network/interfaces 把網孔換成 enp3s0 。應該插第一個孔,結果插到第四個,我一直以為我是插進 ETH0 阿…

重開機後,在瀏覽器上輸入 PVE 的預先設定好的靜態 IP,果然就成功連上 PVE 管理介面。

https://192.168.0.11:8006/

接著就是開始瞎搞的時刻,網路上很多教學,這裡也不講那麼多了,很簡單。犧牲一點空間安裝 OpenWrt 系統,各種 img 可以使用,我也算是嘗試了滿久。

然後啟動系統!

看到 OpenWrt 字樣就大功告成了!

不過 OpenWrt 預設的靜態 IP 是 192.168.1.1 跟我目前環境的網段不一樣,有點靠北。要先改成同網段才可以連上 SSH 和 WebUI 介面。

改完就可以 ping 通軟路由本身,直接用 putty 連上 SSH,設定防火牆允許 WAN 連上 WebUI 和 SSH。

uci add firewall rule
uci set firewall.@rule[-1].name='Allow-Admin'
uci set firewall.@rule[-1].enabled='true'
uci set firewall.@rule[-1].src='wan'
uci set firewall.@rule[-1].proto='tcp'
uci set firewall.@rule[-1].dest_port='22 80 443'
uci set firewall.@rule[-1].target='ACCEPT'
uci commit firewall
service firewall restart

不然原本我這邊的環境很麻煩,我又暫時不想動 LAN 的部分,以後我要拿它當作層三交換機(L3-Switch)阿!

設定完防火牆後,就可以透過我目前的網段連上 WebUI,因為我現在是接 WAN 的環境,以後可能會有兩層 NAT 架構。

想到我現在缺網路線,只能暫時先擱置這個計畫,等我網路線到貨再說。再加上我目前應該是用官方的,想嘗試看看 LEDE 的版本。有空再實驗吧,先告一段落,後續有進展再更新。

最後,使用 iperf3 測試一下內網速度!看到這速度,真棒。

其他文章:
使用 OpenWrt 踩坑經驗與心得 設置虛擬區域網路進行隔離
使用 OpenWrt 與 WireGuard 實現 NordVPN、雙層 NAT、特定區域網路 VPN 與 Kill Switch

By Weil Jimmer


This entry was posted in General, The Internet, OpenWrt, Tools By Weil Jimmer.

About Weil Jimmer

avatar

Hi! Everyone! My name is Weil Jimmer. This is my personal blog. I'm a webmaster of this site. I hope the site will be popular. Now, Let's go! Enjoy gaining more knowledge.
More Details About Me : https://weils.net/profile.php

Leave a Reply

Name*:

Email*:

Website:

Privacy:   

Comment*:

Visitor Count

pop
nonenonenone

Note

支持網路中立性.
Support Net Neutrality.

飽暖思淫欲,饑寒起盜心。

支持臺灣實施無條件基本收入

歡迎前來本站。

Words Quiz


Search

Music

Blogging Journey

4259days

since our first blog post.

The strong do what they can and the weak suffer what they must.

Privacy is your right and ability to be yourself and express yourself without the fear that someone is looking over your shoulder and that you might be punished for being yourself, whatever that may be.

It is quality rather than quantity that matters.

I WANT Internet Freedom.

Reality made most of people lost their childishness.

Justice,Freedom,Knowledge.

Without music life would be a mistake.

Support/Donate

This site also need a little money to maintain operations, not entirely without any cost in the Internet. Your donations will be the best support and power of the site.
MethodBitcoin Address
bitcoin1gtuwCjjVVrNUHPGvW6nsuWGxSwygUv4x
buymeacoffee
Register in linode via invitation link and stay active for three months.Linode

Support The Zeitgeist Movement

The Zeitgeist Movement

The Lie We Live

The Lie We Live

The Questions We Never Ask

The Questions We Never Ask

Man

Man

THE EMPLOYMENT

Man

In The Fall

In The Fall

Facebook is EATING the Internet

Facebook

Categories

Android (7)

Announcement (4)

Arduino (2)

Bash (2)

C (3)

C# (5)

C++ (1)

Experience (51)

Flash (2)

Free (13)

Functions (36)

Games (13)

General (59)

Git (2)

HTML (7)

Java (13)

JS (7)

Mood (24)

NAS (2)

Note (32)

Office (1)

OpenWrt (5)

PHP (9)

Privacy (4)

Product (12)

Python (4)

Software (11)

The Internet (24)

Tools (16)

VB.NET (8)

WebHosting (7)

Wi-Fi (5)

XML (4)