1. 重启后生效的

开启: chkconfig iptables on
关闭: chkconfig iptables off

2. 及时生效

开启: service iptables start
关闭: service iptables stop

3. 如果是开启防火墙后,针对某个端口可以添加访问操作

修改/etc/sysconfig/iptables文件,添加如下内容:
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT 
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
#设置ntp服务器的udp端口访问,可以同步系统时间
-A INPUT -p udp --dport 123 -j ACCEPT

经常使用端口列表:

linux防火墙开关以及端口规则添加

 

使用ntp同步系统时间的命令:

linux防火墙开关以及端口规则添加

 

4. 其他的linux服务都可以采用以下方式开启和关闭

service xxxxxx start
service xxxxxx stop

 

相关文章:

  • 2022-12-23
  • 2022-02-09
  • 2021-12-02
  • 2021-09-17
  • 2021-12-06
  • 2021-12-27
  • 2022-12-23
  • 2021-08-27
猜你喜欢
  • 2021-12-09
  • 2021-12-04
  • 2022-02-07
  • 2021-09-23
  • 2022-02-09
  • 2022-12-23
  • 2021-07-25
相关资源
相似解决方案