admin管理员组

文章数量:1642347

两台虚拟机,desktop双网卡,配置ip分别为172.25.254.113和1.1.1.113

打开另一台虚拟机server,配置ip为1.1.1.213

在双网卡的desktop下载httpd,在默认发布目录编写默认发布文件


systemctl start httpd

1.用真机通过http访问172.25.254.113

firewall-cmd --list-all     查看火墙状态


访问不到,因为desktop的虚拟机火墙是public,不允许http访问

firewall-cmd --add-source=172.25.254.13 --zone=trusted

把主机的ip这个源添加到trusted域里,

在主机测试,通过http可以访问

2.用server通过http访问1.1.1.113


可以ping通,但是不能访问,因为火墙的默认域为public,http不能通过访问

firewall-cmd --remove-interface=eth1 --zone=public	把eth1接口从public域摘下来
firewall-cmd --add-interface=eth1 --zone=trusted	把eth1接口添加到trusted域
firewall-cmd --list-all --zone=truste

本文标签: 进阶详解Firewall