in reply to Re^3: Net::RawIP question
in thread Net::RawIP question

thanks for information, this debug helps but i always get error at: Net::RawIP->ethnew failed
#!/usr/bin/perl use Net::RawIP; $n = Net::RawIP->new({ ip => { saddr => '192.168.1.1', daddr => '192.168.1.2', }, tcp => { source => 139, dest => 139, psh => 1, syn => 1, }, }); $n->send; $n->ethnew("eth0") or die "Net::RawIP->ethnew failed"; # error here $n->ethset(source => 'my.target.lan', dest =>'my.target.lan'); $n->ethsend;

Replies are listed 'Best First'.
Re^5: Net::RawIP question
by anonymized user 468275 (Curate) on Aug 16, 2018 at 19:18 UTC
    I understand your frustration and I am thankful I didn't write this module, "there but for the grace of god go I", but you have to repeat the parameter
    ip => { saddr => '192.168.1.1', daddr => '192.168.1.2', }
    yet again for the ethset call as counter-intuitive as it might be.

    One world, one people

      I did not understand what you mean, it's hard for me to understand this lanuguage please speak simple english. if you can give example this will be helpful. thanks for helping.
        According to my understanding of the docs, you have to add a parameter to this:
        $n->ethset(source => 'my.target.lan', dest =>'my.target.lan');
        so that it has also
        $n->ethset(source => 'my.target.lan', dest =>'my.target.lan', ip => hash);
        where ip => hash is exactly what you put for the call to Net::RawIP->new;

        One world, one people