1.所有容器的默认路由为169.254.1.1,该IP的mac为容器在host上面的对应veth,所以容器里面所有的报文,都可以发送到主机上面,再走calico的BGP路由。
2.查看k8s容器的对应host veth
容器中
首先查看网卡
root@ubuntu-ubuntu-2316498694-g7bln:/# ip route
default via 169.254.1.1 dev eth0
169.254.1.1 dev eth0 scope link
查看对端
root@ubuntu-ubuntu-2316498694-g7bln:/# ethtool -S eth0
NIC statistics:
peer_ifindex: 99
root@ubuntu-ubuntu-2316498694-g7bln:/#
在host上面查看:
[root@192-168-124-64 ~]# ip a | grep 99
link/ether ce:99:82:34:1d:98 brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet6 fe80::cc99:82ff:fe34:1d98/64 scope link
99: cali119e6efc6a3@if4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
[root@192-168-124-64 ~]#
网友评论