Subject: Why netmask 255.255.255.255 is needed for PPP
To: None <current-users@NetBSD.ORG>
From: Matthias Scheler <tron@lyssa.owl.de>
List: current-users
Date: 11/22/1996 11:39:35
Hi,
I recently send a PR about "pppd" not accepting netmask 255.255.255.255.
As a result I got some mails saying me that netmasks are irrelevant for
PPP connections - I believed that too before I discovered this problem -
or that netmask 255.255.255.255 for an interface is always wrong.
Here is the prove that I'm right.
tron@jehova:~#uname -a
NetBSD jehova 1.1 NetBSD 1.1 (JEHOVA) #2: Tue May 21 23:03:27 MET DST 1996 tron@colwyn:/usr/src/sys/arch/i386/compile/JEHOVA i386
Here are the two interfaces involved in the problem:
tron@jehova:~#ifconfig ed0
ed0: flags=8863<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST>
inet 194.121.202.132 netmask 0xfffffff8 broadcast 194.121.202.135
tron@jehova:~#ifconfig ppp0
ppp0: flags=51<UP,POINTOPOINT,RUNNING>
inet 194.121.202.132 --> 194.121.202.185 netmask 0xfffffff8
Now I try to add a route to a host on the same ethernet as the router:
tron@jehova:~#route add -net 194.121.202.208 -netmask 255.255.255.248 194.121.202.130
add net 194.121.202.208: gateway 194.121.202.130
tron@jehova:~#traceroute 194.121.202.209
traceroute to 194.121.202.209 (194.121.202.209), 30 hops max, 40 byte packets
1 colwyn.owl.de (194.121.202.185) 286.063 ms 250.02 ms 189.952 ms
2 jehova.owl.de (194.121.202.132) 219.295 ms 205.348 ms 200.316 ms
3 colwyn.owl.de (194.121.202.185) 308.69 ms 404.338 ms 320.49 ms
4 jehova.owl.de (194.121.202.132) 349.48 ms 385.297 ms 329.886 ms
^C
And as everybody can see it gets routed to the wrong destination. Ok,
time to fix the netmask ...:
tron@jehova:~#route delete 194.121.202.208
delete host 194.121.202.208
tron@jehova:~#ifconfig ppp0 netmask 255.255.255.255
... and to retry to add the route:
tron@jehova:~#route add -net 194.121.202.208 -netmask 255.255.255.248 194.121.202.130
add net 194.121.202.208: gateway 194.121.202.130
tron@jehova:~#traceroute 194.121.202.209
traceroute to 194.121.202.209 (194.121.202.209), 30 hops max, 40 byte packets
1 gaia.owl.de (194.121.202.130) 11.572 ms 2.481 ms 5.183 ms
2 beansidhe.owl.de (194.121.202.209) 137.896 ms 169.374 ms 159.967 ms
Wow, what a surprise: it worked.
Any doubts left that netmask 255.255.255.255 *is* required?
--
Matthias Scheler
tron@lyssa.owl.de