[Click] help:question about ToDevice()
Beyers Cronje
bcronje at gmail.com
Fri Nov 10 08:19:01 EST 2006
Hi,
Change your config to:
-> spoofer::MACIPSpoofer(11:22:33
>
> :44:55:66, me0) //src only
> -> Print(*spoofing----,NBYTES 200)
-> Queue
-> ToDevice(eth0);
On 11/10/06, 静 李 <lastlijing at yahoo.com.cn> wrote:
>
> The question is in the "maillistletter.txt".
>
> Because my computer cannot copy the letter here,
> so I have to add it in the append . :)
>
> waiting .
>
>
>
>
>
>
> ___________________________________________________________
> Mp3疯狂搜-新歌热歌高速下
> http://music.yahoo.com.cn/?source=mail_mailbox_footer
>
> letter to mail list
>
> Hi :
>
> I have made a element :MACIPSpoofer(my_eth0,my_ip) by myself.
> It changes the input packets src_mac ,and src_ip to
> my_eth0,my_ip respectivly.
>
> the test configuration and the run result are:
>
> congfiguration-1:
>
> AddressInfo(me0 10.0.0.1);
> spew :: RatedSource(ACTIVE true, RATE 2, DATA
> 'test-test-test')
> -> IPEncap(200, 10.0.0.3,255.255.255.255)
> ->EtherEncap(0x0800, 12:34:56:78:9a:bc, ff:ff:ff:ff:ff:ff)
> -> Print(*setupself,NBYTES 200)
> -> spoofer::MACIPSpoofer(11:22:33:44:55:66, me0) //src only
> -> Print(*spoofing----,NBYTES 200)
> -> ToDevice(eth0);
>
> result:
> *setupself: 55 | ffffffff ffff1234 56789abc 0800
> 4500 00290000 0000fac8 b60a0a00 0003ffff ffff
> 7465 73742d74 6573742d 74657374 0a202020 202020
> *spoofing----: 55 | ffffffff ffff1122 33445566 0800
> 4500 00290000 0000fac8 b60a0a00 0001ffff ffff
> 7465 73742d74 6573742d 74657374 0a202020 202020
>
> it really works ,change src_mac: 123456789abc -> 112233445566
> ip_src : 10.0.0.3 -> 10.0.0.1
>
>
> But, when I want to use MACIPSpoofer() to the real net packets ,it
> doesnot work.
>
> configuration-2:
>
> in1 :: FromDevice(eth0, PROMISC 0);
> ip_class :: Classifier(12/0800, -); // ip pkts
> in1 -> ip_class;
>
> ip_class[1] -> Discard;
>
> ip_class[0]
> -> spoofer::MACIPSpoofer(11:22:33:44:55:66, me0) //src only
> -> Print(*spoofing----,NBYTES 200)
> -> ToDevice(eth0);
>
> It reads packets from eth0 ,picks out IP-packets ,and spoofs mac and ip
> last send it out to eth0 .
>
> But when I run the configuration ,it does NOT work:
> # ./click ../conf/local/sendtest.click
> #'spoofer :: MACIPSpoofer' push output 0 connected to 'Print at 6 :: Print'
> pull input 0
> Router could not be initialized!
>
> an other kind of error message:
> #agnostic 'spoofer :: MACIPSpoofer' in mixed context: push input 0, pull
> output 0
> Router could not be initialized!
>
>
> if I change "ToDevice(eth0) " to "Discard", then it works correctly as
> before.
> I have no idea why this happens. Why I can't use "ToDevice(eth0)" as
> in "Configuration-1" ??
>
>
> Thanks in advance.
>
>
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
>
>
>
More information about the click
mailing list