File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -279,10 +279,6 @@ def verify(config):
279279 f'{ error_msg } external address/port is already in use!'
280280 )
281281 addresses_with_ports .add (pair )
282- if ext_address not in addresses_translation :
283- raise ConfigError (
284- f'{ error_msg } external address { ext_address } is not in "address-pool translation"'
285- )
286282
287283 else :
288284 if ext_address in addresses_without_ports or any (
@@ -300,6 +296,13 @@ def verify(config):
300296 local_addresses .add (local_address )
301297
302298 options = rule_config .get ('options' , {})
299+
300+ if 'self_twice_nat' in options and ext_address not in addresses_translation :
301+ raise ConfigError (
302+ f'{ error_msg } external address { ext_address } must be part of '
303+ '"address-pool translation" when using self-twice-nat'
304+ )
305+
303306 if all (key in options for key in ('twice_nat' , 'self_twice_nat' )):
304307 raise ConfigError (
305308 f'{ error_msg } cannot set both options "twice-nat" and "self-twice-nat"'
You can’t perform that action at this time.
0 commit comments