nfs и firewall

Обсуждение настройки и работы сервисов, резервирования, сетевых настроек и вопросов безопасности ОС.

Модераторы: SLEDopit, Модераторы разделов

Аватара пользователя
joebraker
Сообщения: 98
ОС: OpenSuse 10.3

nfs и firewall

Сообщение joebraker »

Проблемы с монтированием по nfs. Возможно, они связаны с firewall

Комп десктоп роутер
Имя linux-uitr router он же homewifi
OS opensuse 11.0 openWRT
ошибка такого вида:

Код:

linux-uitr:/home/joebraker # mount router:/scripts /mnt/router/ -t nfs -v mount.nfs: timeout set for Wed Jul 9 22:15:40 2008 mount.nfs: text-based options: 'addr=192.168.1.1' mount.nfs: trying 192.168.1.1 prog 100003 vers 3 prot TCP port 916 mount.nfs: trying 192.168.1.1 prog 100003 vers 3 prot UDP port 914 mount.nfs: trying 192.168.1.1 prog 100003 vers 2 prot TCP port 916 mount.nfs: trying 192.168.1.1 prog 100005 vers 1 prot UDP port 912 mount.nfs: text-based options (retry): 'addr=192.168.1.1,nfsvers=2,proto=tcp,port=916' mount.nfs: text-based options: 'addr=192.168.1.1' mount.nfs: trying 192.168.1.1 prog 100003 vers 3 prot TCP port 916 mount.nfs: trying 192.168.1.1 prog 100003 vers 3 prot UDP port 914 mount.nfs: trying 192.168.1.1 prog 100003 vers 2 prot TCP port 916 mount.nfs: trying 192.168.1.1 prog 100005 vers 1 prot UDP port 912 mount.nfs: text-based options (retry): 'addr=192.168.1.1,nfsvers=2,proto=tcp,port=916' и так далее до бесконечности


root@homewifi:/etc# cat exports
/scripts linux-uitr(rw)

rpcinfo:

Код:

linux-uitr:/home/joebraker # rpcinfo -p прог-ма верс прото порт 100000 2 tcp 111 portmapper 100000 2 udp 111 portmapper 100024 1 udp 36835 status 100024 1 tcp 49167 status 100005 1 udp 4003 mountd 100005 1 tcp 4003 mountd 100005 2 udp 4003 mountd 100005 2 tcp 4003 mountd 100005 3 udp 4003 mountd 100005 3 tcp 4003 mountd 100003 2 udp 2049 nfs 100003 3 udp 2049 nfs 100003 4 udp 2049 nfs 100021 1 udp 47822 nlockmgr 100021 3 udp 47822 nlockmgr 100021 4 udp 47822 nlockmgr 100003 2 tcp 2049 nfs 100003 3 tcp 2049 nfs 100003 4 tcp 2049 nfs 100021 1 tcp 42441 nlockmgr 100021 3 tcp 42441 nlockmgr 100021 4 tcp 42441 nlockmgr linux-uitr:/home/joebraker # rpcinfo -p router прог-ма верс прото порт 100000 2 tcp 111 portmapper 100000 2 udp 111 portmapper 100005 1 udp 912 mountd 100005 2 udp 912 mountd 100005 1 tcp 915 mountd 100005 2 tcp 915 mountd 100003 2 udp 914 nfs 100003 2 tcp 916 nfs


iptables:

Код:

root@homewifi:/etc# iptables -L Chain INPUT (policy DROP) target prot opt source destination DROP all -- anywhere anywhere state INVALID ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED DROP tcp -- anywhere anywhere tcp option=!2 flags:SYN/SYN input_rule all -- anywhere anywhere input_wan all -- anywhere anywhere LAN_ACCEPT all -- anywhere anywhere ACCEPT icmp -- anywhere anywhere ACCEPT gre -- anywhere anywhere REJECT tcp -- anywhere anywhere reject-with tcp-reset REJECT all -- anywhere anywhere reject-with icmp-port-unreachable ACCEPT udp -- anywhere anywhere udp dpt:nfs ACCEPT tcp -- anywhere anywhere tcp dpt:nfs ACCEPT udp -- anywhere anywhere udp dpt:sunrpc ACCEPT tcp -- anywhere anywhere tcp dpt:sunrpc ACCEPT udp -- anywhere anywhere udp dpt:mountd ACCEPT tcp -- anywhere anywhere tcp dpt:mountd Chain FORWARD (policy DROP) target prot opt source destination DROP all -- anywhere anywhere state INVALID TCPMSS tcp -- anywhere anywhere tcp flags:SYN,RST/SYN TCPMSS clamp to PMTU ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED forwarding_rule all -- anywhere anywhere forwarding_wan all -- anywhere anywhere ACCEPT all -- anywhere anywhere ACCEPT all -- anywhere anywhere ACCEPT all -- anywhere anywhere state NEW,RELATED,ESTABLISHED ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED Chain LAN_ACCEPT (1 references) target prot opt source destination RETURN all -- anywhere anywhere ACCEPT all -- anywhere anywhere Chain OUTPUT (policy DROP) target prot opt source destination DROP all -- anywhere anywhere state INVALID ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED output_rule all -- anywhere anywhere ACCEPT all -- anywhere anywhere REJECT tcp -- anywhere anywhere reject-with tcp-reset REJECT all -- anywhere anywhere reject-with icmp-port-unreachable ACCEPT all -- anywhere anywhere Chain forwarding_rule (1 references) target prot opt source destination Chain forwarding_wan (1 references) target prot opt source destination Chain input_rule (1 references) target prot opt source destination Chain input_wan (1 references) target prot opt source destination Chain output_rule (1 references) target prot opt source destination

