Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Apr 1999 00:51:30 -0400 (EDT)
From:      "Crist J. Clark" <cjc@cc942873-a.ewndsr1.nj.home.com>
To:        freebsd-questions@FreeBSD.ORG (FreeBSD Questions)
Subject:   Using 'route' on Subnets
Message-ID:  <199904090451.AAA06633@cc942873-a.ewndsr1.nj.home.com>

next in thread | raw e-mail | index | archive | help
I had some wicked routing troubles earlier today. At my job, we are
planning a move from a C class net with 32 address (30 usable) subnets
to having the whole C class on one LAN. This is part of a move from
some thin net legs to all 100BaseT.

To do the switch, we are planning to move from one C class net to a
second. This way, we can more easily do the move gradually. In order
to maintain continuity in services, some machines will be aliased to
their new address. I was getting a start on the aliasing today on our
mailserver, a FreeBSD 2.2.8-STABLE box, when I had some ugly problems
that forced me to do my first ever reboot of the machine (except for
kernel upgrades and one time we unplugged the thing to move it).

I accidently screwed up entering the netmask of the alias so I ended
up with the effect of,

# ifconfig ex0 inet 10.0.0.7 netmask 255.255.255.224
# ifconfig ex0 inet 10.0.1.7 netmask 255.255.254.0 alias

Now this really started to mess things up. First, I was telneted into
the mailserver doing this from 10.0.0.70. The mailserver got the idea
that the machine I was on should be on the same LAN and started ARPing
for it, hanging my connections. I quickly realized the problem and got
to the console to remove the alias. However, removing the alias did
_not_ reset the routes. The routing table was still,

# netstat -rn
Routing tables

Internet:
Destination        Gateway            Flags     Refs     Use     Netif Expire
default            10.0.0.30          UGSc        2        0       ex0
127.0.0.1          127.0.0.1          UH          1     1009       lo0
10.0.0/27          link#2             UC          0        0 
10.0.0/23          link#2             UC          0        0 
10.0.0.1           0:e0:1e:3e:40:0    UHLW        1        0       ex0   1139
10.0.0.2           8:0:69:7:40:16     UHLW        2      114       ex0   1144
10.0.0.7           0:aa:0:6f:d7:28    UHLW        1       26       lo0
10.0.0.30          0:60:8c:38:c4:82   UHLW        2        0       ex0   1137
10.0.0.41          link#2             UHRLW       1        7 
10.0.0.70          link#2             UHRLW       1        7       ex0      3
10.0.0.148         link#2             UHRLW       1        7       ex0     16

I tried to,

# route flush

But that only would remove the 'default' entry. I could kill each of
the individual hosts, 10.0.0.41, 10.0.0.70, and 10.0.0.148, but I
could not find a way to kill the network entry 10.0.0/23 (or the
other). I just could not get rid of 'link#2,' whatever that is, and
get the routing table rebuilt without the bad netmask. I tried (as
mostly shots in the dark),

# ifconfig ex0 -link[0-2]            (no errors, no effect)
# route delete 10.0.0/23             (an error that host does not exist)
# route delete -net 10.0.0/23        (an error that net does not exist)
# ifconfig ex0 down                  (no effect on routes)
# ifconfig ex0 delete                (all IPs gone, no change in routing)
.
. (A few dozen other things and variations on the ones above)
.

I could think of no other ways to try to manipulate the table and
since the routing table is in the kernel, the only way to kill and
restart the routing was a reboot (that I could see).

What should I have done to fix this? Is there a problem in the kernel
or the ex0 driver? Or was my screw up with the netmask so damaging
that there is no real way to recover? How does one enter networks
that don't end at byte bounaries into route commands? What exactly does
'link#2' mean above?

Thanks for any help. Complete answers or pointers to documentation are
always appreciated (I've been trying to dig into O'Rielly's _TCP/IP
Network Administration_ (the crab book) all night). 

P.S. If I had gotten the netmask right, 255.255.255.0, the first time,
would things have worked out alright? I'm scared to try it now even
though I think it should not be a problem.
-- 
Crist J. Clark                           cjclark@home.com


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199904090451.AAA06633>