NetBSD Problem Report #50717

From www@NetBSD.org  Tue Jan 26 14:21:49 2016
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.NetBSD.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 6DC9E7A20D
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 26 Jan 2016 14:21:49 +0000 (UTC)
Message-Id: <20160126142148.4394B7ACB5@mollari.NetBSD.org>
Date: Tue, 26 Jan 2016 14:21:48 +0000 (UTC)
From: venture37@geeklan.co.uk
Reply-To: venture37@geeklan.co.uk
To: gnats-bugs@NetBSD.org
Subject: It's not possible to utilise a gateway in another subnet
X-Send-Pr-Version: www-1.0

>Number:         50717
>Category:       kern
>Synopsis:       It's not possible to utilise a gateway in another subnet
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    kern-bug-people
>State:          closed
>Class:          support
>Submitter-Id:   net
>Arrival-Date:   Tue Jan 26 14:25:00 +0000 2016
>Closed-Date:    Mon Aug 08 05:25:50 +0000 2016
>Last-Modified:  Mon Aug 08 05:25:50 +0000 2016
>Originator:     Sevan Janiyan
>Release:        HEAD
>Organization:
>Environment:
NetBSD  7.99.26 NetBSD 7.99.26 (GENERIC.201601251230Z) #0: Mon Jan 25 13:29:38 UTC 2016  builds@b45.netbsd.org:/home/builds/ab/HEAD/amd64/201601251230Z-obj/home/source/ab/HEAD/src/sys/arch/amd64/compile/GENERIC amd64
>Description:
I'm running NetBSD as a bhyve guest in a scenario where ISP assigns IP addresses with a /32 mask, the administrator assigns these addresses to guests and uses the same gatway IP address as used by the host (guests are bridged to the same ethernet interface as the host).

Following the steps outlined in the NetBSD FAQ, it's not possible to get this working
http://www.netbsd.org/docs/network/#nonsubnetgateway

assuming the IP address assigned to guest is 1.2.3.4 and the default gateway to use is 10.0.0.1

running route add -host 10.0.0.1 -link vioif0 -iface adds a route, but then console is filled with arp notifications 
e0:2f:6d:00:00:1a tried to overwrite permanent arp info for 10.0.0.1
It is not possible to ping 10.0.0.1 at this stage.

>How-To-Repeat:
Assign an IP address to ethernet interface
Setup a route to a gateway in another subnet
try to ping gateway IP address
>Fix:

>Release-Note:

>Audit-Trail:
From: Joerg Sonnenberger <joerg@britannica.bec.de>
To: gnats-bugs@NetBSD.org
Cc: kern-bug-people@netbsd.org, gnats-admin@netbsd.org,
	netbsd-bugs@netbsd.org
Subject: Re: kern/50717: It's not possible to utilise a gateway in another
 subnet
Date: Tue, 26 Jan 2016 15:45:50 +0100

 On Tue, Jan 26, 2016 at 02:25:01PM +0000, venture37@geeklan.co.uk wrote:
 > >How-To-Repeat:
 > Assign an IP address to ethernet interface
 > Setup a route to a gateway in another subnet
 > try to ping gateway IP address

 It would help if you said exactly what you are doing. I'm using
 iface-only routing all the time on my strato server, it certainly works
 fine.

 Joerg

From: Sevan Janiyan <venture37@geeklan.co.uk>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/50717: It's not possible to utilise a gateway in another
 subnet
Date: Tue, 26 Jan 2016 14:52:26 +0000

 On 26/01/2016 14:50, Joerg Sonnenberger wrote:
 >  It would help if you said exactly what you are doing. I'm using
 >  iface-only routing all the time on my strato server, it certainly works
 >  fine.

 ifconfig vioif0 1.2.3.4/32 up
 route add -host 10.0.0.1 -link vioif0 -iface
 ping 10.0.0.1

 Sevan

From: Joerg Sonnenberger <joerg@britannica.bec.de>
To: gnats-bugs@NetBSD.org
Cc: kern-bug-people@netbsd.org, gnats-admin@netbsd.org,
	netbsd-bugs@netbsd.org, venture37@geeklan.co.uk
Subject: Re: kern/50717: It's not possible to utilise a gateway in another
 subnet
Date: Tue, 26 Jan 2016 16:00:29 +0100

 On Tue, Jan 26, 2016 at 02:55:01PM +0000, Sevan Janiyan wrote:
 >  ifconfig vioif0 1.2.3.4/32 up
 >  route add -host 10.0.0.1 -link vioif0 -iface
 >  ping 10.0.0.1

 Try:
 route add -net 10.0.0.1/32 -link -cloning -iface vioif0
 route add default 10.0.0.1 -ifa 1.2.3.4

 Joerg

From: Sevan Janiyan <venture37@geeklan.co.uk>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/50717: It's not possible to utilise a gateway in another
 subnet
Date: Tue, 26 Jan 2016 15:22:57 +0000

 On 26/01/2016 15:05, Joerg Sonnenberger wrote:
 > Try:
 >  route add -net 10.0.0.1/32 -link -cloning -iface vioif0
 >  route add default 10.0.0.1 -ifa 1.2.3.4

 That works.
 Should the FAQ be updated to use this example or are both cases valid
 depending on scenario (virtio or physical hardware).

 Sevan

From: Joerg Sonnenberger <joerg@britannica.bec.de>
To: gnats-bugs@NetBSD.org
Cc: kern-bug-people@netbsd.org, gnats-admin@netbsd.org,
	netbsd-bugs@netbsd.org, venture37@geeklan.co.uk
