How to tell statd to use portmap on a non-localhost ipadress?

Posted by jneves on Server Fault See other posts from Server Fault or by jneves
Published on 2010-06-08T10:42:20Z Indexed on 2010/06/08 10:53 UTC
Read the original article Hit count: 331

Filed under:
|
|
|
|

How can I make statd connect to other IP address other than 127.0.0.1?

I have a server that is connected to 2 different networks (one is public, another a private). I want it to provide a NFS share for only the private network. The host in an ubuntu 8.04.

The private ip address is 192.168.1.202

I changed /etc/default/portmap to add:

OPTIONS="-i 192.168.1.202"

The command lsof -n | grep portmap returns:

portmap   10252   daemon  cwd       DIR      202,0       4096          2 /
portmap   10252   daemon  rtd       DIR      202,0       4096          2 /
portmap   10252   daemon  txt       REG      202,0      15248      13461 /sbin/portmap
portmap   10252   daemon  mem       REG      202,0      83708      32823 /lib/tls/i686/cmov/libnsl-2.7.so
portmap   10252   daemon  mem       REG      202,0    1364388      32817 /lib/tls/i686/cmov/libc-2.7.so
portmap   10252   daemon  mem       REG      202,0      31304      16588 /lib/libwrap.so.0.7.6
portmap   10252   daemon  mem       REG      202,0     109152      16955 /lib/ld-2.7.so
portmap   10252   daemon    0u      CHR        1,3                   960 /dev/null
portmap   10252   daemon    1u      CHR        1,3                   960 /dev/null
portmap   10252   daemon    2u      CHR        1,3                   960 /dev/null
portmap   10252   daemon    3u     unix 0xecc8c3c0               4332992 socket
portmap   10252   daemon    4u     IPv4    4332993                   UDP 192.168.1.202:sunrpc 
portmap   10252   daemon    5u     IPv4    4332994                   TCP 192.168.1.202:sunrpc (LISTEN)
portmap   10252   daemon    6u      REG       0,12        289    3821511 /var/run/portmap_mapping

I defined in /etc/hosts the following:

192.168.1.202   server.local

In /etc/default/nfs-common I changed STATDOPTS to:

STATDOPTS="--name server.local"

Yet when I run /etc/init.d/nfs-common start if fails to start. The log shows:

Jun  8 06:37:44 cookwork-web1 rpc.statd[9723]: Version 1.1.2 Starting
Jun  8 06:37:44 cookwork-web1 rpc.statd[9723]: Flags: 
Jun  8 06:37:44 cookwork-web1 rpc.statd[9723]: unable to register (statd, 1, udp).

An strace -f rpc.statd -n server.local results in a lot of lines, including this one:

sendto(9, "\200]3\362\0\0\0\0\0\0\0\2\0\1\206\240\0\0\0\2\0\0\0\1"..., 56, 0, {sa_family=AF_INET, sin_port=htons(111), sin_addr=inet_addr("127.0.0.1")}, 16) = 56

© Server Fault or respective owner

Related posts about linux

Related posts about ubuntu