可以看到 ping curl 目标地址都是通的,但是 tracepath 是不可达的,可能是因为 mtu 的问题, 客户端的 mtu 是 1500,而服务端的 mtu 是 1450
root@kube-ovn-worker:/# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 172.18.0.1 0.0.0.0 UG 0 0 0 eth0
10.1.0.0 172.21.0.100 255.255.255.0 UG 0 0 0 eth2
10.16.0.0 100.64.0.1 255.255.0.0 UG 0 0 0 ovn0
100.64.0.0 0.0.0.0 255.255.0.0 U 0 0 0 ovn0
172.18.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
172.19.0.0 0.0.0.0 255.255.0.0 U 0 0 0 br-external
172.21.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth2
root@kube-ovn-worker:/# ping -c1 172.21.0.1
PING 172.21.0.1 (172.21.0.1): 56 data bytes
64 bytes from 172.21.0.1: icmp_seq=0 ttl=64 time=0.071 ms
--- 172.21.0.1 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.071/0.071/0.071/0.000 ms
root@kube-ovn-worker:/# tracepath -n 10.1.0.4
1?: [LOCALHOST] pmtu 1438
1: no reply
2: no reply
3: no reply
4: no reply
5: no reply
6: no reply
7: no reply
8: no reply
9: no reply
10: no reply
^C
root@kube-ovn-worker:/# ping 10.1.0.2
PING 10.1.0.2 (10.1.0.2): 56 data bytes
64 bytes from 10.1.0.2: icmp_seq=0 ttl=64 time=0.658 ms
64 bytes from 10.1.0.2: icmp_seq=1 ttl=64 time=0.089 ms
64 bytes from 10.1.0.2: icmp_seq=2 ttl=64 time=0.093 ms
^C--- 10.1.0.2 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.089/0.280/0.658/0.267 ms
root@kube-ovn-worker:/# ping 10.1.0.4
PING 10.1.0.4 (10.1.0.4): 56 data bytes
64 bytes from 10.1.0.4: icmp_seq=0 ttl=62 time=0.886 ms
64 bytes from 10.1.0.4: icmp_seq=1 ttl=62 time=0.213 ms
64 bytes from 10.1.0.4: icmp_seq=2 ttl=62 time=0.168 ms
64 bytes from 10.1.0.4: icmp_seq=3 ttl=62 time=0.205 ms
64 bytes from 10.1.0.4: icmp_seq=4 ttl=62 time=0.215 ms
^C--- 10.1.0.4 ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.168/0.337/0.886/0.275 ms
root@kube-ovn-worker:/# curl 10.1.0.4
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
html { color-scheme: light dark; }
body { width: 35em; margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif; }
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>
<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>
<p><em>Thank you for using nginx.</em></p>
</body>
</html>
root@kube-ovn-worker:/# tracepath -n 10.1.0.2
1?: [LOCALHOST] pmtu 1438
1: no reply
2: no reply
3: no reply
4: no reply
5: no reply
6: no reply
7: no reply
8: no reply
9: no reply
10: no reply
11: no reply
12: no reply
^C
client mtu
18: eth2@if198: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
link/ether 7a:fd:3c:de:3c:d5 brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 172.21.0.3/16 brd 172.21.255.255 scope global eth2
valid_lft forever preferred_lft forever
inet 172.21.0.100/32 scope global eth2
valid_lft forever preferred_lft forever
inet6 fc00:5645:6976:1737::3/64 scope global nodad
valid_lft forever preferred_lft forever
inet6 fe80::78fd:3cff:fede:3cd5/64 scope link
valid_lft forever preferred_lft forever
server mtu
root@debian:guide/ipsec-vpn-host/02-ipsec-fip-to-host main ✗ 1d15h ✖ ◒
▶ k exec -it -n ns1 alice-d5bbd7989-kgqdg -c netshoot -- bash
alice-d5bbd7989-kgqdg:~# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.1.0.1 0.0.0.0 UG 0 0 0 eth0
10.1.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
alice-d5bbd7989-kgqdg:~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host proto kernel_lo
valid_lft forever preferred_lft forever
30: eth0@if31: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue state UP group default
link/ether e6:22:21:fd:23:dd brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 10.1.0.4/24 brd 10.1.0.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::e422:21ff:fefd:23dd/64 scope link proto kernel_ll
valid_lft forever preferred_lft forever
alice-d5bbd7989-kgqdg:~#
但是 traceroute 就是正常
root@kube-ovn-worker:/# traceroute -n 10.1.0.2
traceroute to 10.1.0.2 (10.1.0.2), 30 hops max, 60 byte packets
1 10.1.0.2 0.603 ms 0.578 ms 0.575 ms
root@kube-ovn-worker:/# traceroute -n 10.1.0.4
traceroute to 10.1.0.4 (10.1.0.4), 30 hops max, 60 byte packets
1 10.1.0.2 1.666 ms 1.663 ms 1.666 ms
2 * * 10.1.0.4 259.777 ms
root@kube-ovn-worker:/#