
13
You can verify what ports RPC (e.g. NFS) is listening on now that you
reconfigured it by issuing the command:
rpcinfo -p
The following information will be shown:
program vers proto port
100000 2 tcp 111 portmapper
100000 2 udp 111 portmapper
100011 1 udp 660 rquotad
100011 2 udp 660 rquotad
100011 1 tcp 663 rquotad
100011 2 tcp 663 rquotad
100003 2 udp 2049 nfs
100003 3 udp 2049 nfs
100003 2 tcp 2049 nfs
100003 3 tcp 2049 nfs
100021 1 udp 4002 nlockmgr
100021 3 udp 4002 nlockmgr
100021 4 udp 4002 nlockmgr
100021 1 tcp 4002 nlockmgr
100021 3 tcp 4002 nlockmgr
100021 4 tcp 4002 nlockmgr
100005 1 udp 4001 mountd
100005 1 tcp 4001 mountd
100005 2 udp 4001 mountd
100005 2 tcp 4001 mountd
100005 3 udp 4001 mountd
100005 3 tcp 4001 mountd
Finally, you need to allow portmapper, nfs and your new nfs ports through
IPTables. If you’re setting up iptables as I usually do and are just using the
default INPUT chain, you would configure your iptables something like this:
First, delete your last DROP line:
iptables –D INPUT –j DROP
Next, add all the necessary TCP and UDP ports for NFS:
iptables –A INPUT –p tcp --dport 111 –j ACCEPT
iptables –A INPUT –p udp --dport 111 –j ACCEPT
iptables –A INPUT –p tcp --dport 2049 –j ACCEPT
iptables –A INPUT –p udp --dport 2049 –j ACCEPT
iptables –A INPUT –p tcp --dport 4000:4002 –j ACCEPT
iptables –A INPUT –p udp --dport 4000:4002 –j ACCEPT
Add your final DROP line back in:
iptables –A INPUT –j DROP
Finally, save and restart iptables:
service iptables save
service iptables restart
Kommentare zu diesen Handbüchern