2022-11-27|閱讀時間 ‧ 約 3 分鐘

Linux FAQ : iptables 介紹

防火牆設定 iptables
iptables
可以設定主機 ip 白名單與黑名單
限制來源提升安全性
port 也可以做設定

查看 : iptables -L

規則 先後順序 : 先設定有優先級

範例 : 先開通 10.40.40.20 port 80 , 在封鎖 10.40.40.20 網段
10.40.40.20 port 80 還是可以通
先封鎖 10.40.40.20 網段 , 在開通 port 80
10.40.40.20 port 80 被擋住

設定 :

開啟 22 port :
iptables -A INPUT -i ens192 -p tcp -s 10.40.53.191 --dport 22 -j ACCEPT
開通
測試可以直接輸入指令 不用重啟防火牆

process 沒有 pid

參考 :
netstat -antlp | grep 45136
ss -apn|grep :111
netstat --program --numeric-hosts --numeric-ports --extend
find -inum 152555007
分享至
成為作者繼續創作的動力吧!
Linux 相關 指令 與 情境 分享
從 Google News 追蹤更多 vocus 的最新精選內容從 Google News 追蹤更多 vocus 的最新精選內容

發表回應

成為會員 後即可發表留言