From nobody@FreeBSD.org  Thu Mar  6 19:25:02 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3D0F61065671
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  6 Mar 2008 19:25:02 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 2B3628FC14
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  6 Mar 2008 19:25:02 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m26JLw3H097606
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 6 Mar 2008 19:21:58 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.2/8.14.1/Submit) id m26JLwr1097605;
	Thu, 6 Mar 2008 19:21:58 GMT
	(envelope-from nobody)
Message-Id: <200803061921.m26JLwr1097605@www.freebsd.org>
Date: Thu, 6 Mar 2008 19:21:58 GMT
From: Frank Volf <frank@deze.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Routing to layer-2 address does not work on VLAN interface
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         121437
>Category:       kern
>Synopsis:       [vlan] Routing to layer-2 address does not work on VLAN interface
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-net
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Mar 06 19:30:00 UTC 2008
>Closed-Date:    
>Last-Modified:  Fri Dec 25 13:30:03 UTC 2009
>Originator:     Frank Volf
>Release:        7.0-STABLE
>Organization:
None
>Environment:
FreeBSD drawbridge.deze.org 7.0-STABLE FreeBSD 7.0-STABLE #0: Wed Mar  5 20:47:3 8 CET 2008     volf@drawbridge.deze.org:/home4/obj/usr/sources/src7/sys/DRAWBRID GE  i386

>Description:

I have a transparent ADSL modem (the modem does not have assigned an IP
address from the provider but forwards all traffic to my FreeBSD box,
which owns the actual IP address). 

For mgmt purposes I access the modem from the FreeBSD box using the
modems 10.0.0.138 IP address. Because the ISP IP address is assigned to
the FreeBSD box, the FreeBSD box does not have an address in 10.0.0.0/24.

To make this work I use the following command to create 

route add 10.0.0.138 -netmask 255.255.255.255 -interface -link xl2:00.0e.50.23.5e.13

This works perfectly, a host entry is created in the routing table and
the link layer address is added as well:

# netstat -nr | grep 10.0.0.138
10.0.0.138/32      00:0e:50:23:5e:13  ULS         5     5370    xl2


The problem is that it does not work if a vlan interface is used instead
of a physical interface:

# ifconfig em0.99 create
# route add 1.2.3.4 -netmask 255.255.255.255 -interface -link em0.99:00.0e.50.23.5e.14
add net 1.2.3.4: gateway em0.99:00.0e.50.23.5e.14
# netstat -nr |grep 1.2.3.4
1.2.3.4/32         em0:99.0.e.50.23.5e.14 US          0        0    em0

As you can see, something seems to go wrong with the parsing. This problem
also exists in FreeBSD 6.x




>How-To-Repeat:
# ifconfig em0.99 create
# route add 1.2.3.4 -netmask 255.255.255.255 -interface -link em0.99:00.0e.50.23.5e.14
add net 1.2.3.4: gateway em0.99:00.0e.50.23.5e.14
# netstat -nr |grep 1.2.3.4
1.2.3.4/32         em0:99.0.e.50.23.5e.14 US          0        0    em0

>Fix:
No fix known.


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-net 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sat Mar 8 05:53:10 UTC 2008 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=121437 

From: Frank <frank@deze.org>
To: bug-followup@FreeBSD.org, frank@deze.org
Cc:  
Subject: Re: kern/121437: [vlan] Routing to layer-2 address does not work
 on VLAN interface
Date: Fri, 25 Dec 2009 14:21:00 +0100

 Just checked, and the bug is still present in FreeBSD 8.x
 
 Regards,
 
 Frank
 
>Unformatted:
