iptables multi destination address

This is a discussion on iptables multi destination address within the Linux Security forums, part of the System Security and Security Related category; hi i d like to write a command line with more than one destination address the original one: iptables -t ...


Go Back   Usenet Forums > System Security and Security Related > Linux Security

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 09-08-2004
cdt_sylvestre
 
Posts: n/a
Default iptables multi destination address

hi
i d like to write a command line with more than one destination address

the original one:
iptables -t nat -A POSTROUTING -s 192.168.0.0/16 -d ! 192.168.10.0/16 -j
MASQUERADE


the one i want (that doesnt work):
iptables -t nat -A POSTROUTING -s 192.168.0.0/16 -d !
192.168.10.0/16,10.1.1.0/24 -j MASQUERADE

thx


Reply With Quote
  #2 (permalink)  
Old 09-08-2004
P Gentry
 
Posts: n/a
Default Re: iptables multi destination address

"cdt_sylvestre" <cdtEffacercAsly@relayeur.com> wrote in message news:<413ed5ce$0$21755$626a14ce@news.free.fr>...
> hi
> i d like to write a command line with more than one destination address
>
> the original one:
> iptables -t nat -A POSTROUTING -s 192.168.0.0/16 -d ! 192.168.10.0/16 -j
> MASQUERADE


Typo somewhere?: 192.168.10.0/16 or 192.168.0.0/16 or 192.168.10.0/24
? As stated your dest is included in src. Src includes all
192.168.x.x range. The prefixes don't make sense to me.

Not sure what you're trying to do here as these source packets will
not be _routed_ to the source net at all if they are already on the
same subnet. The downstream (lan) hub, switch, cable will send the
ethernet frames to their destination and _not_ the lan interface of
this machine. If that's what's happening, you have a misconfigured
route table/default route on the lan boxes.

> the one i want (that doesnt work):
> iptables -t nat -A POSTROUTING -s 192.168.0.0/16 -d !
> 192.168.10.0/16,10.1.1.0/24 -j MASQUERADE


Since there is no need to include the 192.168.10.0/16 subnet all you
need is 10.1.1.0/24 -j MASQUERADE above. If you _did_ need two
destinations, you would also have two different sources (and entries).
EG.,

iptables -t nat -A POSTROUTING -s 10.1.1.0/24
-d ! 192.168.0.0/16 -j MASQUERADE

> thx


BTW, you can't include two subnets in the manner you suggested, afaik.
You _might_ get by with a larger prefix. EG.,

192.168.10.0/24 and 192.168.20.0/24 would both be included in
!192.168.0.0/16

hth,
prg
email above disabled
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 12:25 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0