lkml.org 
[lkml]   [1996]   [Dec]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectRe: /proc/net/arp
Date

Hello!

> >
> > : I have a deamon that reads /proc/net/arp and forwards packets based upon
> > : what it sees there.
> >
> > Bad idea. But in any case:
>
> I need to find all the arp-cache entries on the remote (server) host so that
> the local host (connected to the internet) can proxy-arp them. If there is
> another way, please advise. The daemons setup and tear down the routing and
> proxy-arp automatically as my remote machines come on-line.

Try to enable "total" proxy arp:
arp -s 0.0.0.0 netmask 0.0.0.0 "" dev eth0
(excuse me for "wrong" syntax, I forgot how it is made in net-tools's arp:
the idea is to set wildcard proxy entry on eth0)
Now your router will answer to ALL arp requests,
this nice facility exists since ~2.0.0.
If you know, what prefixes should be proxied, you can limit the range:
arp -s A.B.C.0 netmask 255.255.255.0 "" dev eth0

How it works. When router receives an arp request, it looks
up its routing table, and if route goes via different interface
and a matching entry in proxy arp table is found, it answers.
Simple, smart and powerful. (I stole the idea from Cisco IOS 8-))

> I use ioctls to
> set up and tear down everything, but there isn't a documentated way to
> find out what is in the arp cache except for /proc/net/arp!
>

There is no other way to read it. I said "bad idea" not about
reading /proc/net/arp, but on using arp cache for taking routing
decisions.

> >
> > .....
> > : 204.178.40.255 0x1 0x0 00:00:00:00:00:00 * eth0
> > : ^^^^^^^^^^^^^^ BROADCAST address!!
> >
>
> This IS the broadcast address.....
>

Thank you! I found this bug. You can apply this patch or
just make something sort of:

ifconfig eth0 broadcast 204.178.40.0 (just to change it 8)8)
ifconfig eth0 broadcast 204.178.40.255


--- ../v2.1.17+/linux/net/ipv4/devinet.c Tue Dec 24 20:33:31 1996
+++ linux/net/ipv4/devinet.c Thu Dec 26 19:42:22 1996
@@ -229,10 +229,6 @@

addr = (*(struct sockaddr_in *)&ifr.ifr_broadaddr).sin_addr.s_addr;

- if (addr == dev->pa_brdaddr) {
- dev->ip_flags |= IFF_IP_BRD_OK;
- return 0;
- }
if (dev->flags & IFF_UP)
ip_rt_change_broadcast(dev, addr);
dev->pa_brdaddr = addr;
Alexey Kuznetsov.

\
 
 \ /
  Last update: 2005-03-22 13:37    [W:0.055 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site