2000-07-05 08:42:07 +00:00
|
|
|
.\" $FreeBSD$
|
2001-06-11 12:39:29 +00:00
|
|
|
.\" $KAME: gifconfig.8,v 1.6 2000/11/22 11:10:09 itojun Exp $
|
2000-07-05 08:42:07 +00:00
|
|
|
.\"
|
1999-12-28 02:37:14 +00:00
|
|
|
.\" Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
|
|
|
.\" All rights reserved.
|
2001-07-15 08:06:20 +00:00
|
|
|
.\"
|
1999-12-28 02:37:14 +00:00
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\" 3. Neither the name of the project nor the names of its contributors
|
|
|
|
.\" may be used to endorse or promote products derived from this software
|
|
|
|
.\" without specific prior written permission.
|
2001-07-15 08:06:20 +00:00
|
|
|
.\"
|
1999-12-28 02:37:14 +00:00
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
|
|
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
.\" SUCH DAMAGE.
|
|
|
|
.\"
|
|
|
|
.Dd May 17, 1998
|
|
|
|
.Dt GIFCONFIG 8
|
2000-05-04 17:31:54 +00:00
|
|
|
.Os
|
1999-12-28 02:37:14 +00:00
|
|
|
.Sh NAME
|
|
|
|
.Nm gifconfig
|
|
|
|
.Nd configure generic IP tunnel
|
2001-06-11 12:39:29 +00:00
|
|
|
.\"
|
1999-12-28 02:37:14 +00:00
|
|
|
.Sh SYNOPSIS
|
|
|
|
.Nm
|
|
|
|
.Ar interface
|
|
|
|
.Op Ar af
|
|
|
|
.Op Ar physsrc physdest
|
2000-11-20 20:10:44 +00:00
|
|
|
.Nm
|
2000-07-05 08:42:07 +00:00
|
|
|
.Ar interface
|
|
|
|
.Ic delete
|
2000-11-20 20:10:44 +00:00
|
|
|
.Nm
|
1999-12-28 02:37:14 +00:00
|
|
|
.Fl a
|
|
|
|
.Sh DESCRIPTION
|
2002-07-14 14:47:15 +00:00
|
|
|
The
|
1999-12-28 02:37:14 +00:00
|
|
|
.Nm
|
2002-07-14 14:47:15 +00:00
|
|
|
utility configures the physical address for the generic IP tunnel
|
2002-12-27 12:15:40 +00:00
|
|
|
interface, such as "gif0".
|
1999-12-28 02:37:14 +00:00
|
|
|
Argument
|
|
|
|
.Ar physsrc
|
|
|
|
and
|
|
|
|
.Ar physdest
|
|
|
|
are interpreted as the outer source/destination address for
|
|
|
|
encapsulating IPv4/v6 header.
|
|
|
|
Argument
|
|
|
|
.Ar af
|
|
|
|
specifies the address family for
|
|
|
|
.Ar physsrc
|
|
|
|
and
|
|
|
|
.Ar physdest .
|
2001-06-11 12:39:29 +00:00
|
|
|
.Ar af
|
1999-12-28 02:37:14 +00:00
|
|
|
can be
|
|
|
|
.Li inet
|
|
|
|
or
|
|
|
|
.Li inet6 ,
|
|
|
|
and will be treated as
|
|
|
|
.Li inet
|
|
|
|
if ommitted.
|
|
|
|
.Pp
|
2000-07-05 08:42:07 +00:00
|
|
|
If a special argument
|
|
|
|
.Ic delete
|
|
|
|
is specified,
|
|
|
|
.Nm
|
|
|
|
just deletes the existing source and destination addresses on
|
|
|
|
.Ar interface .
|
|
|
|
If no outer addresses are specified, this usage has no effect.
|
|
|
|
.Pp
|
2002-07-14 14:47:15 +00:00
|
|
|
The
|
1999-12-28 02:37:14 +00:00
|
|
|
.Nm
|
2002-07-14 14:47:15 +00:00
|
|
|
utility takes the following optional argument:
|
1999-12-28 02:37:14 +00:00
|
|
|
.Bl -tag -width Ds
|
|
|
|
.It Fl a
|
2001-06-11 12:39:29 +00:00
|
|
|
Display information associated with all
|
|
|
|
.Xr gif 4
|
|
|
|
interfaces.
|
1999-12-28 02:37:14 +00:00
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
Please note that it is very easy to create infinite routing loop,
|
|
|
|
when you configure tunnel over same address family
|
2001-08-07 15:48:51 +00:00
|
|
|
(e.g. IPv4-over-IPv4).
|
2001-09-28 00:22:44 +00:00
|
|
|
.Pp
|
2001-12-14 22:55:10 +00:00
|
|
|
Each
|
2001-10-01 13:42:41 +00:00
|
|
|
.Xr gif 4
|
2001-12-14 22:55:10 +00:00
|
|
|
interface is created at runtime using interface cloning.
|
|
|
|
This is
|
|
|
|
most easily done with the
|
2001-09-28 00:22:44 +00:00
|
|
|
.Xr ifconfig 8
|
|
|
|
.Cm create
|
2001-12-14 22:55:10 +00:00
|
|
|
command or using the
|
2001-12-21 08:10:28 +00:00
|
|
|
.Va gifconfig_ Ns Aq Ar interface
|
2001-12-14 22:55:10 +00:00
|
|
|
variable in
|
|
|
|
.Xr rc.conf 5 .
|
1999-12-28 02:37:14 +00:00
|
|
|
.Sh EXAMPLES
|
|
|
|
If you would like to configure IPv6 over IPv4
|
2001-08-07 15:48:51 +00:00
|
|
|
(aka IPv6 in IPv4)
|
1999-12-28 02:37:14 +00:00
|
|
|
tunnel between
|
|
|
|
.Li 10.1.1.1
|
|
|
|
and
|
|
|
|
.Li 10.2.3.4 ,
|
|
|
|
you should perform the following command:
|
|
|
|
.Bd -literal -offset
|
|
|
|
# gifconfig gif0 inet 10.1.1.1 10.2.3.4
|
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
.\" To use the
|
|
|
|
.\" .Li 0.0.0.0
|
|
|
|
.\" feature to establish a tunnel from host1 to host3
|
|
|
|
.\" which will encapsulate and carry packets from host2, on host1 do:
|
|
|
|
.\" .Bd -literal -offset
|
|
|
|
.\" # ifconfig gif0 inet host1 127.0.0.2 # assign an address to gif0
|
|
|
|
.\" # gifconfig gif0 inet host1 0.0.0.0 # assign encapsulation addresses
|
|
|
|
.\" # route add host2 host3 -ifp gif0: # encap host2 packets, send to host3
|
|
|
|
.\" .Ed
|
|
|
|
.\" .Pp
|
|
|
|
.\" Note: the
|
|
|
|
.\" .Fl ifp
|
|
|
|
.\" option to route does not work as documented in
|
|
|
|
.\" most versions of FreeBSD.
|
|
|
|
.\" .Pp
|
|
|
|
.\" On host3 do:
|
|
|
|
.\" .Bd -literal -offset
|
|
|
|
.\" # ifconfig gif0 inet host3 127.0.0.2 # assign an address to gif0
|
|
|
|
.\" # gifconfig gif0 inet host3 0.0.0.0 # assign encapsulation addresses
|
|
|
|
.\" .Ed
|
|
|
|
.\" .Pp
|
|
|
|
.\" Now if you ping host2 from host1, the packets should be encapsulated
|
|
|
|
.\" with outer source address = host1 and outer destination address = host3,
|
|
|
|
.\" and delivered to host3.
|
|
|
|
.\" host3 will decapsulate the packet and deliver it normally to host2.
|
|
|
|
.\" .Pp
|
|
|
|
This is also possible to use IPv6 as outer proto, by replacing
|
|
|
|
.Li inet
|
|
|
|
to
|
|
|
|
.Li inet6 ,
|
|
|
|
and IPv4 addresses to some appropriate IPv6 addresses in above example.
|
|
|
|
.Sh RETURN VALUES
|
|
|
|
The command exits with exit status of 1 on errors, 0 on success.
|
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr gif 4 ,
|
|
|
|
.Xr ifconfig 8
|
|
|
|
.Sh HISTORY
|
|
|
|
The
|
|
|
|
.Nm
|
2002-07-14 14:47:15 +00:00
|
|
|
utility first appeared in WIDE Hydrangea IPv6 protocol stack kit.
|
2000-05-04 17:31:54 +00:00
|
|
|
.Pp
|
|
|
|
IPv6 and IPsec support based on the KAME Project (http://www.kame.net/) stack
|
2000-05-06 14:20:07 +00:00
|
|
|
was initially integrated into
|
2000-05-04 17:31:54 +00:00
|
|
|
.Fx 4.0
|