Bug 27891

Summary: Cannot assign a IP address to a interface when a route to the same subnet exists in the routing table
Product: Base System Reporter: bannai <bannai>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description bannai 2001-06-05 19:40:01 UTC
When assigning a IP address to a interface, you get a error when a route to the
same subnet already exists in the routing table. This can happen usually 
when running OSPF (or any routing protocol) when a route is learnt from
a neighbor. This populates the kernel routing table.

At a later stage when you add a interface on the subnet that is learnt from 
the neighbor, you get a error. We tried this by using a static route. I am not
sure if using a static route causes this problem.

Fix: 

I am not sure, but could this be related to using a static route. I will 
try with a dynamic routing protocol..
How-To-Repeat: - Add a static route to the kernel routing table (eg. 172.16.0.0/16)
- Set the IP address of a interface (eg 172.16.100.10)

This causes the ifconfig to fail
Comment 1 ru freebsd_committer freebsd_triage 2001-06-06 09:35:05 UTC
State Changed
From-To: open->closed

This is the correct behavior. 

First, the IP address still gets assigned to the interface. 
It is the so-called "interface" route that can't be installed 
because the route to the same destination/netmask already 
exists in the routing table (whether static or not). 

Either delete this route before running ifconfig(8), or 
use a different netmask value.