Le sam. 28 nov. 2020 à 17:54, Jason McIntyre <j...@kerhand.co.uk> a écrit :
> an mgre example seems conspicuous by its absence, so i'd say adding one
> seems helpful. some comments inline:

Thanks Jason for reviewing this patch.

> > +.Pp
> > +In this example the host A has an outer IP of 198.51.100.12, host
> > +B has 203.0.113.27, and host C has 203.0.113.254. Adressing within
>
> new sentence, new line
> s/Adressing/Addressing/
Done

> > +the tunnel is done using 192.0.2.0/24.
>
> s/./:/
Done

> > +.Bd -literal
> add "-offset indent" to match the other examples
Done, although I copied this block from gre example, so there's
another occurrence here which I didn't touch.

> > +The same tunnel interface can be then used between host B and C by
> s/be then/then be/
Done

> finally:
>         $ mandoc -Tlint gre.4
> make sure the diff doesn;t add any issues!
four whitespaces removed.

Index: share/man/man4/gre.4
===================================================================
RCS file: /cvs/src/share/man/man4/gre.4,v
retrieving revision 1.79
diff -u -p -u -r1.79 gre.4
--- share/man/man4/gre.4        18 Nov 2020 16:19:54 -0000      1.79
+++ share/man/man4/gre.4        28 Nov 2020 20:01:16 -0000
@@ -455,6 +455,67 @@ In most cases the following should work:
 .Bd -literal -offset indent
 pass quick on gre proto gre no state
 .Ed
+.Ss Point-to-Multipoint Layer 3 GRE tunnel interfaces (mgre) example
+.Nm mgre
+can be used to build a point-to-multipoint tunnel network to several
+hosts using a single
+.Nm mgre
+interface.
+.Pp
+In this example the host A has an outer IP of 198.51.100.12, host
+B has 203.0.113.27, and host C has 203.0.113.254.
+.Pp
+Addressing within the tunnel is done using 192.0.2.0/24:
+.Bd -literal -offset indent
+                        +--- Host B
+                       /
+                      /
+Host A --- tunnel ---+
+                      \e
+                       \e
+                        +--- Host C
+.Ed
+.Pp
+On Host A:
+.Bd -literal -offset indent
+# ifconfig mgreN create
+# ifconfig mgreN tunneladdr 198.51.100.12
+# ifconfig mgreN inet 192.0.2.1 netmask 0xffffff00 up
+.Ed
+.Pp
+On Host B:
+.Bd -literal -offset indent
+# ifconfig mgreN create
+# ifconfig mgreN tunneladdr 203.0.113.27
+# ifconfig mgreN inet 192.0.2.2 netmask 0xffffff00 up
+.Ed
+.Pp
+On Host C:
+.Bd -literal -offset indent
+# ifconfig mgreN create
+# ifconfig mgreN tunneladdr 203.0.113.254
+# ifconfig mgreN inet 192.0.2.3 netmask 0xffffff00 up
+.Ed
+.Pp
+To reach Host B over the tunnel (from Host A), there has to be a
+route on Host A specifying the next-hop:
+.Pp
+.Dl # route add -host 192.0.2.2 203.0.113.27 -iface -ifp mgreN
+.Pp
+Similarly, to reach Host A over the tunnel from Host B, a route must
+be present on B with A's outer IP as next-hop:
+.Pp
+.Dl # route add -host 192.0.2.1 198.51.100.12 -iface -ifp mgreN
+.Pp
+The same tunnel interface can then be used between host B and C by
+adding the appropriate routes, making the network any-to-any instead
+of hub-and-spoke:
+.Pp
+On Host B:
+.Dl # route add -host 192.0.2.3 203.0.113.254 -iface -ifp mgreN
+.Pp
+On Host C:
+.Dl # route add -host 192.0.2.2 203.0.113.27 -iface -ifp mgreN
 .Ss Point-to-Point Ethernet over GRE tunnel interfaces (egre) example
 .Nm egre
 can be used to carry Ethernet traffic between two endpoints over

Reply via email to