2026-04-24 | linux · networking | #netns #network-namespace #struct-net #container-networking #veth #nsproxy #pernet-operations #isolation #bpftrace
容器网络的一切隔离能力,都建立在网络命名空间之上。本文从 Linux 6.6 内核源码拆解 struct net 的完整布局、possible_net_t 与 RCU 访问模式、pernet_operations 子系统注册与生命周期回调、copy_net_ns() 命名空间创建路径、per-netns 路由表/netfilter/socket 隔离机制,以及 veth pair 跨命名空间数据转发的 skb->dev 切换原理。
2026-04-01 | linux · containers | #namespace #network #veth #bridge #iptables #nat #netns #docker0 #clone #container #linux-kernel
上一篇我们用 clone() 隔离了 PID、主机名和挂载点,但那个'容器'连 lo 都 ping 不通。本文从 CLONE_NEWNET 出发,用 veth pair + bridge + iptables MASQUERADE,一步步给容器接上网。
2026-04-03 | kubernetes · networking | #kubernetes #network-model #Pod #pause-container #CNI #netns #containerd
K8s 网络三条铁律、pause 容器的真实作用、Pod 网络命名空间的创建全过程