A perl module can to manipulate raw IP packets, with an optional feature for manipulating Ethernet headers.