Hi Harald,
       Thank you for your response! According to manual page of
       I have tried:
       ip :: Strip(14)  -> IPPrint -> ipc :: IPClassifier(10.0.0.1/24, -);
       ipc[0] -> sia :: SetIPAddress(10.0.0.1) -> rtsrc :: DirectIPLookup(
                10.0.0.1/24    10.0.2.2    0,
                0.0.0.0/0.0.0.0    0
        );
 
        But click core dump after several seconds it started.



Yours
Chuan



[email protected] wrote:
>    2. Re: Help, how to route according to source IP address of an
>       IP packet (Harald Schioeberg)
> Message: 2
> Date: Thu, 17 Mar 2011 10:20:49 +0100
> From: Harald Schioeberg <[email protected]>
> Subject: Re: [Click] Help, how to route according to source IP address
>       of an IP packet
> To: [email protected]
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset=ISO-8859-1
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
>
>
> On 03/12/2011 03:55 PM, wubaochuan wrote:
>   
>> hi everyone,
>>         The IPv4 Routing elements can route IP packets according to the 
>> destination address of IP packets, 
>>     
>
> looking at iproutetable.cc:153:
>     int port = lookup_route(p->dst_ip_anno(), gw);
>
> it looks like the route-tables actually use the destination annotation...
>
>
> How to route IP packets according to
>   
>> source address of IP packets? 
>>     
>
> and you can set the DstAnno using GetIPAddress, to grab the source IP
> you would use offset 12,...
>
> that means
>       GetIPAddress(12)->SomeIPRoutetable(...)
>
> should do the trick.
>
>   
>> I want to forward all IP packets from
>> 10.2.2.0/24 to a machine.
>>     
>
> well, this simple case can be done just using a classifier, like:
>
> Classifier(12/0a020200%ffffff00, - )
>
> I tried none of these, but maybe they set you on the right track.
>
>       Harald
>
>
>   
>>        Thank you.
>> Yours
>> Chuan
>> _______________________________________________
>> click mailing list
>> [email protected]
>> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
>>     
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAk2B0m4ACgkQy8wrZ9OvkU1+dwCeMe9zNrZpWnilblFWcC0W2Q88
> tzwAoIyBmJ9sBTSahgDdag2tejo0IJfM
> =lQAE
> -----END PGP SIGNATURE-----
>
>   

_______________________________________________
click mailing list
[email protected]
https://amsterdam.lcs.mit.edu/mailman/listinfo/click

Reply via email to