On 06/20/2013 03:00 AM, Niall O Broin wrote:
> Instead of having multiple rules like this
> 
> 
> DNAT      net        loc:192.168.1.32     tcp         22          -           
>    12.34.111.32
> DNAT      net        loc:192.168.1.33     tcp         22          -           
>    12.34.111.33
> DNAT      net        loc:192.168.1.34     tcp         22          -           
>    12.34.111.34
> DNAT      net        loc:192.168.1.35     tcp         22          -           
>    12.34.111.35
> DNAT      net        loc:192.168.1.36     tcp         22          -           
>    12.34.111.36
> 
> I wonder is it possible to use Perl / sed style backreferences, so you'd have 
> a rule like
> 
> DNAT      net        loc:192.168.1.(.+)     tcp         22          -         
>      12.34.111.$1
> 
> 
> Apologies if this is in the manual, but I have looked and didn't find. Maybe 
> this is somehow doable with ipsets, but it's not clear to me how it would be.
> 

No.

But you can:

?BEGIN PERL
for ( 32..36 ) {
    shorewall "DNAT net loc:192.168.1.$_ tcp 22 - 12.34.11.$_"
}
1;
?END PERL

-Tom
-- 
Tom Eastep        \ When I die, I want to go like my Grandfather who
Shoreline,         \ died peacefully in his sleep. Not screaming like
Washington, USA     \ all of the passengers in his car
http://shorewall.net \________________________________________________

Attachment: signature.asc
Description: OpenPGP digital signature

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Shorewall-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/shorewall-users

Reply via email to