Re: Arp Table and Routing

A.N.Kuznetsov (kuznet@ms2.inr.ac.ru)
Fri, 17 Jan 1997 20:11:48 +0300 (MSK)


Hello!

>
> Now, when the ppp link connects, I get TWO entries in the routing table
> for the remote host, "40.100". One has a strange metric value of 32767.
>
> Kernel routing table
> Destination Gateway Genmask Flags Metric Ref Use Iface
> 204.178.40.100 0.0.0.0 255.255.255.255 U 0 0 0 ppp0
> 204.178.40.100 0.0.0.0 255.255.255.255 U 32767 0 0 ppp0

It is OK. The second entry was created by kernel when ppp0 was upped.
Particularily, it means that pppd is allowed not to add interface route,
it is just redundant. Really, no dumb programs sort of pppd,dip etc.
should not add/delete any routes except for default ones.

About strange metric.
Magically" added routes have maximal possible metric value,
so that you are able you override them easily.

> I can't remove any routes
> anymore, either with 'route` or doing ioctl() calls. Any routes seem
> permanent.
>

8)8)8) I wonder why nobody complained until now!
I forgot that net-tools's route utility does not pass netmask
to kernel.

With current net-tools you can delete host route by:
route del -host <address>
It is supposed that network route is deleted with:
route del -net <prefix> netmask <mask>

For now, you could fix it yourself or use my iproute utility
(ftp.inr.ac.ru:/ip-routing/*)

> This software does not route packets either, even though it "looks" as though
> it should. I can only connect host-to-host.

Apparently, you did not enabled IP forwarding.

echo 1 > /proc/sys/net/ipv4/ip_forwarding

It is turned off by default.

>
> However they don't appear in the arp-cache???? Also the "flags" entry used
> to be 0xe and 0x2e for proxy-arp. The arp-table shows 0xc which is not
> defined for proxy-arp flags??? Nothing is hard-coded in the software, the
> header files are used to resolve these flags.
>

They are specified in linux/if_arp.h:
0x2 is ATF_COM
0x80 is ATF_MAGIC (created by kernel)

When ATF_COM is not set in proxy arp entry,
"HW address" is ignored, and device hardware address is used instead.

I'd like to repeat again: do not fiddle with arp cache,
enable "total" proxy arp and forget this nightmare.

Alexey Kuznetsov.