vi nfs.sh
#!/bin/bash
yum -y install nfs-utils rpcbind
chkconfig --level 35 nfs on
chkconfig --level 35 rpcbind on
echo "<html><body><h1>web1</h1></body></html>" > /opt/web1
echo "<html><body><h1>web2</h1></body></html>" > /opt/web2
echo "/opt/web1 192.168.73.30(ro)" > /etc/exports
systemctl stop firewalld
setenforce 0
systemctl start nfs
systemctl start rpcbind
netstat -anpt | grep nfs
netstat -anpt | grep 111
showmount -e
chmod +x nfs.sh
./nfs.sh