当前位置:网站首页>Alibaba cloud firewall configuration, multiple settings (iptables and firewall)
Alibaba cloud firewall configuration, multiple settings (iptables and firewall)
2022-06-29 10:06:00 【Qingfeng ~】
Alibaba cloud centos7.6 Bring your own firewall fireward, I configured it myself iptables, I didn't understand it at first , I think the two are different , As a result, both cannot be opened , If you simply open fireward It's OK, too , But I prefer iptables Configuration file to view the relevant configuration
ftp Research on the problem that the server web page cannot be opened , By running repeatedly , Find your problem
vim /etc/sysconfig/iptables
All have to be opened.
# 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
Note that the following is an example of an error , I didn't understand !
Firewall settings
here iptables Settings are firewall parameters , There is no need to add firewall Parameters , Instead, it won't open 
I also add some parameters , Really can't open , Finally, it is clear that two cannot be configured at the same time
The following parameters need not be added
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
The following is the previously opened port , I tested it , Sure enough, it can't be tested at the same time , If you can't open a web page, you won't send it 
Now let's run the existing iptables Just configure it
abbreviation , You can't have both fish and bear paws
systemctl restart iptables.service
systemctl enable iptables.service
systemctl restart vsftpd.service
Open the web page and enter your account , Just log in with password

边栏推荐
- 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:
- Custom MVC framework implementation
- 数据源连接池未关闭的问题 Could not open JDBC Connection for transaction
- Leetcode MySQL database topic 177
- JVM之方法返回地址
- 弧形 View 和弧形 ViewPager
- RecyclerView 通用适配器封装
- Flutter 基础组件之 Container
- 容器
- 装饰器模式的应用,包装ServletRequest,增加addParameter方法
猜你喜欢

Codeforces Round #659 (Div. 2)

Gross Tumor Volume Segmentation for Head and Neck Cancer Radiotherapy using Deep Dense Multi-modalit

Student addition / deletion gaih

Automatic Multi-Organ SegmVentation on Abdominal CT With Dense V-Networks

Pipeline details of IPC (interprocess communication)

Hystrix熔断器:服务熔断与服务降级

Generic paging framework

Install and configure redis in the Linux environment, and set the boot auto start

Memory layout of JVM objects

RecyclerView 通用适配器封装
随机推荐
券商经理给的开户二维码办理股票开户安全吗?我想开个户
Install and configure redis in the Linux environment, and set the boot auto start
Flutter 基础组件之 ListView
Codeforces Round #652 (Div. 2)
Gross Tumor Volume Segmentation for Head and Neck Cancer Radiotherapy using Deep Dense Multi-modalit
PHP内存马技术研究与查杀方法总结
FreeRTOS(九)——队列
Sublime Text3 set to run your own makefile
linux环境下安装配置redis,并设置开机自启动
JVM四种调用方法的指令
LiferayPortal JSONWS反序列化漏洞(CVE-2020-7961)分析
我想要股票开户优惠,怎么得到?还有,在线开户安全么?
acwing271【杨老师的照相排列】【线性DP】
2019.11.20训练总结
Zabbix4.4 configure the indicators of the monitoring server and solve the garbled graphics pages
A method of creating easy to manage and maintain thread by C language
力扣85题最大矩形
Caused by: org. apache. xerces. impl. io. MalformedByteSequenceException: Invalid byte 3 of 3-byte UTF-8
动态规划总结
gSoap例子——calc