NFS settings are complex. Especially in the firewall and port problems, we need to pay more attention. Today, we will explain how to set ports for the NFS service. First, let's take a look at the problem in the workshop, and then find a solution.
Problem description
When debugging the MMS interface machine LINUX, You need to mount a directory on the AIX server to the MMS interface machine. There is a firewall between the MMS interface machine and the AIX server. In this case, you need to open the firewall port. Since each time AIX restarts the NFS service, the mountd port will change and you need to specify the port.
Solution
First, check which ports are occupied when the NFS service is started on AIX and perform the following operations:
- #rpcinfo -p
- program vers proto port service
- 100000 4 udp 111 portmapper
- 100000 3 udp 111 portmapper
- 100000 2 udp 111 portmapper
- 100000 4 tcp 111 portmapper
- 100000 3 tcp 111 portmapper
- 100000 2 tcp 111 portmapper
- 100083 1 tcp 32769 ttdbserver
- 100068 2 udp 32769 cmsd
- 100068 3 udp 32769 cmsd
- 100068 4 udp 32769 cmsd
- 100068 5 udp 32769 cmsd
- 200012 2 udp 970
- 200012 3 udp 971
- 100003 2 udp 2049 nfs
- 100003 3 udp 2049 nfs
- 100003 2 tcp 2049 nfs
- 100003 3 tcp 2049 nfs
- 100003 4 tcp 2049 nfs
- 200006 1 udp 2049
- 200006 4 udp 2049
- 200006 1 tcp 2049
- 200006 4 tcp 2049
- 100005 1 tcp 32783 mountd
- 100005 2 tcp 32783 mountd
- 100005 3 tcp 32783 mountd
- 100005 1 udp 32786 mountd
- 100005 2 udp 32786 mountd
- 100005 3 udp 32786 mountd
- 400005 1 udp 32787
- 100024 1 tcp 32784 status
- 100024 1 udp 32788 status
- 100133 1 tcp 32784
- 100133 1 udp 32788
- 200001 1 tcp 32784
- 200001 1 udp 32788
- 200001 2 tcp 32784
- 200001 2 udp 32788
- 100021 1 udp 32813 nlockmgr
- 100021 2 udp 32813 nlockmgr
- 100021 3 udp 32813 nlockmgr
- 100021 4 udp 32813 nlockmgr
- 100021 1 tcp 32785 nlockmgr
- 100021 2 tcp 32785 nlockmgr
- 100021 3 tcp 32785 nlockmgr
- 100021 4 tcp 32785 nlockmgr
From the above, we can see that the ports 111 and 2049 used by the NFS service are fixed, but mountd often changes. You can specify mountd as a fixed port, so that after NFS is started every time, all the ports used are fixed ports.
Operation Method:
Run the following command on the NFS server:
- # Cp/etc/services. bak
- # Find the following line in vi/etc/services:
- #1001-1009 # Unassigned
Before this line, enter mountd 1001/tcp mountd 1001/udp
- # Rmnfs-N stop the NFS service
- # Nfso-po nfs_use_reserved_ports = 1
- # Mknfs-N start the NFS service
In this way, port 1001 is fixed as the NFS mountd port.
Then open TCP and UDP ports 111, 2049, and 1001 on the firewall. The NFS output directory on the AIX server can be mounted successfully by testing the mount on the MMS interface machine.