All of lore.kernel.org
 help / color / mirror / Atom feed
* [LARTC] negate ip addresses
@ 2003-06-04  8:09 Lars Täuber
  2003-06-04 13:05 ` Martin A. Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Lars Täuber @ 2003-06-04  8:09 UTC (permalink / raw)
  To: lartc

Hi,

is it possible to make rules or routes with negated ip addresses like that:

ip rule add from ! 192.168.0.0/16 table xyz
?

Or is this planned for the future?

Thanks

Regards
Lars Täuber

_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [LARTC] negate ip addresses
  2003-06-04  8:09 [LARTC] negate ip addresses Lars Täuber
@ 2003-06-04 13:05 ` Martin A. Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Martin A. Brown @ 2003-06-04 13:05 UTC (permalink / raw)
  To: lartc

Lars,

 : is it possible to make rules or routes with negated ip addresses like
 : that:

You can simulate this with the following technique:

# ip rule add table xyz
# ip route add $ALLOWED_DESTINATION table xyz
# ip route add throw default

Strictly speaking, this might require a bit more gyration to accomplish
your desired syntax, while still allowing you to reach your goal.

The "throw" route type allows you to create sets of tables which can be
used to "negate".

  http://linux-ip.net/html/routing-rpdb.html
  http://linux-ip.net/html/routing-tables.html#routing-table-entries

 : ip rule add from ! 192.168.0.0/16 table xyz

The closest suggestion I can make to your desired syntax would be to use
two routing tables.

# ip rule add from 192.168.0.0/16 table notxyz
# ip rule add blackhole from 192.168.0.0/16
# ip rule add table xyz

The first two rules would take care of all packets bound from
192.168.0.0/16, and the last rule would effectively handle any packets
which were from ! 192.168.0.0/16.

These would need to be higher priority (lower number) in the RPDB in order
for this to function properly.

 : Or is this planned for the future?

I have no idea.  I'd bet the answer is "no", but you could probably get it
straight from the linux-net horse's mouth if you asked.

-Martin

-- 
Martin A. Brown --- SecurePipe, Inc. --- mabrown@securepipe.com

_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-06-04 13:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-04  8:09 [LARTC] negate ip addresses Lars Täuber
2003-06-04 13:05 ` Martin A. Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.