FreeBSD pf com NFS

1

Estou com problemas para estabelecer novas conexões NFS quando meu pf está ativado.

Quando desligo pf no servidor e no cliente, posso montar sem problemas.

Eu tentei keep state e flags S/SA na configuração do servidor, mas isso deu os mesmos resultados. Estou configurando as bandeiras erradas?

Cliente pf.conf :

pass in on $int_if inet proto { tcp udp } from $nfs_int_ip to ($int_if) port { sunrpc nfsd-status nfsd-keepalive nfsd lockd }
pass out on $int_if inet proto { tcp udp } from ($int_if) to $nfs_int_ip port { sunrpc nfsd-status nfsd-keepalive nfsd lockd }

Servidor pf.conf :

pass in on $int_if inet proto { tcp udp } from $int_subnet to ($int_if) port { sunrpc nfsd-status nfsd-keepalive nfsd lockd }
pass out on $int_if inet proto { tcp udp } from ($int_if) to $int_subnet port { sunrpc nfsd-status nfsd-keepalive nfsd lockd }

Abaixo está a saída de sudo tcpdump -tttnnnvvv -i pflog0 do servidor para quando eu tento montar no cliente:

00:00:27.567834 IP (tos 0x0, ttl 64, id 13093, offset 0, flags [none], proto UDP (17), length 84)
    10.132.42.85.817 > 10.132.42.148.111: [udp sum ok] UDP, length 56
00:00:00.009245 IP (tos 0x0, ttl 64, id 54776, offset 0, flags [none], proto UDP (17), length 56)
    10.132.42.148.111 > 10.132.42.85.817: [udp sum ok] UDP, length 28
00:00:00.003862 IP (tos 0x0, ttl 64, id 13094, offset 0, flags [DF], proto TCP (6), length 60)
    10.132.42.85.871 > 10.132.42.148.2049: Flags [S], cksum 0x97b8 (correct), seq 1435157682, win 65535, options [mss 1460,nop,wscale 6,sackOK,TS val 1292227501 ecr 0], length 0
00:00:00.000283 IP (tos 0x0, ttl 64, id 54777, offset 0, flags [DF], proto TCP (6), length 60)
    10.132.42.148.2049 > 10.132.42.85.871: Flags [S.], cksum 0x2967 (correct), seq 3548396325, ack 1435157683, win 65535, options [mss 1460,nop,wscale 6,sackOK,TS val 1375604124 ecr 1292227501], length 0
00:00:00.001210 IP (tos 0x0, ttl 64, id 13095, offset 0, flags [DF], proto TCP (6), length 52)
    10.132.42.85.871 > 10.132.42.148.2049: Flags [.], cksum 0x541f (correct), seq 1, ack 1, win 1040, options [nop,nop,TS val 1292227504 ecr 1375604124], length 0
00:00:00.000260 IP (tos 0x0, ttl 64, id 13096, offset 0, flags [DF], proto TCP (6), length 96)
    10.132.42.85.2847810760 > 10.132.42.148.2049: 40 null
00:00:00.000608 IP (tos 0x0, ttl 64, id 54778, offset 0, flags [DF], proto TCP (6), length 52)
    10.132.42.148.2049 > 10.132.42.85.871: Flags [.], cksum 0xe635 (correct), seq 1, ack 45, win 29127, options [nop,nop,TS val 1375604130 ecr 1292227504], length 0
00:00:00.000139 IP (tos 0x0, ttl 64, id 54779, offset 0, flags [DF], proto TCP (6), length 80)
    10.132.42.148.2049 > 10.132.42.85.2847810760: reply ok 24 null
00:00:00.001038 IP (tos 0x0, ttl 64, id 13097, offset 0, flags [DF], proto TCP (6), length 52)
    10.132.42.85.871 > 10.132.42.148.2049: Flags [F.], cksum 0x53d0 (correct), seq 45, ack 29, win 1040, options [nop,nop,TS val 1292227504 ecr 1375604130], length 0
