summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkn <kn@cvs.openbsd.org>2021-01-08 21:26:35 +0000
committerkn <kn@cvs.openbsd.org>2021-01-08 21:26:35 +0000
commitbce3e94c4b5cf3d43279e6cc122a3c88d6d22476 (patch)
treefe6b0fa1064fdb84b1f2f8f8d5698e3add62935a
parentfc2662a5afe63193e7f7532e1a6087f3bad6b21f (diff)
Provide "Point-to-Multipoint Layer 3 GRE tunnel interfaces (mgre) example"
From Pierre Emeriaud, thanks! Feeback jmc OK dlg
-rw-r--r--share/man/man4/gre.465
1 files changed, 63 insertions, 2 deletions
diff --git a/share/man/man4/gre.4 b/share/man/man4/gre.4
index 51d75b7a590..2156c28fc8d 100644
--- a/share/man/man4/gre.4
+++ b/share/man/man4/gre.4
@@ -1,4 +1,4 @@
-.\" $OpenBSD: gre.4,v 1.80 2020/12/05 18:44:35 jmc Exp $
+.\" $OpenBSD: gre.4,v 1.81 2021/01/08 21:26:34 kn Exp $
.\" $NetBSD: gre.4,v 1.10 1999/12/22 14:55:49 kleink Exp $
.\"
.\" Copyright 1998 (c) The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: December 5 2020 $
+.Dd $Mdocdate: January 8 2021 $
.Dt GRE 4
.Os
.Sh NAME
@@ -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
+ +--- 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