Subject: Re: kern/50717: It's not possible to utilise a gateway in another
 subnet
Date: Tue, 26 Jan 2016 16:54:49 +0100

 On Tue, Jan 26, 2016 at 03:25:01PM +0000, Sevan Janiyan wrote:
 > The following reply was made to PR kern/50717; it has been noted by GNATS.
 > 
 > From: Sevan Janiyan <venture37@geeklan.co.uk>
 > To: gnats-bugs@NetBSD.org
 > Cc: 
 > Subject: Re: kern/50717: It's not possible to utilise a gateway in another
 >  subnet
 > Date: Tue, 26 Jan 2016 15:22:57 +0000
 > 
 >  On 26/01/2016 15:05, Joerg Sonnenberger wrote:
 >  > Try:
 >  >  route add -net 10.0.0.1/32 -link -cloning -iface vioif0
 >  >  route add default 10.0.0.1 -ifa 1.2.3.4
 >  
 >  That works.
 >  Should the FAQ be updated to use this example or are both cases valid
 >  depending on scenario (virtio or physical hardware).

 I don't think the non-cloning version is going to work with ARP...

 Joerg

From: Sevan Janiyan <venture37@geeklan.co.uk>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/50717: It's not possible to utilise a gateway in another
 subnet
Date: Tue, 26 Jan 2016 16:01:14 +0000

 On 26/01/2016 16:00, Joerg Sonnenberger wrote:
 >   I don't think the non-cloning version is going to work with ARP...

 It must've at some point as that example does work now on 
 OpenBSD-current without issue.


 Sevan

From: Sevan Janiyan <venture37@geeklan.co.uk>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/50717: It's not possible to utilise a gateway in another
 subnet
Date: Tue, 26 Jan 2016 16:21:46 +0000

 This is a multi-part message in MIME format.
 --------------020706040605030303010909
 Content-Type: text/plain; charset=windows-1252
 Content-Transfer-Encoding: 7bit



 On 26/01/2016 16:00, Joerg Sonnenberger wrote:
 >  I don't think the non-cloning version is going to work with ARP...


 Ok to commit?


 Sevan

 --------------020706040605030303010909
 Content-Type: text/plain; charset=UTF-8;
  name="net-faq-index.txt"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
  filename="net-faq-index.txt"

 Index: docs/network/index.xml
 ===================================================================
 RCS file: /cvsroot/htdocs/docs/network/index.xml,v
 retrieving revision 1.3
 diff -u -p -r1.3 index.xml
 --- docs/network/index.xml	23 Feb 2009 17:35:03 -0000	1.3
 +++ docs/network/index.xml	26 Jan 2016 16:19:09 -0000
 @@ -542,7 +542,7 @@ the network:
  <para>
  <screen>
   # ifconfig fxp0 inet 10.0.0.1
 - # route add -host 192.168.0.1 -link fxp0 -iface
 + # route add -net 192.168.0.1/32 -link -cloning -iface fxp0
   # route add default -ifa 10.0.0.1 192.168.0.1
  </screen>
  </para>

 --------------020706040605030303010909--

From: christos@zoulas.com (Christos Zoulas)
To: gnats-bugs@NetBSD.org, kern-bug-people@netbsd.org, 
	gnats-admin@netbsd.org, netbsd-bugs@netbsd.org, venture37@geeklan.co.uk
Cc: 
Subject: Re: kern/50717: It's not possible to utilise a gateway in another subnet
Date: Tue, 26 Jan 2016 11:25:04 -0500

 On Jan 26,  4:00pm, joerg@britannica.bec.de (Joerg Sonnenberger) wrote:
 -- Subject: Re: kern/50717: It's not possible to utilise a gateway in another

 |  I don't think the non-cloning version is going to work with ARP...

 So let's update the FAQ..

 christos

From: christos@zoulas.com (Christos Zoulas)
To: gnats-bugs@NetBSD.org, kern-bug-people@netbsd.org, 
	gnats-admin@netbsd.org, netbsd-bugs@netbsd.org, venture37@geeklan.co.uk
Cc: 
Subject: Re: kern/50717: It's not possible to utilise a gateway in another subnet
Date: Tue, 26 Jan 2016 11:26:09 -0500

 On Jan 26,  4:25pm, venture37@geeklan.co.uk (Sevan Janiyan) wrote:
 -- Subject: Re: kern/50717: It's not possible to utilise a gateway in another

 |  Ok to commit?

 Yes.

 christos

From: "Ryota Ozaki" <ozaki-r@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/50717 CVS commit: src
Date: Fri, 29 Jan 2016 04:15:47 +0000

 Module Name:	src
 Committed By:	ozaki-r
 Date:		Fri Jan 29 04:15:46 UTC 2016

 Modified Files:
 	src/distrib/sets/lists/tests: mi
 	src/tests/net/route: Makefile
 Added Files:
 	src/tests/net/route: t_route.sh

 Log Message:
 Add tests for a gateway not on the local subnet

 The tests are derived from the example at
 http://www.netbsd.org/docs/network/#nonsubnetgateway ,
 which has come up in PR 50717.


 To generate a diff of this commit:
 cvs rdiff -u -r1.660 -r1.661 src/distrib/sets/lists/tests/mi
 cvs rdiff -u -r1.2 -r1.3 src/tests/net/route/Makefile
 cvs rdiff -u -r0 -r1.1 src/tests/net/route/t_route.sh

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Mon, 08 Aug 2016 05:25:50 +0000
State-Changed-Why:
the doc change was committed in January


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.