[Click] Simple IP Map

Harald Schiöberg harald at net.t-labs.tu-berlin.de
Tue Oct 6 03:21:42 EDT 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Riyaz wrote:
> Hi guys,
> 
>     Does anyone know of a simple IP-to-IP Mapping element that also has a write handler to allow changes during runtime?
> 
>     Basically what I want to do is re-write the destination IP Address based on a simple mapping in a table (similar to NAT but just IP to IP).
> 
> For example,
> 
> Table:
> 
> 10.1.1.1    123.123.123.123
> 10.1.1.2    254.254.254.254


RadixIPLookup(
	10.1.1.1/32 123.123.123.123 0,
	10.1.1.2/32 254.254.254.254 0
	)
	->
	StoreIPAddr(dst)

should do the trick

(IPRouteTable elements set the dst_anno to the nexthop, StoreIPAddr puts
it in the packet)

check the docs of StoreIPAddr for checksum recalculations....

	harald



> 
> For a packet arriving destined for 10.1.1.1, rewrite the destination to 123.123.123.123.
> 
> I dont have much experience writing C++ code nor the confidence trying to write a new element, so any help would be greatly appreciated. I am considering forwarding these packets out a tap device and allowing a user-level java program to do the mapping, but this might greatly affect performance.
> 
> Kind regards,
> 
> Riyaz
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click


- --
Harald Schiöberg
Technische Universität Berlin | T-Laboratories | FG INET
www: http://www.net.t-labs.tu-berlin.de
Phone: +49-(0)30-8353-58476 | Fax: +49-(0)391 534 783 47
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFKyvAFy8wrZ9OvkU0RAutIAKDztMrWIaC9C8IjgZ4UH15PsE8eMQCeIhkM
vi9iKuN+M77zHu65EuIa16k=
=KYaQ
-----END PGP SIGNATURE-----



More information about the click mailing list