diff --git a/cni/network/invoker_cns.go b/cni/network/invoker_cns.go index 33ce14bcb4..524ab3041c 100644 --- a/cni/network/invoker_cns.go +++ b/cni/network/invoker_cns.go @@ -150,9 +150,14 @@ func setHostOptions(nwCfg *cni.NetworkConfig, hostSubnetPrefix *net.IPNet, ncSub } azureDNSMatch := fmt.Sprintf(" -m addrtype ! --dst-type local -s %s -d %s -p %s --dport %d", ncSubnetPrefix.String(), iptables.AzureDNS, iptables.UDP, iptables.DNSPort) + + // TODO remove this rule once we remove adding MASQUEARDE from AgentBaker, check below PR + // https://github.com/Azure/AgentBaker/pull/367/files + podTrafficAccept := fmt.Sprintf(" -m iprange ! --dst-range 168.63.129.16-168.63.129.16 -s %s ", ncSubnetPrefix.String()) snatPrimaryIPJump := fmt.Sprintf("%s --to %s", iptables.Snat, info.ncPrimaryIP) options[network.IPTablesKey] = []iptables.IPTableEntry{ iptables.GetCreateChainCmd(iptables.V4, iptables.Nat, iptables.Swift), + iptables.GetInsertIptableRuleCmd(iptables.V4, iptables.Nat, iptables.Postrouting, podTrafficAccept, iptables.Accept), iptables.GetAppendIptableRuleCmd(iptables.V4, iptables.Nat, iptables.Postrouting, "", iptables.Swift), iptables.GetInsertIptableRuleCmd(iptables.V4, iptables.Nat, iptables.Swift, azureDNSMatch, snatPrimaryIPJump), }