# NFS firewall configuration[solved]

## Adel Ahmed

I'm trying to configure my NFS server to use static ports

I have the following entry in /etc/conf.d/nfs:

OPTS_RPC_MOUNTD="-p 32767"

but:

pc ~ # rpcinfo -p | grep udp.*mountd

    100005    1   udp  33268  mountd

    100005    2   udp  37470  mountd

    100005    3   udp  47579  mountd

thanksLast edited by Adel Ahmed on Sat Oct 10, 2015 9:26 pm; edited 1 time in total

----------

## Keruskerfuerst

It is uncommon to setup a firewall for NFS.

----------

## szatox

Close enough. It seems this is what you're looking for:

 *Quote:*   

>  RPCMOUNTDOPTS="-p 32767"

 

https://wiki.debian.org/SecuringNFS

----------

## Adel Ahmed

nope that did not work

I did notice in the systemd script:

ExecStart=/usr/sbin/rpc.mountd $RPCMOUNTDOPTS

EnvironmentFile=/etc/conf.d/nfs

so I changed that to:

ExecStart=/usr/sbin/rpc.mountd $OPTS_RPC_MOUNTD

worked like a charm

----------

## szatox

Quite funny. They should either both work or both fail.

After expanding variables you get exactly the same command line. If one worked and the other didn't, you had to either make some typo or define the variable in wrong place.

----------

## Adel Ahmed

I don't remember exactly, but I probably had copied that service script of some website, I probably just copide and didn't check

----------

