Commit c9d2c65a authored by Kaarle Ritvanen's avatar Kaarle Ritvanen

make port-range work in NAT rules when ip-range not defined

parent 8b0b3709
......@@ -31,12 +31,15 @@ function NATRule:table() return 'nat' end
function NATRule:target()
if self.action then return end
local range = self['ip-range']
local target
if self['ip-range'] then
target =' --to-'..self.params.subject..' '..self['ip-range']
if range then
target =' --to-'..self.params.subject..' '..range
else target = self.params.deftarget end
if self['port-range'] then target = target..':'..self['port-range'] end
if self['port-range'] then
target = target..(range and ':' or ' --to-ports ')..self['port-range']
return target
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment