1# test divert-to with icmp 2# create a divert-to in rule on the remote machine 3# client sends a ICMP echo packet from the local machine 4# server receives the ICMP echo packet at the remote machine 5 6use strict; 7use warnings; 8use Socket; 9 10our %args = ( 11 socktype => Socket::SOCK_RAW, 12 protocol => sub { shift->{af} eq "inet" ? "icmp" : "icmp6" }, 13 client => { func => \&write_icmp_echo, out => "ICMP6?", noin => 1, }, 14 server => { func => \&read_icmp_echo, in => "ICMP6?", noout => 1, }, 15 divert => "to", 16); 17