Re: ARP tables and Masquerading

Andi Kleen (ak@muc.de)
09 Oct 1999 14:13:08 +0200


lburton@netporths.com (Luke Burton) writes:

> 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?

This is already implemented in 2.2. Just enable proxy_arp and forwarding
on the incoming interface (via /proc/sys/net/ipv4/conf/<interface>/)

BTW, this is documented in arp(7).

-Andi

-- 
This is like TV. I don't like TV.

- 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/