隨筆-86  評(píng)論-33  文章-0  trackbacks-0
          NFS 用到的服務(wù)有 portmapper nfs rquotad nlockmgr mountd
          通過命令 rpcinfo -p 可查看nfs使用的端口
          # rpcinfo -p
             program vers proto   port  service
              100000    4   tcp    111  portmapper
              100000    3   tcp    111  portmapper
              100000    2   tcp    111  portmapper
              100000    4   udp    111  portmapper
              100000    3   udp    111  portmapper
              100000    2   udp    111  portmapper
              100024    1   udp  53713  status
              100024    1   tcp  47753  status
              100011    1   udp    875  rquotad
              100011    2   udp    875  rquotad
              100011    1   tcp    875  rquotad
              100011    2   tcp    875  rquotad
              100003    2   tcp   2049  nfs
              100003    3   tcp   2049  nfs
              100003    4   tcp   2049  nfs
              100227    2   tcp   2049  nfs_acl
              100227    3   tcp   2049  nfs_acl
              100003    2   udp   2049  nfs
              100003    3   udp   2049  nfs
              100003    4   udp   2049  nfs
              100227    2   udp   2049  nfs_acl
              100227    3   udp   2049  nfs_acl
              100021    1   udp  40399  nlockmgr
              100021    3   udp  40399  nlockmgr
              100021    4   udp  40399  nlockmgr
              100021    1   tcp  46247  nlockmgr
              100021    3   tcp  46247  nlockmgr
              100021    4   tcp  46247  nlockmgr
              100005    1   udp  60639  mountd
              100005    1   tcp  39962  mountd
              100005    2   udp  51575  mountd
              100005    2   tcp  42414  mountd
              100005    3   udp  38358  mountd
              100005    3   tcp  48741  mountd
          其中 portmapper nfs 服務(wù)端口是固定的分別是 111 2049
          另外 rquotad nlockmgr mountd 服務(wù)端口是隨機(jī)的。由于端口是隨機(jī)的,這導(dǎo)致防火墻無法設(shè)置。
          這時(shí)需要配置/etc/sysconfig/nfs 使 rquotad nlockmgr mountd 的端口固定。
          找到以下幾項(xiàng),將前面的#號(hào)去掉。
          RQUOTAD_PORT=875
          LOCKD_TCPPORT=32803
          LOCKD_UDPPORT=32769
          MOUNTD_PORT=892
          #service nfs restart
           
          #rpcinfo -p
             program vers proto   port  service
              100000    4   tcp    111  portmapper
              100000    3   tcp    111  portmapper
              100000    2   tcp    111  portmapper
              100000    4   udp    111  portmapper
              100000    3   udp    111  portmapper
              100000    2   udp    111  portmapper
              100024    1   udp  53713  status
              100024    1   tcp  47753  status
              100011    1   udp    875  rquotad
              100011    2   udp    875  rquotad
              100011    1   tcp    875  rquotad
              100011    2   tcp    875  rquotad
              100003    2   tcp   2049  nfs
              100003    3   tcp   2049  nfs
              100003    4   tcp   2049  nfs
              100227    2   tcp   2049  nfs_acl
              100227    3   tcp   2049  nfs_acl
              100003    2   udp   2049  nfs
              100003    3   udp   2049  nfs
              100003    4   udp   2049  nfs
              100227    2   udp   2049  nfs_acl
              100227    3   udp   2049  nfs_acl
              100021    1   udp  32769  nlockmgr
              100021    3   udp  32769  nlockmgr
              100021    4   udp  32769  nlockmgr
              100021    1   tcp  32803  nlockmgr
              100021    3   tcp  32803  nlockmgr
              100021    4   tcp  32803  nlockmgr
              100005    1   udp    892  mountd
              100005    1   tcp    892  mountd
              100005    2   udp    892  mountd
              100005    2   tcp    892  mountd
              100005    3   udp    892  mountd
              100005    3   tcp    892  mountd
          設(shè)置防火墻
          iptables -I INPUT -s 192.168.0.0/24 -p tcp --dport 111 -j ACCEPT
          iptables -I INPUT -s 192.168.0.0/24 -p tcp --dport 875 -j ACCEPT
          iptables -I INPUT -s 192.168.0.0/24 -p tcp --dport 2049 -j ACCEPT
          iptables -I INPUT -s 192.168.0.0/24 -p tcp --dport 32769 -j ACCEPT
          iptables -I INPUT -s 192.168.0.0/24 -p tcp --dport 32803 -j ACCEPT
          iptables -I INPUT -s 192.168.0.0/24 -p tcp --dport 892 -j ACCEPT
          iptables -I INPUT -s 192.168.0.0/24 -p udp --dport 111 -j ACCEPT
          iptables -I INPUT -s 192.168.0.0/24 -p udp --dport 875 -j ACCEPT
          iptables -I INPUT -s 192.168.0.0/24 -p udp --dport 2049 -j ACCEPT
          iptables -I INPUT -s 192.168.0.0/24 -p udp --dport 32769 -j ACCEPT
          iptables -I INPUT -s 192.168.0.0/24 -p udp --dport 32803 -j ACCEPT
          iptables -I INPUT -s 192.168.0.0/24 -p udp --dport 892 -j ACCEPT

          查看IPTABLES
          # iptables -L
          保存IPTABLES
          # iptables-save > /etc/sysconfig/iptables



          posted on 2012-03-14 16:14 Derek.Guo 閱讀(1728) 評(píng)論(0)  編輯  收藏

          只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。


          網(wǎng)站導(dǎo)航:
           
          MSN:envoydada@hotmail.com QQ:34935442
          主站蜘蛛池模板: 佛教| 兰坪| 镇原县| 广元市| 平邑县| 磴口县| 晋宁县| 郓城县| 平安县| 龙海市| 柞水县| 当雄县| 富川| 阿鲁科尔沁旗| 浑源县| 五河县| 乌拉特前旗| 客服| 赤峰市| 黑河市| 峨山| 英山县| 海口市| 望谟县| 龙山县| 沈阳市| 乐都县| 南漳县| 庆元县| 崇州市| 五大连池市| 英吉沙县| 富民县| 乌兰察布市| 阿克苏市| 郎溪县| 白朗县| 正宁县| 广平县| 泊头市| 永定县|