-
通过路由转发配置网络型防火墙
主机名 | 网卡、IP地址、网关设置 |
---|---|
host10 | ens32:192.168.1.10,网关指向防火墙外网IP:192.168.1.100 |
iptables | ens32内网IP:192.168.0.40,ens34外网IP:192.168.1.100 |
web-11 | ens32:192.168.0.11,网关指向防火墙内网IP:192.168.0.40 |
-
防火墙主机添加网卡并设置IP,IP设置为:192.168.0.100/24
nmtui 修改网卡IP地址(交互) #开启路由转发功能 [root@iptables ~]# echo 'net.ipv4.ip_forward=1' >> /etc/sysctl.conf [root@iptabels ~]# sysctl -p //加载配置立即生效 net.ipv4.ip_forward = 1 #查看路由转发 [root@iptables ~]# cat /proc/sys/net/ipv4/ip_forward 1
-
第二台服务器提供网站服务:web26将网关指向192.168.0.11
#安装httpd服务 [root@web26 ~]# yum -y install httpd #修改默认首页 [root@web26 ~]# echo web26 > /var/www/html/index.html [root@web26 ~]# systemctl start ht