@@ -152,7 +152,6 @@ func (invoker *CNSIPAMInvoker) Add(addConfig IPAMAddConfig) (IPAMAddResult, erro
152152}
153153
154154func setHostOptions (ncSubnetPrefix * net.IPNet , options map [string ]interface {}, info * IPv4ResultInfo ) error {
155-
156155 // get the host ip
157156 hostIP := net .ParseIP (info .hostPrimaryIP )
158157 if hostIP == nil {
@@ -173,7 +172,8 @@ func setHostOptions(ncSubnetPrefix *net.IPNet, options map[string]interface{}, i
173172 },
174173 }
175174
176- azureDNSMatch := fmt .Sprintf (" -m addrtype ! --dst-type local -s %s -d %s -p %s --dport %d" , ncSubnetPrefix .String (), networkutils .AzureDNS , iptables .UDP , iptables .DNSPort )
175+ azureDNSUDPMatch := fmt .Sprintf (" -m addrtype ! --dst-type local -s %s -d %s -p %s --dport %d" , ncSubnetPrefix .String (), networkutils .AzureDNS , iptables .UDP , iptables .DNSPort )
176+ azureDNSTCPMatch := fmt .Sprintf (" -m addrtype ! --dst-type local -s %s -d %s -p %s --dport %d" , ncSubnetPrefix .String (), networkutils .AzureDNS , iptables .TCP , iptables .DNSPort )
177177 azureIMDSMatch := fmt .Sprintf (" -m addrtype ! --dst-type local -s %s -d %s -p %s --dport %d" , ncSubnetPrefix .String (), networkutils .AzureIMDS , iptables .TCP , iptables .HTTPPort )
178178
179179 snatPrimaryIPJump := fmt .Sprintf ("%s --to %s" , iptables .Snat , info .ncPrimaryIP )
@@ -182,8 +182,9 @@ func setHostOptions(ncSubnetPrefix *net.IPNet, options map[string]interface{}, i
182182 options [network .IPTablesKey ] = []iptables.IPTableEntry {
183183 iptables .GetCreateChainCmd (iptables .V4 , iptables .Nat , iptables .Swift ),
184184 iptables .GetAppendIptableRuleCmd (iptables .V4 , iptables .Nat , iptables .Postrouting , "" , iptables .Swift ),
185- // add a snat rule to primary NC IP for DNS
186- iptables .GetInsertIptableRuleCmd (iptables .V4 , iptables .Nat , iptables .Swift , azureDNSMatch , snatPrimaryIPJump ),
185+ // add a snat rules to primary NC IP for DNS
186+ iptables .GetInsertIptableRuleCmd (iptables .V4 , iptables .Nat , iptables .Swift , azureDNSUDPMatch , snatPrimaryIPJump ),
187+ iptables .GetInsertIptableRuleCmd (iptables .V4 , iptables .Nat , iptables .Swift , azureDNSTCPMatch , snatPrimaryIPJump ),
187188 // add a snat rule to node IP for IMDS http traffic
188189 iptables .GetInsertIptableRuleCmd (iptables .V4 , iptables .Nat , iptables .Swift , azureIMDSMatch , snatHostIPJump ),
189190 }
0 commit comments