Re: Interface/packet mirroring

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



FoObArf00@netscape.net wrote:
I am trying to mirror the packets that get forwarded from one interface to the another.  One is an eql interface and the other is an ethernet card with a bigger pipe.  The ethernet card is the primary link and I dont even want to touch those packets.  I just want to mirror the packets to the eql interface as many as it can handle and I dont care if packets get lost on the eql interface.  I tried the following on ip_forward_finish() in ip_forward.c (2.4.27), but nothing gets sent on the eql interface.  Can someone point me in the right direction.  Thanks in advanced.
        {
                struct net_device *altdev = dev_get_by_name("eql");
                struct sk_buff *new_skb;
                if(altdev != NULL) {
                        new_skb = skb_copy(skb,GFP_ATOMIC);
                        if(new_skb != NULL) {
                                ((struct rtable*)new_skb->dst)->u.dst.dev = altdev;
                                ip_forward_options(new_skb);
                                ip_send(new_skb);
                                kfree_skb(new_skb);
                        }
                }
        }
        ip_forward_options(skb);
        return (ip_send(skb));

<snip>


why don't you just use iptables to add a MIRROR target on the INPUT chain for all packets arriving on the eql interface?


HTH
Neil

--
/***************************************************
 *Neil Horman
 *Software Engineer
 *Red Hat, Inc.
 *nhorman@redhat.com
 *gpg keyid: 1024D / 0x92A74FA1
 *http://pgp.mit.edu
 ***************************************************/
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux