Linux关于snmp的防火墙设置

来源:互联网 发布:算法中log2是什么意思 编辑:程序博客网 时间:2024/05/16 00:29
</pre><p><span style="font-family: FangSong_GB2312; font-size: 14px;">(转载)</span><span style="font-family: Simsun;font-size:14px;"> </span></p><p><span style="font-family: FangSong_GB2312; font-size: 14px;">iptables 所在目录 /etc/sysconfig/iptables</span><span style="font-family: Simsun;font-size:14px;"> </span></p><p><span style="font-family: FangSong_GB2312; font-size: 14px;">service iptables status            查看iptables状态 </span></p><p><span style="font-family: FangSong_GB2312; font-size: 14px;">service iptables restart iptables  服务重启 </span></p><p><span style="font-family: FangSong_GB2312; font-size: 14px;">service iptables stop iptables     服务禁用</span></p><span style="font-family: Simsun;font-size:14px;"></span><h3 class="title pt10 pb10 pl5" style="font-family: Simsun; margin: 0px; padding-top: 10px; padding-bottom: 10px; padding-left: 5px; line-height: 36px; color: rgb(31, 155, 207); text-shadow: rgb(153, 153, 153) 1px -1px 1px; background: url(http://www.longhui.org/wp-content/themes/Qiumin/s/articleTit.png) repeat-y rgb(254, 254, 254);"><span style="font-family: FangSong_GB2312;">Linux服务器打开防火墙的SNMP端口(161)的方法</span></h3><span style="font-family: FangSong_GB2312; font-size: 14px;"><span style="color: rgb(51, 51, 51); line-height: 28px; background-color: rgb(254, 254, 254);">方法一 iptables -I INPUT -p UDP –dport 161 -j ACCEPT;</span><br style="color: rgb(51, 51, 51); line-height: 28px; background-color: rgb(254, 254, 254);" /><span style="color: rgb(51, 51, 51); line-height: 28px; background-color: rgb(254, 254, 254);">方法二 vi /etc/sysconfig/iptables</span><br style="color: rgb(51, 51, 51); line-height: 28px; background-color: rgb(254, 254, 254);" /><span style="color: rgb(51, 51, 51); line-height: 28px; background-color: rgb(254, 254, 254);">插入</span><br style="color: rgb(51, 51, 51); line-height: 28px; background-color: rgb(254, 254, 254);" /><span style="color: rgb(51, 51, 51); line-height: 28px; background-color: rgb(254, 254, 254);">-A -INPUT -p udp -m udp --dport 161 -j ACCEPT</span><br style="color: rgb(51, 51, 51); line-height: 28px; background-color: rgb(254, 254, 254);" /><span style="color: rgb(51, 51, 51); line-height: 28px; background-color: rgb(254, 254, 254);">保存 重启 service iptables restart</span></span><pre class="reply-text mb10" id="content-662957502" name="code" style="white-space: pre-wrap; word-wrap: break-word; color: rgb(51, 51, 51); line-height: 26px; background-color: rgb(255, 255, 255);">
0 0