I believe your issue is Net::Write::Layer3 while trying to pass an Ethernet header. Try using Net::Write::Layer2 for your $oWrite object.

The frame you're creating ($eth, $ip4, $tcp) works fine for me using Perl Packet Crafter (see Re: Net::RawIP for IPv6) on Windows 7 x64 with Strawberry 5.22.1 x64. On Windows, the Net::Write packages won't install which is why I rolled my own in the form of PPC.

UPDATE:

VinsWorldcom@C:\Users\VinsWorldcom> ppc -i wlan0 Welcome to Perl Packet Crafter (PPC) Version: 1.11 wlan0 ppc> $src = '1.1.1.39'; ppc> $target = '1.1.1.99'; ppc> $port = 22; ppc> $eth = Net::Frame::Layer::ETH->new(src => "00:0c:29:d1:03:06", ds +t => "03:03:03:03:03:03"); ppc> $ip4 = Net::Frame::Layer::IPv4->new(src => $src,dst => $target); ppc> $tcp = Net::Frame::Layer::TCP->new(dst => $port, options => "\x02 +\x04\x54\x0b",payload => 'test'); ppc> $oSimple = packet $eth,$ip4,$tcp; ppc> hexdump $oSimple; 0x00000: 03 03 03 03 03 03 00 0c 29 d1 03 06 08 00 45 00 ........).. +...E. 0x00010: 00 30 b5 65 00 00 80 06 80 d7 01 01 01 27 01 01 .0.e....... +..'.. 0x00020: 01 63 e8 9c 00 16 13 b4 a0 f0 00 00 00 00 60 02 .c......... +...`. 0x00030: ff ff c0 0e 00 00 02 04 54 0b 74 65 73 74 ........T.t +est ppc> print $oSimple->print; ETH: dst:03:03:03:03:03:03 src:00:0c:29:d1:03:06 type:0x0800 IPv4: version:4 hlen:5 tos:0x00 length:48 id:46437 IPv4: flags:0x00 offset:0 ttl:128 protocol:0x06 checksum:0x80d7 IPv4: src:1.1.1.39 dst:1.1.1.99 TCP: src:59548 dst:22 seq:0x13b4a0f0 ack:0x0000 TCP: off:0x06 x2:0x0 flags:0x02 win:65535 checksum:0xc00e urp:0x0 +0 TCP: optionsLength:4 options:0204540b TCP: payload:74657374 ppc> sendp $oSimple; . Sent 1 packet ppc>

In reply to Re^5: Setting MAC addresses with Net::Frame::Simple by VinsWorldcom
in thread Setting MAC addresses with Net::Frame::Simple by iThunder

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.