ifconfig creates a bogus(?) route

David DeSimone ddesimone at verio.net
Sat May 28 15:48:46 UTC 2016


Bruce Evans wrote:
> Sometime between r191220 and r201220, ifconfig started creating a bogus(?) static route.
> The following is under r248255 with "ifconfig em0 inet 192.168.2.8" (where 192.168.2.8 is
> for the local host and I don't bother typing the netmsk) done before bringing up lo0:
>
> Routing tables
>
> Internet:
> Destination        Gateway            Flags    Refs      Use  Netif Expire
> 192.168.2.0/24     link#1             U           0        0    em0
> 192.168.2.8        link#1             UHS         0        0    lo0

Why do you feel the route is bogus?  Is it because it has a netmask?

If you don't supply a netmask, ifconfig will assume one based on the "class" (A, B, C) of the IP you've supplied.  192.168.2.8 is a Class C address and gets a /24 netmask by default.

> The bogus(?) route points to itself (route get shows this more clearly), and doesn't work.
> I know little about routiing, but can > fix things like this manually.  Simply "route delete"
> on the bogus(?) route works in this case.  An alias for lo0 also works.

In router parlance, the route would be called a "connected" route, showing that not only do you have an IP on the subnet, but by virtue of the netmask, you are "connected" to every other IP in the same subnet range, through that interface.  It will cause your system to send ARP requests through that interface for any other IP in the range, in order to communicate with them.

--
David DeSimone <ddesimone at verio.net>
Professional Services Design Engineer at NTT America

________________________________
This email message is intended for the use of the person to whom it has been sent, and may contain information that is confidential or legally protected. If you are not the intended recipient or have received this message in error, you are not authorized to copy, distribute, or otherwise use this message or its attachments. Please notify the sender immediately by return e-mail and permanently delete this message and any attachments. makes no warranty that this email is error or virus free. Thank you.
________________________________
This email message is intended for the use of the person to whom it has been sent, and may contain information that is confidential or legally protected. If you are not the intended recipient or have received this message in error, you are not authorized to copy, distribute, or otherwise use this message or its attachments. Please notify the sender immediately by return e-mail and permanently delete this message and any attachments. NTT America makes no warranty that this email is error or virus free. Thank you.
________________________________


More information about the freebsd-net mailing list