sysctl net.ipv4.ip_forward # 0意味着未開啓
sysctl -w net.ipv4.ip_forward=1 echo net.ipv4.ip_forward=1 >> /usr/lib/sysctl.d/00-system.conf sysctl -p
bridge-netfilter 設置能夠使 iptables 規則能夠在 Linux Bridges 上面工做,就像 Docker 和 Kubernetes 設置的那樣。網絡
此設置對於 Linux 內核進行宿主機和容器之間進行數據包的地址轉換是必須的。負載均衡
[root@t91 home]# sysctl net.bridge.bridge-nf-call-iptables net.bridge.bridge-nf-call-iptables = 1 # 若是是0,則表示未開啓
modprobe br_netfilter sysctl -w net.bridge.bridge-nf-call-iptables=1 echo net.bridge.bridge-nf-call-iptables=1 >> /etc/sysconf.d/10-bridge-nf-call-iptables.conf sysctl -p
Kubernetes 提供了各類網絡插件來支持其集羣功能,同時也對傳統的基於 IP 和端口的應用程序提供了向後兼容的支持。工具
最多見的 一種 Kubernetes 網絡方案就是利用 VxLan Overlay 網絡,其中的 IP 數據包被封裝在 UDP 中經過8472端口進行數據傳輸。插件
$ ping 10.244.1.4 PING 10.244.1.4 (10.244.1.4): 56 data bytes ^C--- 10.244.1.4 ping statistics --- 5 packets transmitted, 0 packets received, 100% packet loss
# 在服務端執行 iperf -s -p 8472 -u # 在客戶端執行 iperf -c 172.28.128.103 -u -p 8472 -b 1K