Linux - iptables
Overview
- Linux 非常好用的防火墙
Prepare
# Install
yum install -y iptables # 安装iptables
yum install iptables-services # 安装iptables-services
yum update iptables # 升级iptables
# Check status
service iptables status # CentOS6
systemctl status iptables # CentOS7
# Auto start
chkconfig iptables on # CentOS6
systemctl enable iptables.service # CentOS7
基本使用
# 开放指定端口
iptables -A INPUT -p tcp --dport 4022 -j ACCEPT
iptables -A INPUT -p tcp --dport 8080 -j ACCEPT
iptables -A INPUT -p tcp --dport 8087 -j ACCEPT
本文来自博客园,作者:duchaoqun,转载请注明原文链接:https://www.cnblogs.com/duchaoqun/p/12658480.html