2019年9月3日 星期二

OpenVPN on OpenWRT

Objective

Routing packet between LAN zones of both side.

Topology

Server Side

  • Public IP with PPPoE

  • Domain name lookup with DDNS 

Client Side

  • DHCP via Wi-Fi Hot-Spot with LTE cell-phone

  • There is no public IP for Wi-Fi Spot ( the LTE back-end is a NAT network)


Installed Packages

Server Side

  • collectd-mod-openvpn - 5.8.1-1
  • luci-app-openvpn - git-19.167.54309-1d599a7-1
  • openvpn-easy-rsa - 3.0.4-1
  • openvpn-mbedtls - 2.4.5-4.2
  • openvpn-openssl - 2.4.5-4.2

Client Side

  • collectd-mod-openvpn - 5.8.1-1
  • luci-app-openvpn - git-19.156.63894-115c4e3-1
  • luci-i18n-openvpn-en - git-19.167.54309-1d599a7-1
  • openvpn-easy-rsa - 3.0.4-1
  • openvpn-mbedtls - 2.4.5-4.2

Configuration

Firewall - accept forward


Server Side


  • TLS key direction pair
  • Use CCD file for configuring OpenVPN's internal routing table

Server Side CCD (clinet config dir)


Client Side


Troubleshooting

  • How to read the log file

    • cat /tmp/openvpn.log
    • logread

  • MULTI: bad source address from client [192.168.43.199], packet dropped
    • Refer to
    • These errors occur because OpenVPN doesn't have an internal route for 192.168.43.199
    • Use client-config-dir and create a ccd file for your client containing the iroute option to tell OpenVPN that the 192.168.100.0/24 network is available behind this client.

  • How to know the client's name
    • Check openvpn log















Reference

  • https://openwrt.org/docs/guide-user/network/routing_in_openvpn
  • https://forum.openwrt.org/t/access-to-an-openvpn-client-on-my-lan/40687/3
  • https://blog.cavebeat.org/2018/03/openvpn-routed-client-config-for-openwrt/

2019年8月22日 星期四

LetsEncrypt on OpenWRT



  • 安裝 ACME



  • 調整 uhttpd 參數

    • DNS 要能查到這台 OpenWRT
    • rfc1918_filter 可以設定為  0,  以允許 NAT 內部連接 uhttpd 的外部 IP
    • 指定 憑證檔案要放的位置


  • 設定 ACME 參數


  • 啟動 ACME

    • 先停止原本的 uhttpd 服務 ( /etc/init.d/uhttpd stop )
    • ACME 會自行啟動 uhttpd 進行驗證
    • 一切順利的話,可以從 logread 看到 ACME 產出的憑證

  • 重新啟動 uhttpd

2019年7月16日 星期二

家用瓦斯管線維護


  • 緣由


    • 家裡的瓦斯管線已經有劣化的現象
    • 調整器沒有防爆功能(被換瓦斯的提醒要換)
    所以就開始來詢啦...

  • 調整器



      • (出口)壓力 R (mm H2O)

        • R280(一般家用)
        • R500(快速爐、大火快炒 營業用爐)

      • 流量 Q (kg/hour)

        • Q1(單口爐)
        • Q2(雙口爐)

        • Q3(熱水器)

      • 防爆

        • 流量超過 1.5 倍時,自動切斷

      • 附錶

        • 可觀察瓦斯鋼瓶內之壓力、可視為瓦斯殘量之參考值



    • 管線

      • CNS9620


      • CNS9621

        • 只能使用在 LPG
        • 分接、或延長用,不能直接接爐具


    • 備註

      • 本頁面僅為個人搜集資訊之整理,僅供參考
      • 瓦斯器具之安裝與咨詢,請洽合格之專業人員
      • 參考來源
        • http://www.liou-tai.net/index.php?route=pavblog/blog&id=358
        • http://www.tgas.org.tw/mem01/product.asp
        • https://www.trplus.com.tw/p/016019292
        • http://www.ton-lin.net/products_view.asp?ID=303