Linux Routers working
cranium2003 at yahoo.com
Fri May 13 08:09:39 CEST 2005
--- Jonas Berlin <xkr47 at outerspace.dyndns.org> wrote:
> Quoting cranium2003 on 2005-05-13 04:15 UTC:
> > Is there any way on linux routers to know
> > which interface packet is forwarded before
> > packet trasmission begins?
> In the FORWARD table you know both the incoming and
> outgoing interface:
> This will match packets coming in from eth0 and
> going out on eth1:
> iptables -A FORWARD -i eth0 -o eth1 ...
Can i get that information thru' C program
user/kernel mode netfilter program? Because you have
given the rule to forward packet but what if Router
have 3 or 4 NIC network interfaces? I want to print
somrthing like LOG that prints that packet has srcip
and dstip and is going through eth0/eth1/eth2/eth3.
> > Also before packet
> > processed by IP layer can it be possible to know
> > which adjecent Router'IP packet came to that
> No, but the MAC address is available. You just have
> to find out what the
> mac address of the router in question and do:
> iptables -A INPUT -m mac --mac-source
> 01:23:45:67:89:AB ...
No suppose i have no info about adjecent
routers mac addresses and when packet came at
destination Router at Link layer/IP layer can i
determine from which router the packet came to
Get on-the-go sports scores, stock quotes, news and more. Check it out!
More information about the netfilter-devel