Hi,
I have a HA NFS server setup, but I am having some problems with
mounting the NFS shares. I have had to patch mountd to allow it to be
configured with an IP to bind to, its a bit of quick hack (no docs,
ipv6 etc...) but solves the problem for us where mountd sends the
packets from the wrong ip. (See patch bellow).
The NFS server IP is 172.31.0.200 and we have the following flags set in
rc.conf:
nfs_server_flags="-u -t -n 4 -h 172.31.0.200"
rpcbind_flags="-h 172.31.0.200"
mountd_flags="-r -p 832 -h 172.31.0.200"
When I try and mount the share I get the following error the command:
maverick# mount nfs-server:/usr/home /usr/home
[udp] nfs-server:/usr/home: RPCPROG_MNT: RPC: Timed out
[udp] nfs-server:/usr/home: RPCPROG_MNT: RPC: Timed out
And the following data from tcpdump on the server:
[root@beaker /usr/home/mintel]# tcpdump -n 'ip host 172.31.0.2 and ip
host 172.31.0.200'
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on em0, link-type EN10MB (Ethernet), capture size 68 bytes
17:10:58.321858 IP 172.31.0.2.906 > 172.31.0.200.111: UDP, length 56
17:10:58.322018 IP 172.31.0.200.111 > 172.31.0.2.906: UDP, length 28
17:10:58.322231 IP 172.31.0.2.1175084341 > 172.31.0.200.2049: 40 null
17:10:58.322280 IP 172.31.0.200.2049 > 172.31.0.2.1175084341: reply ok
24 null
17:10:58.322481 IP 172.31.0.2.921 > 172.31.0.200.111: [|lwres]
17:10:58.322560 IP 172.31.0.200.111 > 172.31.0.2.921: [|lwres]
17:10:58.322731 IP 172.31.0.2.854 > 172.31.0.200.832: UDP, length 112
17:11:13.324547 IP 172.31.0.200.832 > 172.31.0.2.854: UDP, length 68
17:11:13.324652 IP 172.31.0.2 > 172.31.0.200: ICMP 172.31.0.2 udp port
854 unreachable, length 36
I can reproduce the problem on a number 6.2 Release systems (i386/amd64).
Has anyone seen this before, or know of a fix?
Thanks
Tom
/usr/src/sys/usr.sbin/mountd/
Index: mountd.c
==================================================================--- mountd.c
(revision 37)
+++ mountd.c (working copy)
@@ -257,7 +257,7 @@
fd_set readfds;
struct sockaddr_in sin;
struct sockaddr_in6 sin6;
- char *endptr;
+ char *endptr, *svcaddr;
SVCXPRT *udptransp, *tcptransp, *udp6transp, *tcp6transp;
struct netconfig *udpconf, *tcpconf, *udp6conf, *tcp6conf;
pid_t otherpid;
@@ -290,7 +290,7 @@
errx(1, "NFS server is not available or
loadable");
}
- while ((c = getopt(argc, argv, "2dlnp:r")) != -1)
+ while ((c = getopt(argc, argv, "2dlnp:rh:")) != -1)
switch (c) {
case '2':
force_v2 = 1;
@@ -307,6 +307,9 @@
case 'l':
dolog = 1;
break;
+ case 'h':
+ svcaddr = optarg;
+ break;
case 'p':
endptr = NULL;
svcport = (in_port_t)strtoul(optarg, &endptr, 10);
@@ -392,6 +395,7 @@
sin.sin_len = sizeof(struct sockaddr_in);
sin.sin_family = AF_INET;
sin.sin_port = htons(svcport);
+ sin.sin_addr.s_addr = inet_addr(svcaddr);
bzero(&sin6, sizeof(struct sockaddr_in6));
sin6.sin6_len = sizeof(struct sockaddr_in6);