{
"title": "OPNsense 在 Proxmox VE 內安裝筆記",
"slug": "opnsense-virtualization-in-proxmox-ve",
"tags": [
"Linux",
"Apps - 軟體"
],
"published_at": "2023-01-29T10:46:00.000Z",
"type": "post",
"ghost_id": "67e4d4f6c5a22a0001354611",
"status": "published",
"visibility": "public",
"featured": false,
"created_at": "2025-03-27T04:32:54.000Z",
"updated_at": "2025-03-27T04:38:57.000Z",
"custom_excerpt": "更換了軟路由硬體故順便更新了筆記",
"authors": [
"Gbanyan"
],
"feature_image": "../assets/photo-1520869562399-e772f042f422.jpg",
"body": {
"raw": "\n## 前言\n\n* 更換了軟路由硬體故順便更新了筆記\n* 此篇繼承了 [Proxmox VE + PfSense 安裝](__GHOST_URL__/proxmox-ve-pfsense-installation-note/)\n + 在 Proxmox VE 內的網路安裝架構仍然類似,皆採用半虛擬化網卡 Virtio Net 的架構\n + 經過測試,Intel J4125 搭配 Intel i225v 網卡, 不用設定網卡直通,也可以跑滿 300M / 100M\n* 更換成 OPNsense 原因有以下考量:\n + PfSense 需要訂閱 (PfSense Plus) 才會獲得較積極的更新,雖然個人用戶目前免費,但不排除未來需付費可能\n + OPNsense 的更新策略較為積極,安全性更新週期較短\n + 可安裝 Zenarmor 以及其他第三方套件來源,雖然後面還是把 Zenarmor 移除了\n + OPNsense 的 UI 比較人性化一些,可以善用搜尋快速跳到自己想要的設定欄位\n\n## 初始安裝 Installation\n\n* Assign the Port vmbr0 to WAN and vmbr1 to LAN (參見 PfSense 筆記內圖片)\n* Skip the lagg and vlan configuration\n* Default account and password for enter installation\n + account: installer\n + pass; opnsense\n* Proxmox VE 內 VM 的設定\n + machine type: Q35\n + processors type: host\n + OS type: other\n + 其他 CPU, memory 視需求調整\n\n## 設定 Configuration\n\n### PPPoE settings with IPv6 (適用 Hinet)\n\n* Fill out PPPoE info to establish connection\n* Tick \"Use IPv4 connectivity option\"\n* at LAN IPv6 section, IPv6 configuration type -> Track Interface, and the options below interface select \"WAN\"\n* In the Firewall options, Tick \"allow IPv6\"\n* Add IPv6 ICMP allow rule in WAN firewall rule\n* 如果想指定自架的 DNS (Adguard Home or Pi-Hole) 且想要應用到 IPv6:\n + Tick the \"Manual Router announcement management\"\n + Fill the DNS IPv4 settings in the \"Router announcement\"\n + Hinet IPv6 is Stateless (Stateless DHCPv6 + SLAAC)\n + Disable the DHCPv6 service in the LAN\n + 這樣做的邏輯是,IPv6 DNS 可以只向 IPv4 位址的 DNS 伺服器請求,還是會回傳 IPv6 的解析位址\n\n### 安全性設定 Security\n\n#### System\n\n* Disable the listen service including WebUI, ssh, Unbound on WAN surface\n* Install the CrowdSec, and enable Intrusion Detection\n + Disable hardware net acceleration related \"Interfaces\" > \"Settings\"\n* Configure the SSH Key, disable the password login\n\n#### Intrusion Detection (Suricata) (IPS/IDS)\n\n* Download rule sets based on service used\n* Rule set with using sites name (p2p, Facebook, Youtube) do not apply\n* ET Pro rule set need suscription\n\n#### Crowdesc\n\n* Connected to the cloud database to detect the attackers IPs and block\n* Collection for different scenarios (windows, nginx, ...)can only be added through shell command\n* The hub for adding the scenario rule [Hub |](https://hub.crowdsec.net)\n\n#### Firehol IP list subscription\n\n* [FireHOL Block List ( Botnets, Attacks, Malware....)](https://forum.opnsense.org/index.php?topic=17596.0)\n* Follow the guide to add alias of Firehol level 2\n* Add the Cron tab to update the Firewall alias\n\n#### VLAN Configuration (適用於建立訪客網路或者 IoT 專用網路)\n\n* Add VLAN, assign Tag, and make Proxmox VE vtnet aware vlan\n* Assign DHCP server\n* Add Firewall rule to make the VLAN network unable to access the LAN\n\n#### GeoIP and Ailases for Firewall Block (如果想擋特定區域國家的話)\n\n* Register the Maxmind GeoIP database\n* Follow the guide to add Firewall aliases\n* Configure to block the specific countries\n\n### Cron (安全性設定完成後,記得設定各列表的更新)\n\n* System and packages update\n* Suricata blocklist update\n* Firewall aliases updates (FireHol, GeoIP)\n\n### Others Packages\n\n* Netdata: 另外一種監控服務\n* Wake-On-LAN: 遠端喚醒機器用\n* UPNP: 有安全疑慮者慎用,給 LAN 內服務打洞用的\n* Tailscale [OPNsense安装配置Tailscale | 鐵血男兒的BLOG](https://pfschina.org/wp/?p=9163)\n* Wireguard [How to Set Up WireGuard in OPNsense in 2023 - WunderTech](