Re: vether vs. tap, initialization order, etc

2021-04-24 Thread Chavdar Ivanov
On Sat, 24 Apr 2021 at 20:11, Martin Husemann  wrote:
>
> On Sat, Apr 24, 2021 at 03:19:16PM +, nia wrote:
> > Thank you! This works great, I'll make note of it in the NetBSD Guide's 
> > section
> > on networking.
>
> Another option (as rjs hinted) is to only have a vether0.ifconfig (I did
> that with bridge0.ifconfig for other setups) and use ! lines to do the
> required other ifconfig commands for various interfaces all in there.
>
> Keeps the whole bridge config in one place and is (IMHO) a bit clearer to
> read.

That's what I thought better, as it doesn't depend on anything else.
My ifconfig.bridge0 is

create
!ifconfig tap0 create up description "LxMint"
!ifconfig tap1 create up description "MXLinux"
!ifconfig tap2 create up description "FreeBSD12"
!ifconfig tap3 create up description "NBSDc"
!ifconfig tap4 create up description "OpenBSD"
!ifconfig tap5 create up description "Windows10"
!brconfig $int add wm0
!brconfig $int add tap0
!brconfig $int add tap1
!brconfig $int add tap2
!brconfig $int add tap3
!brconfig $int add tap4
!brconfig $int add tap5
up

(for use by a bunch of qemu-nvmm guests).

>
> Martin



-- 



Re: vether vs. tap, initialization order, etc

2021-04-24 Thread Martin Husemann
On Sat, Apr 24, 2021 at 03:19:16PM +, nia wrote:
> Thank you! This works great, I'll make note of it in the NetBSD Guide's 
> section
> on networking.

Another option (as rjs hinted) is to only have a vether0.ifconfig (I did
that with bridge0.ifconfig for other setups) and use ! lines to do the
required other ifconfig commands for various interfaces all in there.

Keeps the whole bridge config in one place and is (IMHO) a bit clearer to
read.

Martin


Re: vether vs. tap, initialization order, etc

2021-04-24 Thread nia
On Sat, Apr 24, 2021 at 07:57:30AM -0700, Jason Thorpe wrote:
> 
> > On Apr 24, 2021, at 5:42 AM, nia  wrote:
> > 
> > I wonder if there's an initialization order difference
> > somewhere.
> 
> If you want to have control over the initialization order, you need to set 
> auto_ifconfig=NO.  On one of my systems that has a bunch of Qemu VMs:
> 
> auto_ifconfig=NO
> net_interfaces="tap0 tap1 tap2 tap3 tap4 tap5 tap6 tap7 tap8 tap9 tap10 tap11 
> bridge0”
> 
> …otherwise I was having the problem of bridge0 being brought up before the 
> tap devices were created.
> 
> -- thorpej
> 

Thank you! This works great, I'll make note of it in the NetBSD Guide's section
on networking.


Re: vether vs. tap, initialization order, etc

2021-04-24 Thread Jason Thorpe


> On Apr 24, 2021, at 5:42 AM, nia  wrote:
> 
> I wonder if there's an initialization order difference
> somewhere.

If you want to have control over the initialization order, you need to set 
auto_ifconfig=NO.  On one of my systems that has a bunch of Qemu VMs:

auto_ifconfig=NO
net_interfaces="tap0 tap1 tap2 tap3 tap4 tap5 tap6 tap7 tap8 tap9 tap10 tap11 
bridge0”

…otherwise I was having the problem of bridge0 being brought up before the tap 
devices were created.

-- thorpej



Re: vether vs. tap, initialization order, etc

2021-04-24 Thread Robert Swindells


nia  wrote:
>I just updated our home router from 9.1 to -current because a
>roommate wanted to use wg(4).
>
>I use tap as a bridge endpoint for two NICs that are used for
>the LAN.
>
>I thought I'd be able to copy the configs and do a straightforward
>subtitution from tap to vether but this doesn't work.
>/etc/rc.d/network fails to "up" the bridge on boot.
>
>The bridge was previously initialized in /etc/ifconfig.tap0,
>like so, now /etc/ifconfig.vether0:
>
>create
>inet 10.0.1.1 netmask 255.255.255.0
>!brconfig bridge0 add $int add re1 add re2 up

If vether(4) is like other network devices then I would expect to have
to bring it up as well, I don't see anything in your ifconfig.vether0
to do that.

I have usually brought up the bridge explicitly in /etc/ifconfig.bridge0
rather than from brconfig(8) but don't know if it makes a difference.



vether vs. tap, initialization order, etc

2021-04-24 Thread nia
I just updated our home router from 9.1 to -current because a
roommate wanted to use wg(4).

I use tap as a bridge endpoint for two NICs that are used for
the LAN.

I thought I'd be able to copy the configs and do a straightforward
subtitution from tap to vether but this doesn't work.
/etc/rc.d/network fails to "up" the bridge on boot.

The bridge was previously initialized in /etc/ifconfig.tap0,
like so, now /etc/ifconfig.vether0:

create
inet 10.0.1.1 netmask 255.255.255.0
!brconfig bridge0 add $int add re1 add re2 up

I wonder if there's an initialization order difference
somewhere.