iptables防火墙添加规则

1:放开mysql 3306端口方法:
iptables -I INPUT 1 -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT

2:未添加过规则的iptables文件在/etc/sysconfig 目录下找不到

The /etc/sysconfig/iptables-config file stores information used by the kernel to set up packet filtering services at boot time or whenever the service is started.

Do not modify this file by hand unless you are familiar with constructing iptables rules. The easiest way to add rules is to use the Security Level Configuration Tool (system-config-securitylevel) application to create a firewall. These applications automatically edit this file at the end of the process.

Rules can also be created manually using the /sbin/iptables command. Once created, add the rule(s) to the/etc/sysconfig/iptables file by typing the following command:

/sbin/service iptables save

Once this file exists, any firewall rules saved in it persists through a system reboot or a service restart.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值