redhat防火墙管理

systemctl status firewalld
systemctl stop firewalld
systemctl start firewalld
systemctl enable firewalld
systemctl disable firewalld

查看当前iptables规则
iptables –L –n

添加指定端口到防火墙中
iptables -I INPUT -p udp --dport 161 -j ACCEPT
iptables -I INPUT -p tcp --dport 8080 -j ACCEPT

查看规则序号
iptables -L -n --line-number
删除INPUT规则
iptables -D INPUT 编号

其他命令:
1.查看端口占用
lsof -i:端口号

2.修改ip
ifconfig enp2s0f0 10.0.96.85
ifconfig enp2s0f0 10.0.96.87

猜你喜欢

转载自www.cnblogs.com/cloudwind2011/p/9371787.html