Bump date for previous. Remove trailing whitespace.

New sentence, new line. Fix some macro usage.
This commit is contained in:
wiz 2005-03-30 18:53:33 +00:00
parent aaf71fc067
commit e0ed5c846b
1 changed files with 48 additions and 38 deletions

View File

@ -1,4 +1,4 @@
.\" $NetBSD: gre.4,v 1.30 2005/03/30 17:19:52 is Exp $
.\" $NetBSD: gre.4,v 1.31 2005/03/30 18:53:33 wiz Exp $
.\"
.\" Copyright 1998 (c) The NetBSD Foundation, Inc.
.\" All rights reserved.
@ -34,7 +34,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd June 9, 2002
.Dd March 30, 2005
.Dt GRE 4
.Os
.Sh NAME
@ -46,7 +46,8 @@
The
.Nm gre
network interface pseudo device encapsulates datagrams
into IP. These encapsulated datagrams are routed to a destination host,
into IP.
These encapsulated datagrams are routed to a destination host,
where they are decapsulated and further routed to their final destination.
The
.Dq tunnel
@ -64,17 +65,19 @@ This driver currently supports the following modes of operation:
.Bl -tag -width abc
.It GRE encapsulation (IP protocol number 47)
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
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
.Sy gre Ns Ar X
interfaces.
.It MOBILE encapsulation (IP protocol number 55)
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
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
.Xr gif 4 ,
only for IP in IP encapsulation.
.El
@ -86,26 +89,26 @@ interfaces support a number of
such as:
.Bl -tag -width aaa
.It GRESADDRS :
Set the IP address of the local tunnel end. This is the source address
set by or displayed by ifconfig for the
Set the IP address of the local tunnel end.
This is the source address set by or displayed by ifconfig for the
.Sy gre Ns Ar X
interface.
.It GRESADDRD :
Set the IP address of the remote tunnel end. This is the destination address
set by or displayed by ifconfig for the
Set the IP address of the remote tunnel end.
This is the destination address set by or displayed by ifconfig for the
.Sy gre Ns Ar X
interface.
.It GREGADDRS :
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.)
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.)
.It GREGADDRD :
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.)
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.)
.It GRESPROTO :
Set the operation mode to the specified IP protocol value. The
protocol is passed to the interface in (struct ifreq)-\*[Gt]ifr_flags.
Set the operation mode to the specified IP protocol value.
The protocol is passed to the interface in (struct ifreq)-\*[Gt]ifr_flags.
The operation mode can also be given as
.Bl -tag -width link0xxx
.It link0
@ -139,7 +142,7 @@ Host X-- Host A ----------------tunnel---------- cisco D------Host E
+------Host B----------Host C----------+
.Ed
On host A
.Ns ( Nx ) :
.Pq Nx :
.Bd -literal
# route add default B
# ifconfig greN create
@ -159,7 +162,7 @@ On Host D (Cisco):
.Ed
OR
On Host D
.Ns ( Nx ) :
.Pq Nx :
.Bd -literal
# route add default C
# ifconfig greN create
@ -211,7 +214,7 @@ Note that this is a safe situation where the link1 flag (as discussed in the
.Sx BUGS
section below) may (and probably should) be set.
.Pp
Along these lines, you can use GRE tunnels to interconnect two IPv6
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.
.Bd -literal
@ -221,19 +224,25 @@ via an IPv4 tunnel to a Cisco router.
+----- the Internet ------+
.Ed
The example will use the following addressing: NetBSD A has the
The example will use the following addressing:
.Nx
A has the
IPv4 address A and the IPv6 address 2001:db8:1::1 (connects to internal
network 2001:db8:1::/64). Cisco B has external IPv4 address B. All
the IPv6 internet world is behind B, so A wants to route 0::0/0 (the IPv6
default route) into the tunnel. The GRE tunnel will use a transit
network: 2001:db8:ffff::1/64 on the NetBSD side, and ::2/64 on the Cisco
side.
network 2001:db8:1::/64).
Cisco B has external IPv4 address B.
All the IPv6 internet world is behind B, so A wants to route 0::0/0
(the IPv6 default route) into the tunnel.
The GRE tunnel will use a transit network: 2001:db8:ffff::1/64 on
the
,Nx
side, and ::2/64 on the Cisco side.
Then the following commands will configure the tunnel:
.Pp
On router A (NetBSD):
On router A
.Pq Nx :
.Bd -literal
# ifconfig greN create
# ifconfig greN inet6 2001:db8:ffff::1/64
# 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
@ -257,7 +266,8 @@ The MTU of
.Sy gre Ns Ar X
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
endpoints.
It can be adjusted via
.Xr ifconfig 8 .
.Pp
For correct operation, the
@ -265,8 +275,8 @@ For correct operation, the
device needs a route to the destination that is less specific than the
one over the tunnel.
(Basically, 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.)
does not run over the tunnel, as this would be a loop.
This is not relevant for IPv6-over-IPv4 tunnels, of course.)
If the addresses are ambiguous, doing the
.Xr ifconfig 8
.Li tunnel
@ -305,8 +315,8 @@ A description of MOBILE encapsulation can be found in RFC 2004.
.Sh BUGS
The compute_route() code in if_gre.c toggles the last bit of the
IP-address to provoke the search for a less specific route than the
one directly over the tunnel to prevent loops. This is possibly not
the best solution.
one directly over the tunnel to prevent loops.
This is possibly not the best solution.
.Pp
To avoid the address munging described above, turn on the link1 flag
on the