in reply to Figuring out which network interface a broadcast packet came in on?

I am not sure why you would need a DHCP server in perl? One easy way to determine the interface of an incoming packet is to use iptables with the LOG target. A rule similar to the following (untested) should log udp packets coming through eth0 to your /var/log/messages
iptables -I INPUT -p udp --dport 67 -i eth0 -j LOG \ --log-prefix \ "broadcast on eth0"
I do not know if what you want can be done using existing perl modules. Your problem requires querying kernel info, and am not sure if there are perl modules for that.
  • Comment on Re: Figuring out which network interface a broadcast packet came in on?
  • Download Code