首页
学习
活动
专区
圈层
工具
发布
社区首页 >专栏 >calico | ipip 宿主机网卡抓包|容器IP

calico | ipip 宿主机网卡抓包|容器IP

作者头像
heidsoft
发布2022-06-09 18:10:47
发布2022-06-09 18:10:47
1.1K0
举报

Why does my container have a route to 169.254.1.1?

In a Calico network, each host acts as a gateway router for the workloads that it hosts. In container deployments, Calico uses 169.254.1.1 as the address for the Calico router. By using a link-local address, Calico saves precious IP addresses and avoids burdening the user with configuring a suitable address.

While the routing table may look a little odd to someone who is used to configuring LAN networking, using explicit routes rather than subnet-local gateways is fairly common in WAN networking.

How do I view Calico CNI logs?

The Calico CNI plugin emits logs to stderr, which are then logged out by the kubelet. Where these logs end up depend on how your kubelet is configured. For deployments using systemd, you can do this via journalctl.

The log level can be configured via the CNI network configuration file, by changing the value of the key log_level. See Configuring the Calico CNI plugins for more information.

Why can’t I see the 169.254.1.1 address mentioned above on my host?

Calico tries hard to avoid interfering with any other configuration on the host. Rather than adding the gateway address to the host side of each workload interface, Calico sets the proxy_arp flag on the interface. This makes the host behave like a gateway, responding to ARPs for 169.254.1.1 without having to actually allocate the IP address to the interface.

Why do all cali* interfaces have the MAC address ee:ee:ee:ee:ee:ee?

In some setups the kernel is unable to generate a persistent MAC address and so Calico assigns a MAC address itself. Since Calico uses point-to-point routed interfaces, traffic does not reach the data link layer so the MAC Address is never used and can therefore be the same for all the cali* interfaces.

Can I prevent my Kubernetes pods from initiating outgoing connections?

Yes! The Kubernetes NetworkPolicy API added support for egress policies in v1.8. You can also use calicoctl to configure egress policy to prevent Kubernetes pods from initiating outgoing connections based on the full set of supported Calico policy primitives including labels, Kubernetes namespaces, CIDRs, and ports.

I’ve heard Calico uses proxy ARP, doesn’t proxy ARP cause a lot of problems?

It can, but not in the way that Calico uses it.

In container deployments, Calico only uses proxy ARP for resolving the 169.254.1.1 address. The routing table inside the container ensures that all traffic goes via the 169.254.1.1 gateway so that is the only IP that will be ARPed by the container.

https://projectcalico.docs.tigera.io/reference/faq#how-do-i-get-network-traffic-into-and-out-of-my-calico-cluster

https://www.sobyte.net/post/2022-03/how-the-kubernetes-network-plugin-works/

https://www.securityandit.com/network/kubernetes-network-cluster-architecture/

https://itnext.io/kubernetes-network-deep-dive-7492341e0ab5

https://blog.csdn.net/qq_38473097/article/details/106790303

https://danielmiessler.com/study/tcpdump/#host

https://projectcalico.docs.tigera.io/reference/faq#how-do-i-get-network-traffic-into-and-out-of-my-calico-cluster

https://www.itsupportwale.com/blog/tcpdump-examples/

https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_and_managing_networking/configuring-ip-tunnels_configuring-and-managing-networking

http://cs.uccs.edu/~scold/iptunnel.htm

https://serverfault.com/questions/1094896/route-traffic-through-ipip-tunnels

https://github.com/apprenda/kismatic/blob/master/docs/troubleshooting-calico.md

https://www.cnblogs.com/orchidzjl/p/14908131.html

本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2022-04-26,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 云数智圈 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • Why does my container have a route to 169.254.1.1?
  • How do I view Calico CNI logs?
  • Why can’t I see the 169.254.1.1 address mentioned above on my host?
  • Why do all cali* interfaces have the MAC address ee:ee:ee:ee:ee:ee?
  • Can I prevent my Kubernetes pods from initiating outgoing connections?
  • I’ve heard Calico uses proxy ARP, doesn’t proxy ARP cause a lot of problems?
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档