summaryrefslogtreecommitdiffstats
path: root/share/man/man4/gre.4
diff options
context:
space:
mode:
authorae <ae@FreeBSD.org>2015-06-06 13:39:20 +0000
committerae <ae@FreeBSD.org>2015-06-06 13:39:20 +0000
commitfcae6374c46e27235434ab48a7b1cd1da69782dd (patch)
treec71d5b0ff1812244ff094426b4fe26e66b8b1bf1 /share/man/man4/gre.4
parent49fd76c05c1937d6c5bf27f823249d3605121fe0 (diff)
downloadFreeBSD-src-fcae6374c46e27235434ab48a7b1cd1da69782dd.zip
FreeBSD-src-fcae6374c46e27235434ab48a7b1cd1da69782dd.tar.gz
MFC r283897:
Add example how to configure gre(4) tunnel with the same inner and outer addresses using multiple FIBs.
Diffstat (limited to 'share/man/man4/gre.4')
-rw-r--r--share/man/man4/gre.440
1 files changed, 39 insertions, 1 deletions
diff --git a/share/man/man4/gre.4 b/share/man/man4/gre.4
index 6652bdf..15ef0ec 100644
--- a/share/man/man4/gre.4
+++ b/share/man/man4/gre.4
@@ -29,7 +29,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd November 7, 2014
+.Dd June 2, 2015
.Dt GRE 4
.Os
.Sh NAME
@@ -118,6 +118,44 @@ ifconfig greN inet 192.168.2.1 192.168.1.1
ifconfig greN inet tunnel B A
route add -net 192.168.1 -netmask 255.255.255.0 192.168.1.1
.Ed
+.Pp
+In case when internal and external IP addresses are the same,
+different routing tables (FIB) should be used.
+The default FIB will be applied to IP packets before GRE encapsulation.
+After encapsulation GRE interface should set different FIB number to
+outgoing packet.
+Then different FIB will be applied to such encapsulated packets.
+According to this FIB packet should be routed to tunnel endpoint.
+.Bd -literal
+Host X -- Host A (198.51.100.1) ---tunnel--- Cisco D (203.0.113.1) -- Host E
+ \\ /
+ \\ /
+ +----- Host B ----- Host C -----+
+ (198.51.100.254)
+.Ed
+.Pp
+On Host A (FreeBSD):
+.Pp
+First of multiple FIBs should be configured via loader.conf:
+.Bd -literal -offset indent
+net.fibs=2
+net.add_addr_allfibs=0
+.Ed
+.Pp
+Then routes to the gateway and remote tunnel endpoint via this gateway
+should be added to the second FIB:
+.Bd -literal -offset indent
+route add -net 198.51.100.0 -netmask 255.255.255.0 -fib 1 -iface em0
+route add -host 203.0.113.1 -fib 1 198.51.100.254
+.Ed
+.Pp
+And GRE tunnel should be configured to change FIB for encapsulated packets:
+.Bd -literal -offset indent
+ifconfig greN create
+ifconfig greN inet 198.51.100.1 203.0.113.1
+ifconfig greN inet tunnel 198.51.100.1 203.0.113.1 tunnelfib 1
+.Ed
+.Pp
.Sh NOTES
The MTU of
.Nm
OpenPOWER on IntegriCloud