ARP tables and Masquerading

Luke Burton (lburton@netporths.com)
Sat, 9 Oct 1999 20:40:20 +1000 (EST)


Hi there,

While I appreciate many people on this list are tied up with all sorts of
unrelated stuff, I have run into some difficulties with my own kernel
hacking activities.

What I am seeking to do is detect arp requests on the network and add an
ethernet alias and host route whenever one is received. This will
facilitate my goal - to allow *anyone* to connect to a hub on a linux box,
regardless of their IP configuration (if, of course, they aren't using
DHCP - if only everyone did *that*).

So if I receive an arp for 192.168.1.1 from host 192.168.1.9, I add to my
linux box (which could be 10.0.0.1, or anything else) the equivalent of:

ifconfig eth0:0 192.168.1.1

route add -host 192.168.1.9 dev eth0:0

Now the normal kernel masquerading and nat takes over, allowing the user
to conduct their activities on the network. This specifically relates to
hotel environments where travelling people might plug their laptop and be
able to have net access, with no configuration modification.

It's easy enough to patch arp.c and see where the arp information is to be
found, but the act of adding a route and ifconfig entry is the problem.

Could anyone set me on the right track with regards to this?

Thanks,

Luke Burton

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/