Using Perl's Net::Frame::Simple module to rewrite ethernet header
<p>I am using below code (copied from <a href="http://search.cpan.org/~gomor/Net-Frame-Simple-1.06/lib/Net/Frame/Simple.pm" rel="nofollow noreferrer">http://search.cpan.org/~gomor/Net-Frame-Simple-1.06/lib/Net/Frame/Simple.pm</a>) to rewrite the ethernet src and dst mac information but its generating bad IP packet.</p>

<pre><code>#!/usr/bin/perl

use Net::Frame::Simple;
use Net::Frame::Layer::IPv4;
use Net::Frame::Layer::TCP;
use Net::Frame::Layer::ETH;
use Net::Frame::Device;
use Net::Write::Layer3;
use Net::Frame::Dump::Online;
use Net::Write::Layer2;


my $src    = '100.1.1.39';
my $target = '200.2.2.97';
my $port   = 22;


my $eth = Net::Frame::Layer::ETH-&gt;new(src =&gt; "00:0c:29:d1:03:06", dst =&gt; "03:03:03:03:03:03");
my $ip4 = Net::Frame::Layer::IPv4-&gt;new(src =&gt; $src,dst =&gt; $target);
my $tcp = Net::Frame::Layer::TCP-&gt;new(dst =&gt; $port, options =&gt; "\x02\x04\x54\x0b",payload =&gt; 'test');

my $oSimple = Net::Frame::Simple-&gt;new(layers =&gt; [$eth,$ip4,$tcp],);

# Now, the frame is ready to be send to the network
# We open a sender object, and a retriever object

my $oWrite = Net::Write::Layer2-&gt;new(dev =&gt; 'eth0');
   $oWrite = Net::Write::Layer3-&gt;new(dst =&gt; $target);
   #my $oDump  = Net::Frame::Dump::Online-&gt;new(dev =&gt; $oDevice-&gt;dev);
   #$oDump-&gt;start;
   $oWrite-&gt;open;

   # We send the frame
   $oSimple-&gt;send($oWrite);
</code></pre>

<p>If i remove the ethernet part ($eth) when defining layers in $oSimple, it works.
Any suggestions what i am missing or doing wrong? </p>