Код:

root@homewifi:/etc# cat services nfs 916/tcp nfs 914/udp mountd 915/tcp mountd 912/udp sunrpc 111/tcp sunrpc 111/udp

Подскажите в чем проблема, пожалуйста.
В обратную сторону все работает, то есть при монтировании на роутере папки с десктопа.
При выключении nfs из списка разрешенных служб десктопа симптомы очень похожие на описанную проблему.

Дополнительная информация, говорящая о том, что порты нужные вроде открыты.

Код:

root@homewifi:/etc# netstat -aln Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 0.0.0.0:49152 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:939 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:915 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:916 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:53 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:23 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:830 0.0.0.0:* LISTEN netstat: no support for `AF INET6 (tcp)' on this system. udp 0 0 0.0.0.0:1024 0.0.0.0:* udp 0 0 127.0.0.1:1025 0.0.0.0:* udp 0 0 0.0.0.0:912 0.0.0.0:* udp 0 0 0.0.0.0:914 0.0.0.0:* udp 0 0 0.0.0.0:1701 0.0.0.0:* udp 0 0 0.0.0.0:939 0.0.0.0:* udp 0 0 0.0.0.0:53 0.0.0.0:* udp 0 0 0.0.0.0:827 0.0.0.0:* udp 0 0 0.0.0.0:67 0.0.0.0:* udp 0 0 0.0.0.0:1900 0.0.0.0:* udp 0 0 0.0.0.0:111 0.0.0.0:* netstat: no support for `AF INET6 (udp)' on this system. netstat: no support for `AF INET6 (raw)' on this system. Active UNIX domain sockets (only servers) Proto RefCnt Flags Type State I-Node Path



Дополнительная информация, повествующая о том, что все нужные порты вроде открыты.

Код:

root@homewifi:/etc# netstat -aln Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 0.0.0.0:49152 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:939 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:915 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:916 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:53 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:23 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:830 0.0.0.0:* LISTEN netstat: no support for `AF INET6 (tcp)' on this system. udp 0 0 0.0.0.0:1024 0.0.0.0:* udp 0 0 127.0.0.1:1025 0.0.0.0:* udp 0 0 0.0.0.0:912 0.0.0.0:* udp 0 0 0.0.0.0:914 0.0.0.0:* udp 0 0 0.0.0.0:1701 0.0.0.0:* udp 0 0 0.0.0.0:939 0.0.0.0:* udp 0 0 0.0.0.0:53 0.0.0.0:* udp 0 0 0.0.0.0:827 0.0.0.0:* udp 0 0 0.0.0.0:67 0.0.0.0:* udp 0 0 0.0.0.0:1900 0.0.0.0:* udp 0 0 0.0.0.0:111 0.0.0.0:* netstat: no support for `AF INET6 (udp)' on this system. netstat: no support for `AF INET6 (raw)' on this system. Active UNIX domain sockets (only servers) Proto RefCnt Flags Type State I-Node Path
Спасибо сказали:
IMB
Сообщения: 2567
ОС: Debian

Re: nfs и firewall

Сообщение IMB »

Все это конечно хорошо и замечательно, но.......... Права доступа для nfs, кстати и для tftp, определяются файлами /etc/hosts.{allow, deny}. Вы там прописали кому разрешено/запрещено пользоваться Вашим nfs-сервером?
Спасибо сказали:
Аватара пользователя
joebraker
Сообщения: 98
ОС: OpenSuse 10.3

Re: nfs и firewall

Сообщение joebraker »

Слямзил с аналогичного файла в сусе

Код:

root@homewifi:/scripts/cron# cat /etc/hosts.allow portmap | /sbin/portmap | portmap # The portmapper does not verify against hostnames # to prevent hangs. It only checks non-local addresses. # # (kernel nfs server) nfs-utils | /usr/sbin/rpc.mountd | mountd nfs-utils | /sbin/rpc.statd | statd # # (unfsd, userspace nfs server) nfs-server | /usr/sbin/rpc.mountd | rpc.mountd nfs-server | /usr/sbin/rpc.ugidd | rpc.ugidd


Раньше было так

Код:

ALL:ALL

тоже не работало

hosts.deny у меня нету
Спасибо сказали: