当前位置:网站首页>阿里云防火墙配置,多种设置方式(iptables和fireward)
阿里云防火墙配置,多种设置方式(iptables和fireward)
2022-06-29 09:14:00 【清风~】
阿里云centos7.6自带防火墙就是fireward,我自己又配置了iptables,我刚开始没有弄懂,以为两个是不一样的,导致总是两个都打不开,要是单纯的开fireward也是可以的,但是我更喜欢iptables配置文件来查看相关配置
ftp服务器网页打不开的问题探究,通过反复运行,找到自己问题所在
vim /etc/sysconfig/iptables
都要开
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
#ssh port
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
#vsftpd
-A INPUT -p TCP --dport 61001:62000 -j ACCEPT
-A OUTPUT -p TCP --sport 61001:62000 -j ACCEPT
-A INPUT -p TCP --dport 20 -j ACCEPT
-A OUTPUT -p TCP --sport 20 -j ACCEPT
-A INPUT -p TCP --dport 21 -j ACCEPT
-A OUTPUT -p TCP --sport 21 -j ACCEPT
#mysql port
-A INPUT -p tcp -m tcp --dport 3306 -j ACCEPT
#tomcat remote debug port
-A INPUT -p tcp -m tcp --dport 5005 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 8080 -j ACCEPT
#nginx
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT

systemctl restart iptables.service
systemctl enable iptables.service
注意下面为错误示范,当时没有理解!
防火墙设置
这里iptables设置就是防火墙参数,没有必要再添加firewall参数了,反而打不开
同时我也添加一些参数,确实打不开,终于搞清不能两个同时配置
下面参数不用加
systemctl restart firewalld.service
firewall-cmd --permanent --list-port
firewall-cmd --zone=public --add-port=22/tcp--permanent
firewall-cmd --zone=public--add-port=21/tcp --permanent
systemctl restart firewalld
firewall-cmd --permanent --list-port
下面是以前打开的端口,我测试了下,果然不能同时测试,打不开的网页就不发了
那么下面就直接运行已有的iptables配置就行
简称,鱼和熊掌不可兼得
systemctl restart iptables.service
systemctl enable iptables.service
systemctl restart vsftpd.service
打开网页输入你账户,密码登录即可

边栏推荐
- ORA-01950 对表空间无权限
- Official STM32 chip package download address stm32f10x stm32f40x Download
- leetcode MYSQL数据库题目180
- The 23 most useful elasticsearch search techniques you must know
- Please use the learned knowledge to write a program to find out the password hidden in the long string below. The burial point of the password conforms to the following rules:
- leetcode MYSQL数据库题目176
- Deep Learning-based Automated Delineation of Head and Neck Malignant Lesions from PET Images
- Matlab tips (21) matrix analysis -- partial least squares regression
- Basic operations of MAC MySQL database
- 容器
猜你喜欢

In the era of data processing, data quality construction is the way for enterprises to survive

装饰器模式的应用,包装ServletRequest,增加addParameter方法

Fully Automated Gross Tumor Volume Delineation From PET in Head and Neck Cancer Using Deep Learning

Easyexcl export 1million lines of EXECL report font error solution

Automatic 3D Detection and Segmentation of Head and Neck Cancer from MRI Data.

How to set Google Chrome as the default browser

数据治理:数据标准管理(第三篇)

Making of simple addition calculator based on pyqt5 and QT Designer

Visual assist plug-in settings for UE4 vs

Generic paging framework
随机推荐
动态规划总结
Es error nonodeavailableexception[none of the configured nodes are available:[.127.0.0.1}{127.0.0.1:9300]
Hystrix熔断器:服务熔断与服务降级
KDevelop new project
In the future of Business Intelligence BI, how do you view the ai+bi model?
Closed door cultivation (24) shallow understanding of cross domain problems
请用已学过的知识编写程序,找出小甲鱼藏在下边这个长字符串中的密码,密码的埋藏点符合以下规律:
我想知道如何免费网上注册股票开户?另外,手机开户安全么?
Please use the learned knowledge to write a program to find out the password hidden in the long string below. The burial point of the password conforms to the following rules:
数据源连接池未关闭的问题 Could not open JDBC Connection for transaction
Zabbix4.4 configure the indicators of the monitoring server and solve the garbled graphics pages
After installing anaconda, you need to enter a password to start jupyterlab
A 2.5D Cancer Segmentation for MRI Images Based on U-Net
Data governance: Metadata Management (Part 2)
Wechat applet implements the data listener watch, including the watch that destroys the watch and sub attributes
leetcode MYSQL数据库题目178
Application of decorator mode, packaging ServletRequest and adding addparameter method
kdevelop新建工程
Construction and use of Changan chain go language smart contract environment
The 23 most useful elasticsearch search techniques you must know