Re: IFF_POINTOPOINT and netmasks

Miquel van Smoorenburg (miquels@cistron.nl)
Sat, 24 May 1997 21:16:18 +0200


[sorry if I quote a bit much]

According to Robert O'Kane:
> > In article <Pine.SOL.3.96.970523184009.14317U-100000@hammer.thor.cam.ac.uk>,
> > Philip Blundell <pjb27@cam.ac.uk> wrote:
> > >On Fri, 23 May 1997, Miquel van Smoorenburg wrote:
> > >
> > >> Why is this useful? Well, suppose I dial into my companies network. They
> > >> have a class C, 192.168.2.0/24. Now if I set the netmask to 255.255.255.0,
> > >> a route would be added automatically to the remote system - that's useful,
> > >> and that is what you would expect.
> > >
> > >Ah, I think I see. What you want to do will only work if the remote
> > >terminal server presents the same IP address on its dialin ports and on
> > >its network connection. In the general case, they can be completely
> > >different, and so the kernel is doing the right thing - when the
> > >point-to-point link comes up all that you know for certain is that you can
> > >reach the machine at the other end of it. If you happen to know that you
> > >can also reach machines on its local network that way, you have to set up
> > >a route by hand.
> >
> > The thing is - the default netmask should be 255.255.255.255, but if want
> > to override it, I think it should be possible. Right? At this moment the
> > kernel prevents me from doing it by resetting things I explicitly set.
> > Maybe Alexey Kuznetsov reads this, he should know..
> >
>
> Greetings,
> How can you expect to change the netmask of the other side? The
> netmask
> is for your interface, not the other side! When you define a PtP "link",
> the
> netmask is ignored!. It has no meaning on a PtP. Its up to the "other
> side" to
> route the packets (over ANOTHER INTERFACE) because on his side, the link
> to
> you is ALSO a PtP.

But. A route gets added to the _destination_ address of the pointopoint
link. It would make sense that if we have a netmask defined on the ptp
interface, that it would get used together with the remote address when
adding a route automatically.

You are right when you say that the netmask is useless wrt the local
interface address. Unless both local and remote IP addresses are in the
same network - but then you can use both local or remote address to
calculate the network to add a route to. So in all cases, it makes sense
to add a route using the remote address and the interface netmask.

I think I'm now starting to understand it, a bit. I have read the BSD
kernel source on this subject, and the Linux kernel source. And I have
patched my kernel to do the right thing, controlled by sysctl (default
is off, the old situation).

I'll be summarizing tomorrow, on linux-net which is more appropriate for
this subject, and I'll post my patch.

Thanks - Mike.

-- 
| Miquel van Smoorenburg |  "I need more space" "Well, why not move to Texas" |
| miquels@cistron.nl     |  "No, on my account, stupid." "Stupid? Uh-oh.."    |
|     PGP fingerprint: FE 66 52 4F CD 59 A5 36  7F 39 8B 20 F1 D6 74 02       |