侧边栏壁纸
博主头像
落叶人生博主等级

走进秋风,寻找秋天的落叶

  • 累计撰写 130562 篇文章
  • 累计创建 28 个标签
  • 累计收到 9 条评论
标签搜索

目 录CONTENT

文章目录

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

2023-11-01 星期三 / 0 评论 / 0 点赞 / 52 阅读 / 4348 字

环境:两台rhel7 一台服务器(172.24.11.10) 一台客户机(172.24.11.20) 防火墙放行命令 [root@server /]# firewall-cmd --add-serv

环境:两台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.10rpc mount export: RPC: Unable to receive; errno = No route to host

显示,没有路由。

ping

[root@system2 桌面]# ping 172.24.11.10PING 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 ms64 bytes from 172.24.11.10: icmp_seq=2 ttl=64 time=0.279 ms64 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.10Export 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.10tcpdump: verbose output suppressed, use -v or -vv for full protocol decodelistening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes22:23:21.900845 IP 172.24.11.20.706 > 172.24.11.10.111: UDP, length 5622:23:21.901279 IP 172.24.11.10.111 > 172.24.11.20.706: UDP, length 2822:23:21.901582 IP 172.24.11.20.706 > 172.24.11.10.111: UDP, length 5622:23:21.901820 IP 172.24.11.10.111 > 172.24.11.20.706: UDP, length 2822: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.10tcpdump: verbose output suppressed, use -v or -vv for full protocol decodelistening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes22:27:27.270023 IP 172.24.11.20.811 > 172.24.11.10.sunrpc: UDP, length 5622:27:27.271061 IP 172.24.11.10.sunrpc > 172.24.11.20.811: UDP, length 2822:27:27.271562 IP 172.24.11.20.811 > 172.24.11.10.sunrpc: UDP, length 5622:27:27.283415 IP 172.24.11.10.sunrpc > 172.24.11.20.811: UDP, length 2822:27:27.288704 IP 172.24.11.20.811 > 172.24.11.10.mountd: UDP, length 9222:27:27.295383 IP 172.24.11.10.mountd > 172.24.11.20.811: UDP, length 120

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

在服务器上看看20048端口

[root@server /]# netstat -ntulp | grep 20048tcp        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/udpsuccess

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

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

可以show出。

成功!

 

 

广告 广告

评论区