@@ -78,8 +78,8 @@ func TestAddSNATRules(t *testing.T) {
78
78
chain : SWIFTPOSTROUTING ,
79
79
expected : []string {
80
80
"-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 " ,
83
83
"-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" ,
84
84
},
85
85
},
@@ -148,8 +148,8 @@ func TestAddSNATRules(t *testing.T) {
148
148
chain : SWIFTPOSTROUTING ,
149
149
expected : []string {
150
150
"-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 " ,
153
153
"-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" ,
154
154
},
155
155
},
@@ -209,15 +209,15 @@ func TestAddSNATRules(t *testing.T) {
209
209
chain : SWIFTPOSTROUTING ,
210
210
rule : []string {
211
211
"-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 " ,
213
213
},
214
214
},
215
215
{
216
216
table : iptables .Nat ,
217
217
chain : SWIFTPOSTROUTING ,
218
218
rule : []string {
219
219
"-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 " ,
221
221
},
222
222
},
223
223
{
@@ -243,8 +243,8 @@ func TestAddSNATRules(t *testing.T) {
243
243
chain : SWIFTPOSTROUTING ,
244
244
expected : []string {
245
245
"-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 " ,
248
248
"-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" ,
249
249
},
250
250
},
0 commit comments