Re: vxlan(4) in endpoint mode

2022-05-02 Thread Denis Fondras
Le Mon, May 02, 2022 at 01:40:37PM +0100, Jason McIntyre a écrit :
> On Mon, May 02, 2022 at 11:48:49AM +0200, Denis Fondras wrote:
> > Le Mon, Apr 04, 2022 at 01:02:53PM +0200, Denis Fondras a ?crit :
> > > Le Mon, Apr 04, 2022 at 08:23:35PM +1000, David Gwynne a ?crit :
> > > > 
> > > > 
> > > > > On 3 Apr 2022, at 21:46, Denis Fondras  wrote:
> > > > > 
> > > > > Hi,
> > > > > 
> > > > > In vxlan(4) manual, we have :
> > > > > 
> > > > > endpoint mode
> > > > >   When configured without a tunnel destination address, vxlan 
> > > > > operates as
> > > > >   a bridge, but with learning disabled.
> > > > > 
> > > > > 
> > > > > The question is : is it possible to set tunnel source address without 
> > > > > a
> > > > > destination ?
> > > > 
> > > > ifconfig vxlan0 tunneladdr 10.20.30.1
> > > > 
> > > > that should work.
> > > 
> > > Thank you David. I will prepare a patch to the manual :)
> > 
> > Here is a tentative to document the tunneladdr option.
> > 
> 
> these options are sorted manually, so you want tunneladdr before
> tunnelttl.
> 

Thank you Jason. Here is an updated diff.


Index: ifconfig.8
===
RCS file: /cvs/src/sbin/ifconfig/ifconfig.8,v
retrieving revision 1.381
diff -u -p -r1.381 ifconfig.8
--- ifconfig.8  29 Dec 2021 21:41:28 -  1.381
+++ ifconfig.8  2 May 2022 15:30:35 -
@@ -1806,6 +1806,7 @@ for a complete list of the available pro
 .Op Oo Fl Oc Ns Cm keepalive Ar period count
 .Op Cm rxprio Ar prio
 .Op Oo Fl Oc Ns Cm tunnel Ar src_address dest_address
+.Op Cm tunneladdr Ar src_address
 .Op Oo Fl Oc Ns Cm tunneldf
 .Op Oo Fl Oc Ns Cm tunneldomain Ar rtable
 .Op Cm tunnelttl Ar ttl
@@ -1864,8 +1865,20 @@ Both addresses must be of the same famil
 The optional destination port can be specified for interfaces such as
 .Xr vxlan 4 ,
 which further encapsulate the packets in UDP datagrams.
+This directive is incompatible with
+.Cm tunneladdr .
 .It Cm -tunnel
 Remove the source and destination tunnel addresses.
+.It Cm tunneladdr Ar src_address
+Set the outer IP address of the tunnel.
+This is useful for point-to-multipoint tunnels where peers are in different
+subnets like
+.Xr vxlan 4
+endpoint mode or
+.Xr mgre 4 .
+It is incompatible with the
+.Cm tunnel
+directive.
 .It Cm tunneldf
 Do not allow fragmentation of encapsulated packets.
 .It Cm -tunneldf



Re: vxlan(4) in endpoint mode

2022-05-02 Thread Jason McIntyre
On Mon, May 02, 2022 at 11:48:49AM +0200, Denis Fondras wrote:
> Le Mon, Apr 04, 2022 at 01:02:53PM +0200, Denis Fondras a ?crit :
> > Le Mon, Apr 04, 2022 at 08:23:35PM +1000, David Gwynne a ?crit :
> > > 
> > > 
> > > > On 3 Apr 2022, at 21:46, Denis Fondras  wrote:
> > > > 
> > > > Hi,
> > > > 
> > > > In vxlan(4) manual, we have :
> > > > 
> > > > endpoint mode
> > > > When configured without a tunnel destination address, vxlan 
> > > > operates as
> > > > a bridge, but with learning disabled.
> > > > 
> > > > 
> > > > The question is : is it possible to set tunnel source address without a
> > > > destination ?
> > > 
> > > ifconfig vxlan0 tunneladdr 10.20.30.1
> > > 
> > > that should work.
> > 
> > Thank you David. I will prepare a patch to the manual :)
> 
> Here is a tentative to document the tunneladdr option.
> 

these options are sorted manually, so you want tunneladdr before
tunnelttl.

jmc

