#!/usr/bin/perl -w use strict; use warnings; use Net::RawIP; my $Raw = Net::RawIP->new(); $Raw->ethnew( "eth0", # source => "AA:BB:CC:DD:EE:FF", dest => "08:00:20:C0:FF:EE" ); my $Frame = pack("C30", 0x80, 0x35, # eth type (0x8035 = rarp) 0x00, 0x01, # arp hw type (0x0001 = eth) 0x08, 0x00, # arp proto type (0x0800 = ip) 0x06, # arp hw size 0x04, # arp proto size 0x00, 0x04, # arp opcode (0x0004 = reverse response) 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, # sender hw address 192, 168, 23, 23, # sender ip address 0x08, 0x00, 0x20, 0xC0, 0xFF, 0xEE, # dest hw address 192, 168, 23, 42 # dest proto address ); $Raw->send_eth_frame($Frame, 1, 10);