00:00:00.000062 IP (tos 0x0, ttl 64, id 54780, offset 0, flags [DF], proto TCP (6), length 52)
    10.132.42.148.2049 > 10.132.42.85.871: Flags [.], cksum 0xe618 (correct), seq 29, ack 46, win 29127, options [nop,nop,TS val 1375604130 ecr 1292227504], length 0
00:00:00.000183 IP (tos 0x0, ttl 64, id 54781, offset 0, flags [DF], proto TCP (6), length 52)
    10.132.42.148.2049 > 10.132.42.85.871: Flags [F.], cksum 0xe617 (correct), seq 29, ack 46, win 29127, options [nop,nop,TS val 1375604130 ecr 1292227504], length 0
00:00:00.000332 IP (tos 0x0, ttl 64, id 13098, offset 0, flags [none], proto UDP (17), length 84)
    10.132.42.85.895 > 10.132.42.148.111: [udp sum ok] UDP, length 56
00:00:00.000557 IP (tos 0x0, ttl 64, id 13099, offset 0, flags [DF], proto TCP (6), length 52)
    10.132.42.85.871 > 10.132.42.148.2049: Flags [.], cksum 0x53cf (correct), seq 46, ack 30, win 1040, options [nop,nop,TS val 1292227504 ecr 1375604130], length 0
00:00:00.000555 IP (tos 0x0, ttl 64, id 54782, offset 0, flags [none], proto UDP (17), length 56)
    10.132.42.148.111 > 10.132.42.85.895: [udp sum ok] UDP, length 28

Deixe-me saber se estou sem informações.

    
por Samer 04.05.2015 / 21:25

2 respostas

0

NOTA: 192.168.1.9 é cliente e 14 é servidor e funciona bem em meus dois servidores ....
Cliente pf.conf :

block all
pass in on em0 inet proto { tcp udp } from 192.168.1.14 to em0 port { sunrpc nfsd-status nfsd-keepalive nfsd lockd }
pass out on em0  inet proto { tcp udp } from em0 to 192.168.1.14 port { sunrpc nfsd-status nfsd-keepalive nfsd lockd }

Servidor pf.conf :

block all
pass in on em0 inet proto { tcp udp } from 192.168.1.9 to em0 port { sunrpc nfsd-status nfsd-keepalive nfsd lockd }
pass out on em0 inet proto { tcp udp } from em0 to 192.168.1.9  port { sunrpc nfsd-status nfsd-keepalive nfsd lockd }
    
por 04.05.2015 / 21:55
0

Essas regras pf funcionam para mim. A porta 797 foi adicionada para o mountd. Existe um guia útil PF: Testando seu Firewall

Clientes NFS:

- nfs_ports="{ sunrpc, nfsd-status, nfsd-keepalive, nfsd, lockd, 797 }"
- nfs_server="10.132.0.2"
- pass in on $ext_if proto tcp from $nfs_server to $ext_if port $nfs_ports keep state flags S/SA
- pass in on $ext_if proto udp from $nfs_server to $ext_if port $nfs_ports                                                                                                                  
- pass out on $ext_if proto tcp from $ext_if to $nfs_server port $nfs_ports keep state flags S/SA
- pass out on $ext_if proto udp from $ext_if to $nfs_server port $nfs_ports

Servidor NFS:

- nfs_ports="{ sunrpc, nfsd-status, nfsd-keepalive, nfsd, lockd, 797 }"
- nfs_clients="{ 10.132.0.3, 10.132.0.4 }"
- pass in on $ext_if proto tcp from $nfs_clients to $ext_if port $nfs_ports keep state flags S/SA
- pass in on $ext_if proto udp from $nfs_clients to $ext_if port $nfs_ports                                                                                                                  
- pass out on $ext_if proto tcp from $ext_if to $nfs_clients port $nfs_ports keep state flags S/SA
- pass out on $ext_if proto udp from $ext_if to $nfs_clients port $nfs_ports
    
por 31.10.2017 / 19:02