> Index: ifconfig.8
> ===
> RCS file: /cvs/src/sbin/ifconfig/ifconfig.8,v
> retrieving revision 1.381
> diff -u -p -r1.381 ifconfig.8
> --- ifconfig.829 Dec 2021 21:41:28 -  1.381
> +++ ifconfig.82 May 2022 09:46:10 -
> @@ -1809,6 +1809,7 @@ for a complete list of the available pro
>  .Op Oo Fl Oc Ns Cm tunneldf
>  .Op Oo Fl Oc Ns Cm tunneldomain Ar rtable
>  .Op Cm tunnelttl Ar ttl
> +.Op Cm tunneladdr Ar src_address
>  .Op Cm txprio Ar prio
>  .Op Oo Fl Oc Ns Cm vnetflowid
>  .Op Oo Fl Oc Ns Cm vnetid Ar network-id
> @@ -1864,6 +1865,8 @@ Both addresses must be of the same famil
>  The optional destination port can be specified for interfaces such as
>  .Xr vxlan 4 ,
>  which further encapsulate the packets in UDP datagrams.
> +This directive is incompatible with
> +.Cm tunneladdr .
>  .It Cm -tunnel
>  Remove the source and destination tunnel addresses.
>  .It Cm tunneldf
> @@ -1888,6 +1891,16 @@ the value can also be set to
>  .Ar copy
>  to have the TTL copied between the encapsulated protocol headers
>  and the tunnel protocol headers.
> +.It Cm tunneladdr Ar src_address
> +Set the outer IP address of the tunnel.
> +This is useful for point-to-multipoint tunnels where peers are in different
> +subnets like
> +.Xr vxlan 4
> +endpoint mode or
> +.Xr mgre 4 .
> +It is incompatible with the
> +.Cm tunnel
> +directive.
>  .It Cm txprio Ar prio
>  Configure the value used for the priority field in the tunnel
>  protocol headers.
> 



Re: vxlan(4) in endpoint mode

2022-05-02 Thread Denis Fondras
Le Mon, Apr 04, 2022 at 01:02:53PM +0200, Denis Fondras a écrit :
> Le Mon, Apr 04, 2022 at 08:23:35PM +1000, David Gwynne a écrit :
> > 
> > 
> > > On 3 Apr 2022, at 21:46, Denis Fondras  wrote:
> > > 
> > > Hi,
> > > 
> > > In vxlan(4) manual, we have :
> > > 
> > > endpoint mode
> > >   When configured without a tunnel destination address, vxlan operates as
> > >   a bridge, but with learning disabled.
> > > 
> > > 
> > > The question is : is it possible to set tunnel source address without a
> > > destination ?
> > 
> > ifconfig vxlan0 tunneladdr 10.20.30.1
> > 
> > that should work.
> 
> Thank you David. I will prepare a patch to the manual :)

Here is a tentative to document the tunneladdr option.

Index: ifconfig.8
===
RCS file: /cvs/src/sbin/ifconfig/ifconfig.8,v
retrieving revision 1.381
diff -u -p -r1.381 ifconfig.8
--- ifconfig.8  29 Dec 2021 21:41:28 -  1.381
+++ ifconfig.8  2 May 2022 09:46:10 -
@@ -1809,6 +1809,7 @@ for a complete list of the available pro
 .Op Oo Fl Oc Ns Cm tunneldf
 .Op Oo Fl Oc Ns Cm tunneldomain Ar rtable
 .Op Cm tunnelttl Ar ttl
+.Op Cm tunneladdr Ar src_address
 .Op Cm txprio Ar prio
 .Op Oo Fl Oc Ns Cm vnetflowid
 .Op Oo Fl Oc Ns Cm vnetid Ar network-id
@@ -1864,6 +1865,8 @@ Both addresses must be of the same famil
 The optional destination port can be specified for interfaces such as
 .Xr vxlan 4 ,
 which further encapsulate the packets in UDP datagrams.
+This directive is incompatible with
+.Cm tunneladdr .
 .It Cm -tunnel
 Remove the source and destination tunnel addresses.
 .It Cm tunneldf
@@ -1888,6 +1891,16 @@ the value can also be set to
 .Ar copy
 to have the TTL copied between the encapsulated protocol headers
 and the tunnel protocol headers.
+.It Cm tunneladdr Ar src_address
+Set the outer IP address of the tunnel.
+This is useful for point-to-multipoint tunnels where peers are in different
+subnets like
+.Xr vxlan 4
+endpoint mode or
+.Xr mgre 4 .
+It is incompatible with the
+.Cm tunnel
+directive.
 .It Cm txprio Ar prio
 Configure the value used for the priority field in the tunnel
 protocol headers.