Firewall using libpcap and libnet (perplexing problem)
Posted on 2003-03-17
I've got a rather perplexing problem. I want to create a firewall using libpcap (for sniffing) and libnet (for packet injection).
The idea is to have two NICs. To start, I just want to sniff the packets on one NIC and inject them onto the other (and vice-versa). This would create a basic bridge.
The problem comes due to this situation:
NIC A sniffs packet X
NIC B injects packet X
NIC B sniffs the same packet X that it just injected
NIC A injects packet X
I don't want to change anything about the packets (even MAC address), so I have no way of knowing if a packet is coming from me or not.
Any ideas?!? Is there a way to set pcap to filter packets that come from me?
Thanks in advance