1.iptables: 开启防火墙:可以正常使用ssh服务,dns
服务,httpd服务,chrony服务,nfs服务
开启防火墙
[root@hezhihao ~]# systemctl restart iptables
可以正常使用ssh服务
访问dns服务,httpd服务

查看[root@hezhihao named]# iptables -vnL

[root@hezhihao named]# iptables -I INPUT -p tcp --dport 80 -j ACCEPT

或者
[root@hezhihao ~]# iptables -A INPUT -p tcp --dport 80 -j ACCEPT
[root@hezhihao ~]# iptables -D INPUT 5

[root@hezhihao etc]# systemctl restart autofs
[root@hezhihao etc]# mount | grep /nfs
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw,relatime)
/etc/auto.nfs on /nfsclient type autofs (rw,relatime,fd=5,pgrp=25384,timeout=300,minproto=5,maxproto=5,indirect,pipe_ino=355526)
2.firewalld: 开启防火墙:可以正常使用ssh服务,
dns服务,httpd服务,chrony服务,nfs服务
且实现:访问第一台机器web服务的9090端口,转发到
第二台机器的80端口(永久生效)
开启防火墙服务:
[root@hezhihao etc]# systemctl restart firewalld
[root@hezhihao etc]# firewall-cmd --add-port=80/tcp
success
[root@hezhihao conf.d]# firewall-cmd --add-forward-port=9090:proto=tcp:toport=80:toaddr=192.168.248.129 --permanent
[root@hezhihao 9090]# firewall-cmd --add-port=9090/tcp
success