一、iptables
yum install iptables-services
1.iptables有几个表以及每个表有几个链
四表五链
filter,nat,mangle,raw
PREROUTING,INPUT,FORWARD,OUTPUT,POSTROUTING
2.iptables有几个表以及每个表对应链的作用,对应企业应用场景
fileter 默认主机防火墙,过滤输入输出主机的数据包
Input 处理输入数据包
Forword 处理流经本主机的数据包
Output 处理输出数据包
Nat 负责网络地址转换
Porward 处理转发数据包
Prerouting 用于目标地址转换
Postouting 用于源地址转换
3.请写出查看iptables当前所有规则的命令
[root@localhost ~]# iptables -L -n --line-numbers
4.禁止来自192.168.100.20 ip地址访问80端口的请求
[root@localhost ~]# iptables -A INPUT -p tcp -s 192.168.100.20 --dport 80 -j DROP
5.实现把访问192.168.100.20:80的请求转到192.168.100.30:80
[root@localhost ~]# iptables -t nat -A PREROUTING -d 192.168.100.20 -p tcp --dport 80 -j DNAT --to-destination 192.168.100.30