iptables如何添加容许某个端口的访问
生活随笔
收集整理的這篇文章主要介紹了
iptables如何添加容许某个端口的访问
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
2019獨角獸企業重金招聘Python工程師標準>>>
客戶端遠程鏈接mysql的時候遇到 這個問題
Can't?connect?to?MySQL?server?on?'IP'?(10060)目測是linux防火墻的原因。
現在需要
配置iptables,使他容許3306的訪問(直接在命令行界面執行下面語句):
iptables -I INPUT -p tcp --dport 3306 -j ACCEPT;??//訪問本機的3306的端口的數據包都允許(進口)
iptables-save;??//保存該腳本
service iptables save;???//保證重啟后腳本還能生效
iptables -I OUTPUT -p tcp --sport 3306 -j ACCEPT;??//把3306改為源端口(出口)
iptables-save;
service iptables save;
service?iptables?restart或者 ?systemctl restart ?iptables.service ?來重啟服務
轉載于:https://my.oschina.net/wojibuzhu/blog/321100
總結
以上是生活随笔為你收集整理的iptables如何添加容许某个端口的访问的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Delphi 与 DirectX 之 D
- 下一篇: 【Cocos2d-x】源代码分析之 2d