# iptables - 不是服務,只是一個功能,存在記憶體執行,並無儲存攻擊 - 為了解決持久化問題,必須安裝iptables-persistent ## ref https://www.thomas-krenn.com/en/wiki/Saving_Iptables_Firewall_Rules_Permanently ## 流程 1. 安裝iptables-persistent 2. 打開/etc/iptables/rules.v4直接編輯 3. 載入規則 ## iptables-persistent - 透過iptables-save把資訊導到設定檔案 ```bash= sudo apt install iptables-persistent sudo iptables-save > /etc/iptables/rules.v4 sudo ip6tables-save > /etc/iptables/rules.v6 ``` ## 永久保存規則 - 直接使用command line輸入規則後保存才要使用 ``` netfilter-persistent save < /etc/iptables/rules.v4 ``` ## 載入規則 ``` iptables-restore < /etc/iptables/rules.v4 ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up