为什么我还能收到数据包,但“ip Route get”却报“网络不可达”?

为什么我还能收到数据包,但“ip Route get”却报“网络不可达”?

我有一个 kubernetes 集群(更具体地说,是 kubeedge 集群),该集群有 3 个节点:

  • 上海:21年48月10日
  • 节点1:10.22.48.12
  • 边缘1: 10.22.48.13

也是客户端计算机:10.40.20.181。

我在这个集群中使用了 flannel,还使用了 fabedge 来处理云端和边缘之间的流量。

这是我遇到的问题:

我在 shanghai 节点上执行“ip r get 10.233.66.34 from 10.22.48.12”并收到错误“RTNETLINK Answers: Network is unreachable”(10.233.66.34是分配给edge1节点1上的pod的pod IP)

我的问题是:为什么会发生这个错误?

这是上海节点上的路由表:

[root@shanghai ~]# ip r show table main
default via 10.22.48.254 dev eth0 proto dhcp metric 100 
10.22.48.0/24 dev eth0 proto kernel scope link src 10.22.48.21 metric 100 
10.233.64.0/24 dev cni0 proto kernel scope link src 10.233.64.1 
10.233.65.0/24 via 10.233.65.0 dev flannel.1 onlink 
10.233.68.0/24 via 10.233.68.0 dev flannel.1 onlink 
169.254.169.254 via 10.22.48.11 dev eth0 proto dhcp metric 100 
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 linkdown 
[root@shanghai ~]# ip r show table 220
10.233.66.0/24 via 10.233.65.0 dev flannel.1 onlink 
10.233.67.0/24 via 10.233.65.0 dev flannel.1 onlink 

另一个困扰我的问题是,虽然上海节点报告了这个错误,但我仍然可以在充当路由器的节点1上找到从10.40.20.181到10.233.66.34的数据包,这怎么可能呢?

05:31:12.699648 flannel.1 In  IP 10.40.20.181.54580 > 10.233.66.34.80: Flags [S], seq 241297879, win 64240, options [mss 1276,sackOK,TS val 1131723081 ecr 0,nop,wscale 7,unknown-145 0x1815090500080a2864fdcc8c0bbd], length 0
05:31:12.700137 eth0  In  IP 10.233.66.34.80 > 10.22.48.12.11792: Flags [S.], seq 2966150963, ack 241297880, win 64704, options [mss 1360,sackOK,TS val 2311535627 ecr 1131723081,nop,wscale 7], length 0
05:31:12.700160 eth0  Out IP 10.233.66.34.80 > 10.40.20.181.54580: Flags [S.], seq 2966150963, ack 241297880, win 64704, options [mss 1360,sackOK,TS val 2311535627 ecr 1131723081,nop,wscale 7], length 0
05:31:13.699355 flannel.1 In  IP 10.40.20.181.54580 > 10.233.66.34.80: Flags [S], seq 241297879, win 64240, options [mss 1276,sackOK,TS val 1131724081 ecr 0,nop,wscale 7,unknown-145 0x1815090500080a2864fdcc8c0bbd], length 0
05:31:13.699707 eth0  In  IP 10.233.66.34.80 > 10.22.48.12.11792: Flags [S.], seq 2966150963, ack 241297880, win 64704, options [mss 1360,sackOK,TS val 2311536626 ecr 1131723081,nop,wscale 7], length 0
05:31:13.699720 eth0  Out IP 10.233.66.34.80 > 10.40.20.181.54580: Flags [S.], seq 2966150963, ack 241297880, win 64704, options [mss 1360,sackOK,TS val 2311536626 ecr 1131723081,nop,wscale 7], length 0

相关内容