@@ -78,8 +78,8 @@ func TestAddSNATRules(t *testing.T) {
7878 chain : SWIFTPOSTROUTING ,
7979 expected : []string {
8080 "-N SWIFT-POSTROUTING" ,
81- "-A SWIFT-POSTROUTING -m addrtype ! --dst-type local -s 240.1.2.0/24 -d " + networkutils .AzureDNS + " -p udp --dport " + strconv .Itoa (iptables .DNSPort ) + " -j SNAT --to 240.1.2.1 " ,
82- "-A SWIFT-POSTROUTING -m addrtype ! --dst-type local -s 240.1.2.0/24 -d " + networkutils .AzureDNS + " -p tcp --dport " + strconv .Itoa (iptables .DNSPort ) + " -j SNAT --to 240.1.2.1 " ,
81+ "-A SWIFT-POSTROUTING -m addrtype ! --dst-type local -s 240.1.2.0/24 -d " + networkutils .AzureDNS + " -p udp --dport " + strconv .Itoa (iptables .DNSPort ) + " -j SNAT --to 10.0.0.4 " ,
82+ "-A SWIFT-POSTROUTING -m addrtype ! --dst-type local -s 240.1.2.0/24 -d " + networkutils .AzureDNS + " -p tcp --dport " + strconv .Itoa (iptables .DNSPort ) + " -j SNAT --to 10.0.0.4 " ,
8383 "-A SWIFT-POSTROUTING -m addrtype ! --dst-type local -s 240.1.2.0/24 -d " + networkutils .AzureIMDS + " -p tcp --dport " + strconv .Itoa (iptables .HTTPPort ) + " -j SNAT --to 10.0.0.4" ,
8484 },
8585 },
@@ -148,8 +148,8 @@ func TestAddSNATRules(t *testing.T) {
148148 chain : SWIFTPOSTROUTING ,
149149 expected : []string {
150150 "-N SWIFT-POSTROUTING" ,
151- "-A SWIFT-POSTROUTING -m addrtype ! --dst-type local -s 240.1.2.0/24 -d " + networkutils .AzureDNS + " -p udp --dport " + strconv .Itoa (iptables .DNSPort ) + " -j SNAT --to 240.1.2.1 " ,
152- "-A SWIFT-POSTROUTING -m addrtype ! --dst-type local -s 240.1.2.0/24 -d " + networkutils .AzureDNS + " -p tcp --dport " + strconv .Itoa (iptables .DNSPort ) + " -j SNAT --to 240.1.2.1 " ,
151+ "-A SWIFT-POSTROUTING -m addrtype ! --dst-type local -s 240.1.2.0/24 -d " + networkutils .AzureDNS + " -p udp --dport " + strconv .Itoa (iptables .DNSPort ) + " -j SNAT --to 10.0.0.4 " ,
152+ "-A SWIFT-POSTROUTING -m addrtype ! --dst-type local -s 240.1.2.0/24 -d " + networkutils .AzureDNS + " -p tcp --dport " + strconv .Itoa (iptables .DNSPort ) + " -j SNAT --to 10.0.0.4 " ,
153153 "-A SWIFT-POSTROUTING -m addrtype ! --dst-type local -s 240.1.2.0/24 -d " + networkutils .AzureIMDS + " -p tcp --dport " + strconv .Itoa (iptables .HTTPPort ) + " -j SNAT --to 10.0.0.4" ,
154154 },
155155 },
@@ -209,15 +209,15 @@ func TestAddSNATRules(t *testing.T) {
209209 chain : SWIFTPOSTROUTING ,
210210 rule : []string {
211211 "-m" , "addrtype" , "!" , "--dst-type" , "local" , "-s" , "240.1.2.0/24" , "-d" , networkutils .AzureDNS ,
212- "-p" , "udp" , "--dport" , strconv .Itoa (iptables .DNSPort ), "-j" , "SNAT" , "--to" , "240.1.2.1 " ,
212+ "-p" , "udp" , "--dport" , strconv .Itoa (iptables .DNSPort ), "-j" , "SNAT" , "--to" , "10.0.0.4 " ,
213213 },
214214 },
215215 {
216216 table : iptables .Nat ,
217217 chain : SWIFTPOSTROUTING ,
218218 rule : []string {
219219 "-m" , "addrtype" , "!" , "--dst-type" , "local" , "-s" , "240.1.2.0/24" , "-d" , networkutils .AzureDNS ,
220- "-p" , "tcp" , "--dport" , strconv .Itoa (iptables .DNSPort ), "-j" , "SNAT" , "--to" , "240.1.2.1 " ,
220+ "-p" , "tcp" , "--dport" , strconv .Itoa (iptables .DNSPort ), "-j" , "SNAT" , "--to" , "10.0.0.4 " ,
221221 },
222222 },
223223 {
@@ -243,8 +243,8 @@ func TestAddSNATRules(t *testing.T) {
243243 chain : SWIFTPOSTROUTING ,
244244 expected : []string {
245245 "-N SWIFT-POSTROUTING" ,
246- "-A SWIFT-POSTROUTING -m addrtype ! --dst-type local -s 240.1.2.0/24 -d " + networkutils .AzureDNS + " -p udp --dport " + strconv .Itoa (iptables .DNSPort ) + " -j SNAT --to 240.1.2.1 " ,
247- "-A SWIFT-POSTROUTING -m addrtype ! --dst-type local -s 240.1.2.0/24 -d " + networkutils .AzureDNS + " -p tcp --dport " + strconv .Itoa (iptables .DNSPort ) + " -j SNAT --to 240.1.2.1 " ,
246+ "-A SWIFT-POSTROUTING -m addrtype ! --dst-type local -s 240.1.2.0/24 -d " + networkutils .AzureDNS + " -p udp --dport " + strconv .Itoa (iptables .DNSPort ) + " -j SNAT --to 10.0.0.4 " ,
247+ "-A SWIFT-POSTROUTING -m addrtype ! --dst-type local -s 240.1.2.0/24 -d " + networkutils .AzureDNS + " -p tcp --dport " + strconv .Itoa (iptables .DNSPort ) + " -j SNAT --to 10.0.0.4 " ,
248248 "-A SWIFT-POSTROUTING -m addrtype ! --dst-type local -s 240.1.2.0/24 -d " + networkutils .AzureIMDS + " -p tcp --dport " + strconv .Itoa (iptables .HTTPPort ) + " -j SNAT --to 10.0.0.4" ,
249249 },
250250 },
0 commit comments