rpc mount export: RPC: Unable to receive; errno = No route to host

环境:两台rhel7    一台服务器(172.24.11.10)  一台客户机(172.24.11.20)

防火墙放行命令

[root@server /]# firewall-cmd --add-service=rpc-bind

但是远端依旧无法showmount 出来

[root@system2 桌面]# showmount -e 172.24.11.10
rpc mount export: RPC: Unable to receive; errno = No route to host

显示,没有路由。

ping

[root@system2 桌面]# ping 172.24.11.10
PING 172.24.11.10 (172.24.11.10) 56(84) bytes of data.
64 bytes from 172.24.11.10: icmp_seq=1 ttl=64 time=0.502 ms
64 bytes from 172.24.11.10: icmp_seq=2 ttl=64 time=0.279 ms
64 bytes from 172.24.11.10: icmp_seq=3 ttl=64 time=0.275 ms

很奇怪,放了防火墙,路由也能ping通

把防火墙彻底关掉

[root@server /]# iptables -F

然后再在客户端上showmount

[root@system2 桌面]# showmount -e 172.24.11.10
Export list for 172.24.11.10:
/protected 172.24.11.0/24
/public    172.24.11.0/24

哎,成功了,美滋滋。

问题:防火墙的问题,firewall不能彻底释放端口。

-------------------------------------------------------------------------------------------------------------

此时,问题是firewall自身的缺陷造成的,那我们就要找到那个端口

在客户端上抓包,看看到底是什么地方出了问题

当防火墙开启时

[root@system2 桌面]# tcpdump -nn -i eth0 host 172.24.11.10
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
22:23:21.900845 IP 172.24.11.20.706 > 172.24.11.10.111: UDP, length 56
22:23:21.901279 IP 172.24.11.10.111 > 172.24.11.20.706: UDP, length 28
22:23:21.901582 IP 172.24.11.20.706 > 172.24.11.10.111: UDP, length 56
22:23:21.901820 IP 172.24.11.10.111 > 172.24.11.20.706: UDP, length 28
22:23:21.902010 IP 172.24.11.20.706 > 172.24.11.10.20048: UDP, length 92

当防火墙关闭时  (上下两条命令有区别,仔细看。其中的mountd的端口号就是20048)

[root@system2 桌面]# tcpdump -n -i eth0 host 172.24.11.10
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
22:27:27.270023 IP 172.24.11.20.811 > 172.24.11.10.sunrpc: UDP, length 56
22:27:27.271061 IP 172.24.11.10.sunrpc > 172.24.11.20.811: UDP, length 28
22:27:27.271562 IP 172.24.11.20.811 > 172.24.11.10.sunrpc: UDP, length 56
22:27:27.283415 IP 172.24.11.10.sunrpc > 172.24.11.20.811: UDP, length 28
22:27:27.288704 IP 172.24.11.20.811 > 172.24.11.10.mountd: UDP, length 92
22:27:27.295383 IP 172.24.11.10.mountd > 172.24.11.20.811: UDP, length 120

问题:在客户端向服务器端请求20048端口时被拒绝。

在服务器上看看20048端口

[root@server /]# netstat -ntulp | grep 20048
tcp        0      0 0.0.0.0:20048           0.0.0.0:*               LISTEN      7675/rpc.mountd     
tcp6       0      0 :::20048                :::*                    LISTEN      7675/rpc.mountd     
udp        0      0 0.0.0.0:20048           0.0.0.0:*                           7675/rpc.mountd     
udp        0      0 0.0.0.0:20048           0.0.0.0:*                           7675/rpc.mountd     
udp6       0      0 :::20048                :::*                                7675/rpc.mountd     
udp6       0      0 :::20048                :::*                                7675/rpc.mountd     

属于rpc.mount 

放行20048端口

[root@server /]# firewall-cmd --add-port=20048/udp
success

看看客户端是否能成功showmount出

[root@system2 桌面]# showmount -e 172.24.11.10
Export list for 172.24.11.10:
/protected 172.24.11.0/24
/public    172.24.11.0/24

可以show出。

成功!

猜你喜欢

转载自my.oschina.net/u/3331172/blog/1443064
RPC