EricChangOwO
  • NEW!
    NEW!  Connect Ideas Across Notes
    Save time and share insights. With Paragraph Citation, you can quote others’ work with source info built in. If someone cites your note, you’ll see a card showing where it’s used—bringing notes closer together.
    Got it
      • Create new note
      • Create a note from template
        • Sharing URL Link copied
        • /edit
        • View mode
          • Edit mode
          • View mode
          • Book mode
          • Slide mode
          Edit mode View mode Book mode Slide mode
        • Customize slides
        • Note Permission
        • Read
          • Only me
          • Signed-in users
          • Everyone
          Only me Signed-in users Everyone
        • Write
          • Only me
          • Signed-in users
          • Everyone
          Only me Signed-in users Everyone
        • Engagement control Commenting, Suggest edit, Emoji Reply
      • Invite by email
        Invitee

        This note has no invitees

      • Publish Note

        Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

        Your note will be visible on your profile and discoverable by anyone.
        Your note is now live.
        This note is visible on your profile and discoverable online.
        Everyone on the web can find and read all notes of this public team.

        Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

        Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

        Explore these features while you wait
        Complete general settings
        Bookmark and like published notes
        Write a few more notes
        Complete general settings
        Write a few more notes
        See published notes
        Unpublish note
        Please check the box to agree to the Community Guidelines.
        View profile
      • Commenting
        Permission
        Disabled Forbidden Owners Signed-in users Everyone
      • Enable
      • Permission
        • Forbidden
        • Owners
        • Signed-in users
        • Everyone
      • Suggest edit
        Permission
        Disabled Forbidden Owners Signed-in users Everyone
      • Enable
      • Permission
        • Forbidden
        • Owners
        • Signed-in users
      • Emoji Reply
      • Enable
      • Versions and GitHub Sync
      • Note settings
      • Note Insights New
      • Engagement control
      • Make a copy
      • Transfer ownership
      • Delete this note
      • Save as template
      • Insert from template
      • Import from
        • Dropbox
        • Google Drive
        • Gist
        • Clipboard
      • Export to
        • Dropbox
        • Google Drive
        • Gist
      • Download
        • Markdown
        • HTML
        • Raw HTML
    Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
    Create Create new note Create a note from template
    Menu
    Options
    Engagement control Make a copy Transfer ownership Delete this note
    Import from
    Dropbox Google Drive Gist Clipboard
    Export to
    Dropbox Google Drive Gist
    Download
    Markdown HTML Raw HTML
    Back
    Sharing URL Link copied
    /edit
    View mode
    • Edit mode
    • View mode
    • Book mode
    • Slide mode
    Edit mode View mode Book mode Slide mode
    Customize slides
    Note Permission
    Read
    Only me
    • Only me
    • Signed-in users
    • Everyone
    Only me Signed-in users Everyone
    Write
    Only me
    • Only me
    • Signed-in users
    • Everyone
    Only me Signed-in users Everyone
    Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # 資訊安全 - FortiGate 50E 防火牆設定 在每個大型的共用場所,每個人用者公用網路,但很少人會去想到說公用網路的規則,像是學校與大型企業是怎麽管理內部網路的規則及安全性,要怎麼樣才能不讓公司的設備不受攻擊,這時候就是防火牆在做事的時候了! ## 動機 在某一天,我無聊滑蝦皮的時候,突然看到了 FortiGate 50E 竟然不用千元就可以買到,於是上網研究了一下與防火牆有關的資訊,正好我在之前就有玩過軟體的防火牆,那時候還在玩 HomeLab AIO (一體機用虛擬化的那種),就開了一台 VM 去把 pfSense 裝上去,從那個時候就有體會到 IPS/IDS 的威力了,身為把 NAS 開在公網上的我肯定更需要防火牆,所以後來就把它帶回家玩了 ## 介紹 FortiGate 50E 是一台有功能 IPS/IDS 的防火牆,但這種東西通常是企業在使用的,而且企業通常都是有專門的業務來處理硬體方面,包括緊急故障汰換授權及管理系統維護等等,所以通常能買到那麼便宜的,不是授權快到期就是已到期 ### 那沒有授權會影響到什麼 沒授權的話登入後在授權那邊就可以看到說有幾個功能已失效,但主要也就這四個,所以授權費一年好幾萬塊真的是不意外 - 韌體與更新(授權失效後如果有檔案仍可手動更新) - 網頁過濾(授權過期後即無法使用,需要 FortiCloud 資料庫連線) - 病毒資訊 - 病毒突發資料庫 ![image alt](https://i.imgur.com/ifWd2Pa.png) 但是呢,沒有了授權,`SSL VPN` 以及防火牆規則依然都還可以使用,所以花個幾百塊搞個一台授權只剩一年的也蠻值的 ## 所有功能 基本上大部分的功能都可以在圖形化介面上面能找到,像是防火牆要開多深,VPN 要不要開之類的,功能選擇介面選單如下 ![image alt](https://i.imgur.com/QG0chIS.png) ### 那其他功能呢? 我在使用時遇到了 WAN 的 MAC Address 要改才能拿到電信商給我的實體 IP 的問題,所以這時候就需要 CLI 來加持,其實像是很多功能沒在選單上的,都還是可以透過 CLI 在做開啟,這裡舉例我用到的幾個來做示範 #### 1. WAN 自訂 MAC Address ``` # config sys int # edit <interface> //這裡是 wan 介面 ex: wan1,wan2,wwan # set macaddr <MAC address> //要修改的 Mac Address # end ``` #### 2. IPv6 這裡是讓 WAN 介面啟用 IPv6 的指令 ``` # config sys int # edit <interface> //wan 介面,跟上面一樣 # config ipv6 # set ip6-mode pppoe # set dhcp6-prefix-delegation enable # set autoconf ena # end # next # end ``` 接下來是 LAN ``` # config sys int # edit <interface> //lan 介面 # config ipv6 # set ip6-mode delegated # set ip6-send-adv enable # set ip6-manage-flag dis # set ip6-other ena # set ip6-upstream-interface "<interface>" //wan 介面 # set ip6-subnet ::1/64 # config ip6-delegated-prefix-list # edit 1 # set upstream-interface "<interface>" //wan 介面 # set autonomous-flag enable # set onlink-flag enable # set subnet ::/64 # next # end # end # next # end ``` DHCP Server ``` # config sys dhcp6 server # edit 1 # set interface <interface> //lan 介面 # set upstream-int <interface> //wan 介面 # set ip-mode delegated # set dns-service def # next # end ``` 接下來 DNS 就可以用 GUI 設定了,終於不用動 CLI 了... #### 3. USB tethering (手機 USB 網路共用) 手機網路共用就是一般 Android 插 USB 開網路共享機器就能抓到,剩下的啟用就好了 ``` # config system lte-modem # show # set status enable # end ``` 這時候你就會看到你的網路介面多一個 wwan 介面 ![image alt](https://i.imgur.com/tIqsiGC.png) 然後去規則設定轉發就可以使用手機網路了! :::info :bulb: **提示:** 在我之前家裡斷網急須使用網路的時候,我發現因為 Pixel 手機支援度的關係,無法在許多路由器上使用 USB 網路共用,這情況我一共測試了其他五隻 Android 手機,皆未發生這些問題,所以可判定是 Pixel 手機支援度的問題(經測試連 RouterOS 也無法抓到,只有 OpenWrt 可以使用) ::: ## Forti SSL VPN 使用教學 先到進階設定開關把 VPN 打開,如下圖 ![](https://hackmd.io/_uploads/HJQF9eEMa.png) 然後接下來到 SSL VPN 設定裡面設定端口,像我自己就是設定 720 ![](https://hackmd.io/_uploads/Hy46cl4MT.png) 然後來到這裡把 tunnel-access 打開 ![](https://hackmd.io/_uploads/HJgqogNza.png) 最後只要新增 IP 轉發規則與新增使用者 ![](https://i.imgur.com/vz8saNi.png) 接下來在你要用 VPN 的裝置下載 FortClient VPN 並且設定端口與就可以使用了! ## 可以順便做 AP 管理 (控制器) 如果你有 FortiGate 的 AP 的話,可以順便在 50E 裡面做接管 ![](https://hackmd.io/_uploads/Hkz1te4zp.png) SSID 設定介面 ![](https://hackmd.io/_uploads/H1rNYgNGp.png) ## PPPoE 問題 由於 FortiGate 沒有 ASIC 硬撥電路,所以在使用 PPPoE 撥號效能並沒有很理想,所以建議加一台 EdgeRouter X 或者其他路由器在前面讓他做撥號效能會比較好 就像上面所講的,在我中華光世代 500/500 PPPoE 撥號加上防火牆全開的情況下跑 Speedtest 時,FortiGate 50E 的 CPU 會在大概 70% 左右,所以還是評估一下,要是家裡是那種第四台網路(WAN 走 DHCP 的)那就沒這個問題 **以下圖片是 FortiGate 50E 防火牆只開 NGFW 的使用率** ![](https://hackmd.io/_uploads/BJaVfgEfT.png)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password
    or
    Sign in via Google Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully