3G work with office network

Share

phillips@phillips-ThinkPad-T420:~$ cat bin/3Gwifi_net_office.sh 
#!/bin/sh
# For dropbox sync ~/Dropbox 
# This script help update routing table for forward main traffic to wifi -> 3G 
# and keep office network connection via eth0
wlanip=`ip -4 addr show wlan0  | grep inet| awk  '{print $2}' | awk -F \/  '{print $1}'`
newgw=`echo $wlanip | awk '{split($0,array,".")} END{print array[1]”.”array[2]”.”array[3]"."1}'`
case $1 in 
    start)
        route add default gw $newgw
        route add -net 172.22.20.0 netmask 255.255.254.0 gw 172.22.2.1
        route add -net 172.22.12.0 netmask 255.255.254.0 gw 172.22.2.1
        route add -net 172.22.4.0 netmask 255.255.254.0 gw 172.22.2.1
        route add -net 172.22.16.0 netmask 255.255.254.0 gw 172.22.2.1
        ;;
    stop)
        route del default gw $newgw
        route del -net 172.22.20.0 netmask 255.255.254.0 
        route del -net 172.22.12.0 netmask 255.255.254.0
        route del -net 172.22.4.0 netmask 255.255.254.0
        route del -net 172.22.16.0 netmask 255.255.254.0
        route add default gw 172.22.2.1
        ;;
esac
 

Read more

How to migrate Raspberry Pi 5 OS from micro SD to NVME m.2 SSD

首先我買了Raspberry Pi CM5後來買了Raspberry Pi CM5 I/O board來當個人電腦使用,系統是安裝在256GB SD卡上運行的很好。用久了在開啟較肥的程式像Web Browser或LiberOffice會有慢半拍的反應,而有了升級NVME m.2 SSD念頭。 因為Raspberry Pi 5支援的最快PCIe gen3 x 4就不去考慮快的Gen4 or Gen5 m.2 SSD。找了ADATA出的 LEGEND 710入門級的產品,會利用HMB(Host Memory Buffer)來加速I/O速度,因為是Raspberry Pi OS kernel會認不得而無法正常使用 事先在SD卡的/boot/firmware/cmdline.txt 加入 kernel command line參數如下,然後重開機m.

By Phillips Hsieh

How to document Home Lab and Network

運維機房和跨域的網路,會遇到各式需求與問題,用對工具才能分析問題,個人覺得最重要的是使用能處理問題的工具。 推薦目前想學和正在使用的平台與軟體,協助將公司/家用機房文件化 佈告欄任務管理 Notion 白板可管理任務指派 網路架構文件編寫 netbox 精細管理網路設備與連接線路 IP 資源管理 phpipam 7.x 專注網路IP分配 邏輯塊文件編寫 draw.io 視覺化概念圖 機房設備管理 ITDB 管理設備生命週期與使用者

By Phillips Hsieh
ссс