I'm trying to use tcp/111 for rpcbind
under Debian Wheezy instead of udp/111. The portmap
in Squeeze uses tcp/111 without any special configuration, but Wheezy fails.
Even numerous sites (as well as RFC) says TCP or UDP is selected dynamically, or sometimes that TCP is used if UDP fails… – when I reject udp/111 (with iptables
) on Wheezy client with rpcbind
, I get errors…
# showmount -e server
Export list for server:
....
# iptables -I OUTPUT -j REJECT -d server -p udp --dport 111 --reject-with icmp-port-unreachable
# showmount -e server
clnt_create: RPC: Port mapper failure - Unable to send: errno 1 (Operation not permitted)
# rpcinfo -p
program vers proto port service
100000 4 tcp 111 portmapper
100000 3 tcp 111 portmapper
100000 2 tcp 111 portmapper
100000 4 udp 111 portmapper
100000 3 udp 111 portmapper
100000 2 udp 111 portmapper
#
How can I setup rpcbind
to use TCP only?
Best Answer
If you mount with
vers=3,proto=tcp
, TCP is used when queryingrpcbind
for the actual mount:I can only assume
showmount
is hard-coded to use UDP. I tried to read the source of nfs-utils but got lost inshowmount.c
afterclnt_call()
, sorry.