[559] in linux-net channel archive

home help back first fref pref prev next nref lref last post

Gated making my life hell

daemon@ATHENA.MIT.EDU (Drew Eckhardt)
Thu Jun 22 07:25:11 1995

To: linux-net@vger.rutgers.edu
Date: Thu, 22 Jun 1995 01:39:07 -0600
From: Drew Eckhardt <drew@poohsticks.org>


I'm running kernel 1.2.5, libc 4.7.2, and gated 3_0_3 from the Sunacm
archive (the ALPHA version didn't work at all for me).  

My problem is that when gated creates static routes that have a netmask
of 255.255.255.240, they really get installed with a netmask of 255.255.255.0,
although it claims it installs them right.  Specifics are as follows -

I have the following interfaces up all the time :

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Bcast:127.255.255.255  Mask:255.0.0.0
          UP BROADCAST LOOPBACK RUNNING  MTU:2000  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0
          TX packets:21575 errors:1 dropped:0 overruns:0

eth0      Link encap:10Mbps Ethernet  HWaddr 00:AA:00:0C:E8:34
          inet addr:198.137.146.99  Bcast:198.137.146.111  Mask:255.255.255.240
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:359612 errors:10 dropped:0 overruns:0
          TX packets:342576 errors:3403 dropped:0 overruns:0
          Interrupt:10 Base address:0x320 


dummy0    Link encap:10Mbps Ethernet  HWaddr 00:00:00:00:00:00
          inet addr:192.168.1.17  Bcast:192.168.1.31  Mask:255.255.255.240
          UP BROADCAST RUNNING  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0
          TX packets:0 errors:0 dropped:0 overruns:0

I run

	ipfw add blocking deny all iface 192.168.1.1 from 0.0.0.0/0 to 0.0.0.0/0

to get a blackhole device until I can figure out/implement real reject routes.

The relevant symbolic hostnames are 

198.137.146.26	hub-to-drew
198.137.146.27	drew-to-hub
198.137.146.99	chopper

I have the static routes

chopper.poohsti *               255.255.255.255 UH    1436   0       28 eth0
192.168.1.17    *               255.255.255.255 UH    1436   0       27 dummy0
localhost       *               255.255.255.255 UH    1936   0      263 lo
drew-to-hub.vil *               255.255.255.255 UH    1936   0        0 lo
198.137.146.96  *               255.255.255.240 U     1436   0      330 eth0

setup to them at all times.

I also have an automagic PERL script, which tries to maintain a full-time SLIP
connection, setting the interface up as follows : 

sl0       Link encap:VJ Serial Line IP  
          inet addr:198.137.146.27  P-t-P:198.137.146.26  Mask:255.255.255.240
          UP POINTOPOINT RUNNING  MTU:296  Metric:1
          RX packets:328558 errors:0 dropped:0 compressed:217665
          TX packets:367557 errors:0 dropped:0 compressed:255675

and adding the following routes : 
	route add hub-to-drew sl0;
	route add drew-to-hub sl0;
	route add -net default sl0;

with the first one being a bletcherous hack arround gated murdering my routing 
table.

I run the following gated configuration :

tracefile "/var/adm/gated.log" replace size 1m files 2 ;
traceoptions kernel ;

# Define all dynamic interfaces here.  Otherwise, we only deal with
# interfaces which were up when gated started. 

interfaces {
    define hub-to-drew pointtopoint drew-to-hub netmask 255.255.255.240 ;
} ;

# Route via RIP
rip yes {
    nobroadcast ;
    sourcegateways hub-to-drew;
} ;

# Setup "static" routes with worst preference to all dynamic nets which
# will propogate routing information to us.  192.168.1.17 is a virtual 
# interface which has the kernel filtering code setup to block all packets.
#
# If we run gated with a similar static clause everywhere, packets won't
# make it off the machine they originate at :-)

static {
# I've tried mask here too; doesn't work
    198.137.146.64 mask-length 28 gateway 192.168.1.17 preference 255 ;
    198.137.146.32 mask-length 28 gateway 192.168.1.17 preference 255 ;
    198.137.146.80 mask-length 28 gateway 192.168.1.17 preference 255 ;
    198.137.146.48 mask-length 28 gateway 192.168.1.17 preference 255 ;
} ;

The problem : 

When I startup gated with any of my statics, it makes an ICKY route 
198.137.146.0   *               255.255.255.0   U     1436   0        0 dummy0

note the netmask there.  

Manually adding routes like this 

	route add -net 198.137.146.64 netmask 255.255.255.240 dev dummy0

puts the right entries in the kernel; and the logging from gated says the 
right magic is happening.  Note the static routes that are added; and 
then deleted when they're RIPed. 

Of course, the thing actually added a bogus route, and it never goes away :-(
 
Jun 22 01:06:07 inet_routerid_notify: Router ID: 198.137.146.99
Jun 22 01:06:07 
KERNEL ADD    127.0.0.1       mask 255.255.255.255 gateway 127.0.0.1       Direct <NoAge Refresh NoAdvise Active Retain>
Jun 22 01:06:07 krt_flash: Can not install 127/255 gateway 127.0.0.1: reject routes not supported
KERNEL ADD    198.137.146.96  mask 255.255.255.240 gateway 198.137.146.99  Direct <NoAge Refresh Int Active Retain>
KERNEL ADD    198.137.146.26  mask 255.255.255.255 gateway 198.137.146.27  Direct <NoAge Refresh Active Retain>
KERNEL ADD    198.137.146.27  mask 255.255.255.255 gateway 127.0.0.1       Direct <NoAge Refresh NoAdvise Active Retain Gateway>
KERNEL ADD    192.168.1.16    mask 255.255.255.240 gateway 192.168.1.17    Direct <NoAge Refresh Int Active Retain>
Jun 22 01:06:07 
Jun 22 01:06:07 ***Routes are being installed in kernel
Jun 22 01:06:07 
Jun 22 01:06:07 inet_routerid_notify: Router ID: 198.137.146.99
Jun 22 01:06:07 
KERNEL ADD    198.137.146.64  mask 255.255.255.240 gateway 192.168.1.17    Static <NoAge Refresh Int Active Gateway>
KERNEL ADD    198.137.146.32  mask 255.255.255.240 gateway 192.168.1.17    Static <NoAge Refresh Int Active Gateway>
KERNEL ADD    198.137.146.80  mask 255.255.255.240 gateway 192.168.1.17    Static <NoAge Refresh Int Active Gateway>
KERNEL ADD    198.137.146.48  mask 255.255.255.240 gateway 192.168.1.17    Static <NoAge Refresh Int Active Gateway>
KERNEL ADD    198.137.146.19  mask 255.255.255.255 gateway 198.137.146.26  RIP <Refresh Int Active Gateway IfSubnetMask>
KERNEL ADD    198.137.146.20  mask 255.255.255.255 gateway 198.137.146.26  RIP <Refresh Int Active Gateway IfSubnetMask>
KERNEL ADD    198.137.146.21  mask 255.255.255.255 gateway 198.137.146.26  RIP <Refresh Int Active Gateway IfSubnetMask>
KERNEL ADD    198.137.146.22  mask 255.255.255.255 gateway 198.137.146.26  RIP <Refresh Int Active Gateway IfSubnetMask>
KERNEL DELETE 198.137.146.64  mask 255.255.255.240 gateway 192.168.1.17    Static <NoAge Refresh Int HoldDown Gateway>
KERNEL ADD    198.137.146.64  mask 255.255.255.240 gateway 198.137.146.26  RIP <Refresh Int Active Gateway IfSubnetMask>
KERNEL DELETE 198.137.146.32  mask 255.255.255.240 gateway 192.168.1.17    Static <NoAge Refresh Int HoldDown Gateway>
KERNEL ADD    198.137.146.32  mask 255.255.255.240 gateway 198.137.146.26  RIP <Refresh Int Active Gateway IfSubnetMask>
KERNEL DELETE 198.137.146.80  mask 255.255.255.240 gateway 192.168.1.17    Static <NoAge Refresh Int HoldDown Gateway>
KERNEL ADD    198.137.146.80  mask 255.255.255.240 gateway 198.137.146.26  RIP <Refresh Int Active Gateway IfSubnetMask>
KERNEL DELETE 198.137.146.48  mask 255.255.255.240 gateway 192.168.1.17    Static <NoAge Refresh Int HoldDown Gateway>
KERNEL ADD    198.137.146.48  mask 255.255.255.240 gateway 198.137.146.26  RIP <Refresh Int Active Gateway IfSubnetMask>

home help back first fref pref prev next nref lref last post