首页
导航
博客
电子书
算法
众创
代码
随贴
关于我们
您好,欢迎来到码863代码分享网! 请
[登录]
/
[注册]
搜 索
标题:
*
140
字
TAG标签:
(用空格隔开)
30
字
恢复历史版本:
请选择分类
html
python
javascript
php
sql
c
c++
c#
java
plain
所有人可见
仅自己可见
编辑器:UEditor
编辑器:TinyMCE
编辑器:Editor.md
HTML转MD
HTML转MD2
<p style="margin-top: 0px; margin-bottom: 1em; padding: 0px; border: none; list-style-type: none; outline: none; word-break: break-all; color: rgb(85, 85, 85); font-family: "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);">首先,清除所有预设置</p><pre style="background-color: rgb(239, 239, 239); padding: 10px; border-left: 5px solid rgb(204, 204, 204); border-radius: 5px; overflow: auto; overflow-wrap: break-word; white-space: pre-wrap; color: rgb(85, 85, 85);">iptables -F</pre><p style="margin-top: 0px; margin-bottom: 1em; padding: 0px; border: none; list-style-type: none; outline: none; word-break: break-all; color: rgb(85, 85, 85); font-family: "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);">其次,设置只允许指定ip地址访问指定端口</p><p style="margin-top: 0px; margin-bottom: 1em; padding: 0px; border: none; list-style-type: none; outline: none; word-break: break-all; color: rgb(85, 85, 85); font-family: "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);">1、在tcp协议中,禁止所有的ip访问本机的8080端口。</p><pre style="background-color: rgb(239, 239, 239); padding: 10px; border-left: 5px solid rgb(204, 204, 204); border-radius: 5px; overflow: auto; overflow-wrap: break-word; white-space: pre-wrap; color: rgb(85, 85, 85);">iptables -I INPUT -p tcp --dport 8080 -j DROP</pre><p style="margin-top: 0px; margin-bottom: 1em; padding: 0px; border: none; list-style-type: none; outline: none; word-break: break-all; color: rgb(85, 85, 85); font-family: "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);">2、允许192.168.1.123访问本机的1521端口</p><pre style="background-color: rgb(239, 239, 239); padding: 10px; border-left: 5px solid rgb(204, 204, 204); border-radius: 5px; overflow: auto; overflow-wrap: break-word; white-space: pre-wrap; color: rgb(85, 85, 85);">iptables -I INPUT -s 211.211.211.211 -p tcp --dport 8080 -j ACCEPT</pre><p style="margin-top: 0px; margin-bottom: 1em; padding: 0px; border: none; list-style-type: none; outline: none; word-break: break-all; color: rgb(85, 85, 85); font-family: "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);">最后,保存当前规则</p><pre style="background-color: rgb(239, 239, 239); padding: 10px; border-left: 5px solid rgb(204, 204, 204); border-radius: 5px; overflow: auto; overflow-wrap: break-word; white-space: pre-wrap; color: rgb(85, 85, 85);">/etc/rc.d/init.d/iptables save service iptables restart</pre><p style="margin-top: 0px; margin-bottom: 1em; padding: 0px; border: none; list-style-type: none; outline: none; word-break: break-all; color: rgb(85, 85, 85); font-family: "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);">添加后打开iptables后如图所示,</p><pre style="background-color: rgb(239, 239, 239); padding: 10px; border-left: 5px solid rgb(204, 204, 204); border-radius: 5px; overflow: auto; overflow-wrap: break-word; white-space: pre-wrap; color: rgb(85, 85, 85);">-A INPUT -s 192.168.1.123/32 -p tcp -m tcp --dport 1521 -j ACCEPT -A INPUT -p tcp -m tcp --dport 1521 -j DROP</pre><p style="margin-top: 0px; margin-bottom: 0px; padding: 0px; border: none; list-style-type: none; outline: none; word-break: break-all; color: rgb(85, 85, 85); font-family: "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);"><img src="/ueditor/php/upload/image/20200809/1596955438711518.jpg" alt="" style="margin: 0px; padding: 0px; border: none; list-style-type: none; outline: none; max-width: 100%;"/></p><p><br/></p>
CopyRight 2002~2023 精通2100网 联系邮箱:qqtxt@163.com
版权所有:精通2100网
湘ICP备2023018646号-1
MYSQl共执行 4 个查询,用时 0.0019731521606445 秒,PHP脚本用时 0.004114 秒,占用内存 0.523 MB,Gzip 已启用