proxy ARP questions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I recently discovered proxy ARP as a way to move a laptop between a
wired and a wireless network, without changing its IP address or
losing connections.  I haven't seen much documentation on this
scenario, which surprises me as I find it incredible useful.  (Being
a networking layman, I had previously thought that bridging was the
only solution.)

I think I have most of the details worked out, but I'd like to ask a
few questions about the best way of doing this.  Hopefully this is
the right place.  Also, since I don't have Web space, I want to put
this in the archives so other people can find it.

Network A is the wired network.  It has a DHCP server and a gateway
to the Internet, both out of my control.  My "server" host S has a
static address on A.  Network B is the wireless network, which I
control.  S is permanently attached to B and can forward between A
and B.  My "client" host C can switch between A and B.

To make S do proxy ARP, I left its interface on A alone, and gave it
the same IP address on B, with no network route.  I turned on proxy
ARP on both interfaces.  To attach C to B, I configured C it as if
it were on A, and added a host route on B to C on S.  I got
everything working this way.

Now, I want to automate the process of moving C between networks.  I
intend for it to get its IP address on A from the normal DHCP
server.  On B, I intend for S to run a DHCP relay, so C gets the
same IP address and gateway as on A.  I think can add a hook to the
DHCP relay to set up and take down the host route on B to C.

My first question is, is there any better way to add and remove this
route?  A conceptually simple setup would be to have identical
network routes on both interfaces, and let the kernel use ARP to
decide which network a given address is really on.  Is there any
facility to do this?

The last problem is the ARP caches of other hosts on A.  As much of
the proxy ARP documentation mentions, router boxes often have really
high ARP cache timeouts.  What they don't seem to mention (but what
I eventually discovered) is that if they get a new ARP request, they
update their cache.  So I just need to make an ARP request from S to
the host on A with C's IP address.  I found I could do this by
running "arping" on S:

    arping -s <C's IP addr> <target IP addr>

The problem is, I potentially have to do this for every host on A
that C might want to talk to.  (In practice, there are only a few,
so this is not a show-stopper.)

So, my second question is, can I automate those ARP's?  My idea
would be, when C makes an ARP who-has request for a host on A, S
should not just answer from its cache, but should relay the ARP
who-has, with its own MAC address, so that the other host updates
its cache.  Is something like this possible?

Are there any other possibilities I'm missing?

Thanks for your help,
Andrew
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux