Re: reply target
Bart De Schuymer <[email protected]>
| Newsgroups | gmane.linux.network.bridge.ebtables.devel |
|---|---|
| Message-ID | <[email protected]> |
On Thursday 07 August 2003 22:08, Grzegorz Borowiak wrote: > And now, for something completely different... > It's... > > Patches for reply target for both kernel and userspace utility. > This target allows instant reply for ARP requests, with arbitrary MAC > addresss. You write: > > ebtables -t nat -A PREROUTING -p ARP --arp-ip-dst 192.168.1.2 \ > -j reply --reply-mac 00:47:72:7a:65:73 > > and since now any ARP request "who-has 192.168.1.2" is replied > with an ARP-reply frame "192.168.1.2 is-at 00:47:72:7a:65:73". Cool. Now I can see why this doesn't belong in arptables. > The target returns EBT_DROP if this was an ARP-request frame or > EBT_CONTINUE otherwise (i.e. if it was not an ARP-request frame, or if it > was not even an ARP frame). I think it should be forced upon the user to specify -p arp --arp-opcode request. Then you don't have to check on this in ebt_target_reply (faster, no need for EBT_CONTINUE). Have a look at the check function of kernel files ebt_ip.c or ebt_arp.c, they do similar things. There's probably no use in allowing the user to choose between EBT_DROP, EBT_CONTINUE and EBT_ACCEPT (like --snat-target)? Perhaps add it anyway and make the default EBT_DROP... > Target should be placed in nat table of PREROUTING chain or in broute > table of BROUTE chain. Sounds right. > I have alpha-tested it. It's nice. Works for me. > This target is useful for emulating non-existent hosts (along with > redirect and snat targets) or for ARP-proxying, for example in VPNs. If others want to test this, results are welcomed. The userspace print function should use ebtables' print_mac function instead of ether_ntoa (see ebtables.c). I see I'll have to update extensions/ebt_nat.c to reflect this. Could be a while before I have a closer look at it and commit this to CVS, I'm kind of busy right now. cheers, Bart ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01