diff options
Diffstat (limited to 'static/netbsd/man4/gre.4 3.html')
| -rw-r--r-- | static/netbsd/man4/gre.4 3.html | 305 |
1 files changed, 0 insertions, 305 deletions
diff --git a/static/netbsd/man4/gre.4 3.html b/static/netbsd/man4/gre.4 3.html deleted file mode 100644 index a48863b5..00000000 --- a/static/netbsd/man4/gre.4 3.html +++ /dev/null @@ -1,305 +0,0 @@ -<table class="head"> - <tr> - <td class="head-ltitle">GRE(4)</td> - <td class="head-vol">Device Drivers Manual</td> - <td class="head-rtitle">GRE(4)</td> - </tr> -</table> -<div class="manual-text"> -<section class="Sh"> -<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1> -<p class="Pp"><code class="Nm">gre</code> — - <span class="Nd">encapsulating network device</span></p> -</section> -<section class="Sh"> -<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1> -<p class="Pp"><code class="Cd">pseudo-device gre</code></p> -</section> -<section class="Sh"> -<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1> -<p class="Pp">The <code class="Nm">gre</code> network interface pseudo device - encapsulates datagrams into IP. These encapsulated datagrams are routed to a - destination host, where they are decapsulated and further routed to their - final destination. The “tunnel” appears to the inner datagrams - as one hop.</p> -<p class="Pp"><code class="Nm">gre</code> interfaces are dynamically created and - destroyed with the <a class="Xr">ifconfig(8)</a> - <code class="Cm">create</code> and <code class="Cm">destroy</code> - subcommands.</p> -<p class="Pp">This driver currently supports the following modes of - operation:</p> -<dl class="Bl-tag"> - <dt>GRE encapsulation (IP protocol number 47)</dt> - <dd>Encapsulated datagrams are prepended an outer datagram and a GRE header. - The GRE header specifies the type of the encapsulated datagram and thus - allows for tunneling other protocols than IP like e.g. AppleTalk. GRE mode - is also the default tunnel mode on Cisco routers. This is also the default - mode of operation of the <b class="Sy">gre</b><var class="Ar">X</var> - interfaces.</dd> - <dt>GRE in UDP encapsulation</dt> - <dd>Encapsulated datagrams are prepended a GRE header, and then they are sent - over a UDP socket. Userland may create the socket and - “delegate” it to the kernel using the - <code class="Dv">GRESSOCK</code> <a class="Xr">ioctl(2)</a>. If userland - does not supply a socket, then the kernel will create one using the - addresses and ports supplied by <a class="Xr">ioctl(2)</a>s - <code class="Dv">SIOCSLIFPHYADDR</code>, - <code class="Dv">GRESADDRD</code>, and/or - <code class="Dv">GRESADDRS</code>.</dd> - <dt>MOBILE encapsulation (IP protocol number 55)</dt> - <dd>Datagrams are encapsulated into IP, but with a shorter encapsulation. The - original IP header is modified and the modifications are inserted between - the so modified header and the original payload. Like - <a class="Xr">gif(4)</a>, only for IP in IP encapsulation.</dd> -</dl> -<p class="Pp">The <b class="Sy">gre</b><var class="Ar">X</var> interfaces - support a number of <a class="Xr">ioctl(2)</a>s, such as:</p> -<dl class="Bl-tag"> - <dt>GRESADDRS:</dt> - <dd>Set the IP address of the local tunnel end. This is the source address set - by or displayed by ifconfig for the - <b class="Sy">gre</b><var class="Ar">X</var> interface.</dd> - <dt>GRESADDRD:</dt> - <dd>Set the IP address of the remote tunnel end. This is the destination - address set by or displayed by ifconfig for the - <b class="Sy">gre</b><var class="Ar">X</var> interface.</dd> - <dt>GREGADDRS:</dt> - <dd>Query the IP address that is set for the local tunnel end. This is the - address the encapsulation header carries as local address (i.e. the real - address of the tunnel start point.)</dd> - <dt>GREGADDRD:</dt> - <dd>Query the IP address that is set for the remote tunnel end. This is the - address the encapsulated packets are sent to (i.e. the real address of the - remote tunnel endpoint.)</dd> - <dt>GRESPROTO:</dt> - <dd>Set the operation mode to the specified IP protocol value. The protocol is - passed to the interface in (struct ifreq)->ifr_flags. The operation - mode can also be given as - <dl class="Bl-tag"> - <dt>link0 link2</dt> - <dd>IPPROTO_UDP</dd> - <dt>link0 -link2</dt> - <dd>IPPROTO_GRE</dd> - <dt>-link0 -link2</dt> - <dd>IPPROTO_MOBILE</dd> - </dl> - <p class="Pp">to <a class="Xr">ifconfig(8)</a>.</p> - </dd> - <dt>GREGPROTO:</dt> - <dd>Query operation mode.</dd> - <dt>GRESSOCK:</dt> - <dd>Delegate a socket from userland to a tunnel interface in UDP encapsulation - mode. The file descriptor for the socket is passed in (struct - ifreq)->ifr_value.</dd> -</dl> -<p class="Pp">Note that the IP addresses of the tunnel endpoints may be the same - as the ones defined with <a class="Xr">ifconfig(8)</a> for the interface (as - if IP is encapsulated), but need not be, as e.g. when encapsulating - AppleTalk.</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="EXAMPLES"><a class="permalink" href="#EXAMPLES">EXAMPLES</a></h1> -<section class="Ss"> -<h2 class="Ss" id="Example_1:_Basic_GRE_tunneling"><a class="permalink" href="#Example_1:_Basic_GRE_tunneling">Example - 1: Basic GRE tunneling</a></h2> -<p class="Pp">Configuration example:</p> -<div class="Bd Pp Li"> -<pre>Host X-- Router A --------------tunnel---------- Router D ----Host E - | | - \ / - +----- Router B ----- Router C --------+</pre> -</div> -<p class="Pp">On Router A (<span class="Ux">NetBSD</span>):</p> -<div class="Bd Pp Li"> -<pre> # route add default B - # ifconfig greN create - # ifconfig greN A D netmask 0xffffffff linkX up - # ifconfig greN tunnel A D - # route add E D</pre> -</div> -<p class="Pp">On Router D (Cisco):</p> -<div class="Bd Pp Li"> -<pre> Interface TunnelX - ip unnumbered D ! e.g. address from Ethernet interface - tunnel source D ! e.g. address from Ethernet interface - tunnel destination A - ip route C <some interface and mask> - ip route A mask C - ip route X mask tunnelX</pre> -</div> -<p class="Pp">or on Router D (<span class="Ux">NetBSD</span>):</p> -<div class="Bd Pp Li"> -<pre> # route add default C - # ifconfig greN create - # ifconfig greN D A - # ifconfig tunnel greN D A</pre> -</div> -<p class="Pp">If all goes well, you should see packets flowing ;-)</p> -<p class="Pp">If you want to reach Router A over the tunnel (from Router D - (Cisco)), then you have to have an alias on Router A for e.g. the Ethernet - interface like:</p> -<div class="Bd Pp Li"> -<pre> ifconfig <etherif> alias Y</pre> -</div> -<p class="Pp">and on the Cisco</p> -<div class="Bd Pp Li"> -<pre> ip route Y mask tunnelX</pre> -</div> -</section> -<section class="Ss"> -<h2 class="Ss" id="Example_2:_Linking_private_subnets"><a class="permalink" href="#Example_2:_Linking_private_subnets">Example - 2: Linking private subnets</a></h2> -<p class="Pp">A similar setup can be used to create a link between two private - networks (for example in the 192.168 subnet) over the Internet:</p> -<div class="Bd Pp Li"> -<pre>192.168.1.* --- Router A -------tunnel-------- Router B --- 192.168.2.* - \ / - \ / - +----- the Internet ------+</pre> -</div> -<p class="Pp">Assuming Router A has the (external) IP address A and the internal - address 192.168.1.1, while Router B has external address B and internal - address 192.168.2.1, the following commands will configure the tunnel:</p> -<p class="Pp">On Router A:</p> -<div class="Bd Pp Li"> -<pre> # ifconfig greN create - # ifconfig greN 192.168.1.1 192.168.2.1 - # ifconfig greN tunnel A B - # route add -net 192.168.2 -netmask 255.255.255.0 192.168.2.1</pre> -</div> -<p class="Pp">On Router B:</p> -<div class="Bd Pp Li"> -<pre> # ifconfig greN create - # ifconfig greN 192.168.2.1 192.168.1.1 - # ifconfig greN tunnel B A - # route add -net 192.168.1 -netmask 255.255.255.0 192.168.1.1</pre> -</div> -</section> -<section class="Ss"> -<h2 class="Ss" id="Example_3:_Encapsulating_GRE_in_UDP"><a class="permalink" href="#Example_3:_Encapsulating_GRE_in_UDP">Example - 3: Encapsulating GRE in UDP</a></h2> -<p class="Pp">To setup the same tunnel as above, but using GRE in UDP - encapsulation instead of GRE encapsulation, set flags - <var class="Ar">link0</var> and <var class="Ar">link2</var>, and specify - source and destination UDP ports.</p> -<p class="Pp">On Router A:</p> -<div class="Bd Pp Li"> -<pre> # ifconfig greN create - # ifconfig greN link0 link2 - # ifconfig greN 192.168.1.1 192.168.2.1 - # ifconfig greN tunnel A,port-A B,port-B - # route add -net 192.168.2 -netmask 255.255.255.0 192.168.2.1</pre> -</div> -<p class="Pp">On Router B:</p> -<div class="Bd Pp Li"> -<pre> # ifconfig greN create - # ifconfig greN link0 link2 - # ifconfig greN 192.168.2.1 192.168.1.1 - # ifconfig greN tunnel B,port-B A,port-A - # route add -net 192.168.1 -netmask 255.255.255.0 192.168.1.1</pre> -</div> -</section> -<section class="Ss"> -<h2 class="Ss" id="Example_4:_Realizing_IPv6_connectivity"><a class="permalink" href="#Example_4:_Realizing_IPv6_connectivity">Example - 4: Realizing IPv6 connectivity</a></h2> -<p class="Pp">Along these lines, you can use GRE tunnels to interconnect two - IPv6 networks over an IPv4 infrastructure, or to hook up to the IPv6 - internet via an IPv4 tunnel to a Cisco router.</p> -<div class="Bd Pp Li"> -<pre>2001:db8:1::/64 -- NetBSD A ---- Tunnel ---- Cisco B --- IPv6 Internet - \ / - \ / - +------ the Internet ------+</pre> -</div> -<p class="Pp">The example will use the following addressing:</p> -<dl class="Bl-hang"> - <dt><span class="Ux">NetBSD</span></dt> - <dd>A has the IPv4 address A and the IPv6 address 2001:db8:1::1 (connects to - internal network 2001:db8:1::/64).</dd> - <dt>Cisco B</dt> - <dd>has external IPv4 address B.</dd> - <dt>All the IPv6 internet world</dt> - <dd>is behind B, so A wants to route 0::0/0 (the IPv6 default route) into the - tunnel.</dd> - <dt>The GRE tunnel</dt> - <dd>will use a transit network: 2001:db8:ffff::1/64 on the - <span class="Ux">NetBSD</span> side, and ::2/64 on the Cisco side.</dd> -</dl> -<p class="Pp">Then the following commands will configure the tunnel:</p> -<p class="Pp">On Router A (<span class="Ux">NetBSD</span>):</p> -<div class="Bd Pp Li"> -<pre> # ifconfig greN create - # ifconfig greN inet6 2001:db8:ffff::1/64 - # ifconfig greN tunnel A B - # route add -inet6 2001:db8:ffff::/64 2001:db8:ffff::2 -ifp greN - # route add -inet6 0::0/0 2001:db8:ffff::2 -ifp greN</pre> -</div> -<p class="Pp">On Router B (Cisco):</p> -<div class="Bd Pp Li"> -<pre> Interface TunnelX - tunnel mode gre ip - ipv6 address 2001:db8:ffff::2/64 ! transfer network - tunnel source B ! e.g. address from LAN interface - tunnel destination A ! where the tunnel is connected to - ipv6 route 2001:db8::/64 TunnelX ! route this network through tunnel</pre> -</div> -</section> -</section> -<section class="Sh"> -<h1 class="Sh" id="NOTES"><a class="permalink" href="#NOTES">NOTES</a></h1> -<p class="Pp">The MTU of <b class="Sy">gre</b><var class="Ar">X</var> interfaces - is set to 1476 by default to match the value used by Cisco routers. This may - not be an optimal value, depending on the link between the two tunnel - endpoints. It can be adjusted via <a class="Xr">ifconfig(8)</a>.</p> -<p class="Pp">There needs to be a route to the decapsulating host that does not - run over the tunnel, as this would be a loop. (This is not relevant for - IPv6-over-IPv4 tunnels, of course.)</p> -<p class="Pp">In order to tell <a class="Xr">ifconfig(8)</a> to actually mark - the interface as up, the keyword “up” must be given last on - its command line.</p> -<p class="Pp" id="GATEWAY">The kernel must be set to forward datagrams by either - option <a class="permalink" href="#GATEWAY"><i class="Em">GATEWAY</i></a> in - the kernel config file or by issuing the appropriate option to - <a class="Xr">sysctl(8)</a>.</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE - ALSO</a></h1> -<p class="Pp"><a class="Xr">atalk(4)</a>, <a class="Xr">gif(4)</a>, - <a class="Xr">inet(4)</a>, <a class="Xr">ip(4)</a>, - <a class="Xr">netintro(4)</a>, <a class="Xr">options(4)</a>, - <a class="Xr">protocols(5)</a>, <a class="Xr">ifconfig(8)</a>, - <a class="Xr">sysctl(8)</a></p> -<p class="Pp">A description of GRE encapsulation can be found in RFC 1701 and - RFC 1702.</p> -<p class="Pp">A description of MOBILE encapsulation can be found in RFC - 2004.</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="AUTHORS"><a class="permalink" href="#AUTHORS">AUTHORS</a></h1> -<p class="Pp"><span class="An">Heiko W.Rupp</span> - <<a class="Mt" href="mailto:hwr@pilhuhn.de">hwr@pilhuhn.de</a>> - <br/> - <span class="An">David Young</span> - <<a class="Mt" href="mailto:dyoung@NetBSD.org">dyoung@NetBSD.org</a>> - (GRE in UDP encapsulation, bug fixes)</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="BUGS"><a class="permalink" href="#BUGS">BUGS</a></h1> -<p class="Pp">The GRE RFCs are not yet fully implemented (no GRE options).</p> -<p class="Pp">The MOBILE encapsulation appears to have been broken since it was - first added to <span class="Ux">NetBSD</span>, until August 2006. It is - known to interoperate with another <code class="Nm">gre</code> in MOBILE - mode, however, it has not been tested for interoperability with any other - implementation of RFC 2004.</p> -<p class="Pp">The <span class="Ux">NetBSD</span> base system does not (yet) - contain a daemon for automatically establishing a UDP tunnel between a host - behind a NAT router and a host on the Internet.</p> -</section> -</div> -<table class="foot"> - <tr> - <td class="foot-date">January 4, 2009</td> - <td class="foot-os">NetBSD 10.1</td> - </tr> -</table> |
