2024年8月26日 星期一

RouterOS WireGuard

RouterOS 在 7 版以後支援 WireGuard
註: WireGuard 在 Linux Kernel 5.6 版開始內建

設定滿簡單的,在選單 WireGuard New Interface,Private Key 及 Public Key 不用填,會自動產生
在 IP / Addresses 綁一個 IP 給 wireguard1,例如 10.66.66.1/24
在 IP / Firewall / NAT 加上 srcnat 讓 wireguard1 區段 masquerade

在 Peer 加 Client,這邊就沒有自動產生功能,
要找一台有裝 wireguard-tools 的 Linux,用 wg 指令產生
wg genkey | tee privatekey # 產生 Private Key
wg pubkey < privatekey # 產生 Public Key
wg genpsk # 產生 Preshared Key

Client Address 填入 10.66.66.2 # 要在上面 wireguard1 網段內
Client DNS 填入 8.8.8.8
Client Endpoint 填入 RouterOS 的 Public IP
下面會自動產生 Client Config 及 Client QR 碼

但實測在 [Interface] 內 ListenPort 必需移除才會通,
掃 QR 碼後,需將 ListenPort (監聽連接埠) 設定移除,移除後欄位會呈現 (隨機)

ref. ROS WireGuard

2024年8月5日 星期一

Change Redhat Linux 9 /lib default size

Redhat Linux 9 (or Rocky Linux 9 or Alma Linux 9) 之前的 /lib,設跟 /dev/shm 相同,預設大小是記憶體一半,
在 9 之後,預設大小是記憶體的 20%,若要調整這個大小,可以在 /etc/fstab 加一行覆寫預設值
例如:
tmpfs /run tmpfs defaults,size=5G 0 0

systemd jounal 的預設存放位置就在這 /run/log/journal,
其預設最多使用所在 Partition 的 10%,若 Log 量多,希望保留多一多時間,
就需要調大 SystemMaxUse 及 RuntimeMaxUse 這兩個值

HiNet IDC mirror closed

http://mirror01.idc.hinet.net HiNet 這個網址關了,要高速下載 Linux ISO 少了一個地方,感謝 HiNet 默默服務了多年 測了幾個 TW mirror 站,推 TWDC 台灣數位串流,常見的 Linux 都有,速度超快 https://...