summaryrefslogtreecommitdiff
path: root/net/6to4
diff options
context:
space:
mode:
authorhubertf <hubertf@pkgsrc.org>2002-09-19 22:15:25 +0000
committerhubertf <hubertf@pkgsrc.org>2002-09-19 22:15:25 +0000
commit12d462a1a528439553287a956fb39b93f2b00fbb (patch)
treed08eb953b4dc9d013dc6e8a882fb0280fd37d149 /net/6to4
parent3c4dedd021faed47800f93ad3009038fe58bdb34 (diff)
downloadpkgsrc-12d462a1a528439553287a956fb39b93f2b00fbb.tar.gz
Update 6to4 to 1.3. Change:
- adapt for NetBSD 1.6 and later which needs an "ifconfig stf0 create" (also needed on FreeBSD). Patch contributed by Kimura Fuyuki <fuyuki@hadaly.org> in private mail.
Diffstat (limited to 'net/6to4')
-rw-r--r--net/6to4/Makefile4
-rwxr-xr-xnet/6to4/files/6to436
-rw-r--r--net/6to4/files/6to4.815
-rw-r--r--net/6to4/files/6to4.conf28
-rw-r--r--net/6to4/files/6to4.html90
5 files changed, 121 insertions, 52 deletions
diff --git a/net/6to4/Makefile b/net/6to4/Makefile
index 675f3b57272..87c9500ac30 100644
--- a/net/6to4/Makefile
+++ b/net/6to4/Makefile
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.8 2001/11/22 03:00:07 hubertf Exp $
+# $NetBSD: Makefile,v 1.9 2002/09/19 22:15:25 hubertf Exp $
#
-DISTNAME= 6to4-1.2
+DISTNAME= 6to4-1.3
CATEGORIES= net
MASTER_SITES= # empty
DISTFILES= # empty
diff --git a/net/6to4/files/6to4 b/net/6to4/files/6to4
index 7ce58d73095..29bd4f31381 100755
--- a/net/6to4/files/6to4
+++ b/net/6to4/files/6to4
@@ -1,11 +1,11 @@
-#!@LOCALBASE@/bin/perl
+#!/usr/pkg/bin/perl
#
# Setup 6to4 IPv6, for NetBSD (and maybe others)
#
-# (c) Copyright 2000 Hubert Feyrer <hubert@feyrer.de>
+# (c) Copyright 2000-2002 Hubert Feyrer <hubert@feyrer.de>
#
-$etcdir="@PREFIX@/etc";
+$etcdir="/usr/pkg/etc";
#$etcdir="/usr/pkg/etc"; # debug
require "$etcdir/6to4.conf";
@@ -42,6 +42,9 @@ if ($opt_h) {
exit 0;
}
+# Make sure the interface exists
+system("ifconfig stf0 create >/dev/null 2>&1");
+
#
# Some sanity checks
#
@@ -68,13 +71,28 @@ if ($peer eq "6to4-anycast") {
# magic values from rfc 3068
$remoteadr4 = "192.88.99.1";
$remoteadr6 = "2002:c058:6301::";
-}
-else {
- chomp($remoteadr4 = `host $peer`);
- $remoteadr4 =~ s/^.*address //;
+} else {
+ if ($remoteadr4 !~ /^[0-9.]+$/ ) {
+ chomp($remoteadr4 = `host $peer`);
+ $remoteadr4 =~ s/^.*address //;
+
+ print "resolving IPv4 address of peer $peer\n"
+ if $verbose;
+ } else {
+ print "IPv4 address of peer given numerically, no resolving needed\n"
+ if $verbose;
+ }
- chomp($remoteadr6 = `host -t AAAA $peer`);
- $remoteadr6 =~ s/^.*address //;
+ if ($remoteadr6 !~ /^[0-9a-fA-Z:]+$/ ) {
+ chomp($remoteadr6 = `host -t AAAA $peer`);
+ $remoteadr6 =~ s/^.*address //;
+
+ print "resolving IPv6 address of peer $peer\n"
+ if $verbose;
+ } else {
+ print "IPv6 address of peer given numerically, no resolving needed\n"
+ if $verbose;
+ }
}
diff --git a/net/6to4/files/6to4.8 b/net/6to4/files/6to4.8
index b6d6517e2a4..08a010f348e 100644
--- a/net/6to4/files/6to4.8
+++ b/net/6to4/files/6to4.8
@@ -1,5 +1,5 @@
-.\" $NetBSD: 6to4.8,v 1.5 2001/12/03 19:03:21 wiz Exp $
-.Dd February 18, 2001
+.\" $NetBSD: 6to4.8,v 1.6 2002/09/19 22:15:26 hubertf Exp $
+.Dd July 3, 2002
.Dt 6TO4 8
.Os
.Sh NAME
@@ -160,6 +160,17 @@ via IPv6. A special value of
.Dq 6to4-anycast
can be used for the anycast service defined in RFC 3068.
Other possible values are given in the example config file.
+.It Sy remoteadr4, remoteadr6
+If the
+.Sy peer
+variable is set to the relay router's name, DNS lookups for A and AAAA
+records will be made to
+determine it's IPv4 and IPv6 address. To avoid these lookups, the variables
+.Sy remoteadr4
+and
+.Sy remoteadr6
+can be set to strings containing the numerical IPv4 and IPv6 numbers
+directly.
.El
.Sh EXAMPLES
The
diff --git a/net/6to4/files/6to4.conf b/net/6to4/files/6to4.conf
index 3267a5e8ab8..26947527122 100644
--- a/net/6to4/files/6to4.conf
+++ b/net/6to4/files/6to4.conf
@@ -9,10 +9,26 @@ $v6_innernet="2"; # 2002:x:x:v6_innernet::
$v6_prefixlen=16; # Change for more
$hostbits6=":1"; # should be determined via MAC of $in_if
-# Possible remote 6to4 routers:
+###########################################################################
+#
+# Selection of 6to4 relay router. If "peer" is not set,
+# "remoteadr4" and "remoteadr6" must be set!
+#
+
+# Some possible remote 6to4 routers; DNS lookups will be used
+# to determine their IPv4 and IPv6 adresses (see below on how
+# to avoid these lookups):
$peer="6to4.ipv6.fh-regensburg.de"; # Germany, Europe
-#$peer="6to4-anycast"; # RFC 3068 magic value
-#$peer="asterix.ipv6.bt.com"; # Great Britain, Europe
-#$peer="6to4.kfu.com"; # USA, West coast
-#$peer="6to4.ipv6.microsoft.com"; # USA, West coast
-#$peer="ipv6-router.cisco.com"; # USA, West coast; register at http://www.cisco.com/ipv6/
+#$peer="asterix.ipv6.bt.com"; # Great Britain, Europe
+#$peer="6to4.kfu.com"; # USA, West coast
+#$peer="6to4.ipv6.microsoft.com"; # USA, West coast
+#$peer="ipv6-router.cisco.com"; # USA, West coast; register at http://www.cisco.com/ipv6/
+#$peer="6to4-anycast"; # RFC 3068 magic value
+
+
+# To prevent DNS lookups of peer, directly specify IPv4 and IPv6 address
+# of 6to4 relay router:
+
+# 6to4.ipv6.fh-regensburg.de - Germany, Europe:
+#$remoteadr4="194.95.108.191";
+#$remoteadr6="2002:c25f:6cbf:1::1";
diff --git a/net/6to4/files/6to4.html b/net/6to4/files/6to4.html
index 82cc0e7b73a..8591c371853 100644
--- a/net/6to4/files/6to4.html
+++ b/net/6to4/files/6to4.html
@@ -1,17 +1,17 @@
<html>
<head>
<title>
- February 18, 2001 6to4 8
+ July 3, 2002 6TO4 8
</title>
<style type="text/css">
<!--
body { margin-left:4%; }
- H1 { color: maroon; padding: 4pt; margin-left: -4% }
- H2 { color: maroon; padding: 4pt; margin-left: -4% }
- H3 { color: maroon; padding: 4pt; margin-left: -4% }
- H4 { color: maroon; padding: 4pt; margin-left: -4% }
- H5 { color: maroon; padding: 4pt; margin-left: -4% }
+ H1, H2, H3, H4, H5 {
+ color: maroon; padding: 4pt; margin-left: -4%;
+ border: solid; border-width: thin; width: 100%;
+ background: rgb(204,204,255)
+ }
-->
</style>
</head>
@@ -25,7 +25,7 @@
SYNOPSIS
</h3>
<b>6to4</b>
-[<b></b><b>-vn</b>]
+[<b>-</b><b></b><b>vn</b>]
<i></i><i>command</i>
<h3>
DESCRIPTION
@@ -53,13 +53,13 @@ advertisement for the inside network can be started and stopped.
<p>
Possible options are:
<dl compact>
-<p><dt><b></b><b>-n</b><dd>
+<p><dt><b>-</b><b></b><b>n</b><dd>
Do not. Only print the commands that would be run, but do not execute
them.
-<p><dt><b></b><b>-v</b><dd>
+<p><dt><b>-</b><b></b><b>v</b><dd>
Verbose operation. Print the commands that are about to be run, before
running them. Displays some additional information.
-<p><dt><b></b><b>-h</b><dd>
+<p><dt><b>-</b><b></b><b>h</b><dd>
Show usage.
</dl>
<p>
@@ -67,18 +67,18 @@ Possible commands are:
<dl compact>
<p><dt><b></b><b>start</b><dd>
Configure 6to4 IPv6. The
-<code>stf(4)</code>
+<a href="../html4/stf.html">stf(4)</a>
interface is configured, and a default route to a remote 6to4
gateway is established. In addition, the internal
network interface is assigned an address.
<p><dt><b></b><b>stop</b><dd>
Stops 6to4 IPv6. All addresses are removed from the
-<code>stf(4)</code>
+<a href="../html4/stf.html">stf(4)</a>
device, and the default route is removed.
<p><dt><b></b><b>rtadvd-start</b><dd>
Starts router advertizement and IPv6 packet forwarding,
turning the machine into a IPv6 router.
-<code>rtadvd(8)</code>
+<a href="../html8/rtadvd.html">rtadvd(8)</a>
is invoked with a custom config file created under
<code></code><code>/var/run</code>.
Clients just need to be told to accept router advertizements, i.e.
@@ -92,9 +92,9 @@ in
<code></code><code>/etc/rc.conf</code>.
<p><dt><b></b><b>rtadvd-stop</b><dd>
Stops router advertizement and IPv6 packet forwarding.
-<code>rtadvd(8)</code>
+<a href="../html8/rtadvd.html">rtadvd(8)</a>
is stopped, and the
-<code>rtadvd.conf(5)</code>
+<a href="../html5/rtadvd.conf.html">rtadvd.conf(5)</a>
config file is removed from
<code></code><code>/var/run</code>.
</dl>
@@ -102,10 +102,11 @@ config file is removed from
REQUIREMENTS
</h3>
Besides IPv4 connectivity, you need support for IPv6 and the
-<code>stf(4)</code>
-device in your kernel. While the GENERIC NetBSD 1.5 kernel does
-support IPv6, it does not contain support for the
-<code>stf(4)</code>
+<a href="../html4/stf.html">stf(4)</a>
+device in your kernel. While the GENERIC
+NetBSD
+1.5 kernel does support IPv6, it does not contain support for the
+<a href="../html4/stf.html">stf(4)</a>
device.
<p>
Make sure you have the following options in your kernel config file:
@@ -119,9 +120,10 @@ pseudo-device stf 1 # 6to4 IPv6 over IPv4 encapsulation
</code>
</dl>
<p>
-In systems that run past-1.5 NetBSD-current, you will have to
-explicitly create an
-<code>stf(4)</code>
+In systems that run past-1.5
+NetBSD-current,
+you will have to explicitly create an
+<a href="../html4/stf.html">stf(4)</a>
device after compiling it in the kernel. You do this by running
the following command before calling the
<b>6to4</b>
@@ -146,12 +148,12 @@ command!
</h3>
The
<b>6to4</b>
-script reads it's configuration from a config file named
-<code></code><code>6to4.conf.</code>
+script reads its configuration from a config file named
+<code></code><code>6to4.conf</code>.
The
<code></code><code>6to4.conf</code>
file is in
-<code>perl(1)</code>
+<a href="../html1/perl.html">perl(1)</a>
syntax, and contains several
variables that can be tuned to adjust your setup. Default values
should work for use on a modem dialup.
@@ -186,16 +188,29 @@ addresses.
<p><dt><b></b><b>peer</b><dd>
Name of the remote 6to4 server that'll take our
IPv6-in-IPv4 encapsulated packets and route them on
-via IPv6. Several possible values are given in the
-example config file.
+via IPv6. A special value of
+``6to4-anycast''
+can be used for the anycast service defined in RFC 3068.
+Other possible values are given in the example config file.
+<p><dt><b></b><b>remoteadr4,</b><b> remoteadr6</b><dd>
+If the
+<b></b><b>peer</b>
+variable is set to the relay router's name, DNS lookups for A and AAAA
+records will be made to
+determine it's IPv4 and IPv6 address. To avoid these lookups, the variables
+<b></b><b>remoteadr4</b>
+and
+<b></b><b>remoteadr6</b>
+can be set to strings containing the numerical IPv4 and IPv6 numbers
+directly.
</dl>
<h3>
- EXAMPLE USAGE
+ EXAMPLES
</h3>
The
<b>6to4</b>
script can be run automatically by
-<code>pppd(8)</code>
+<a href="../html8/pppd.html">pppd(8)</a>
when a connection is made. For this, put the following into
<code></code><code>/etc/ppp/ip-up</code>:
<dl compact><dt><dd>
@@ -219,12 +234,14 @@ To shut down properly, put this into
<h3>
SEE ALSO
</h3>
-<code>stf(4)</code>,
+<a href="../html4/stf.html">stf(4)</a>,
``6to4 IPv6 Explained''
at
<code></code><code>http://www.feyrer.de/NetBSD/6to4.html</code>,
-NetBSD IPv6 Documentation at
-<code></code><code>http://www.netbsd.org/Documentation/network/ipv6/</code>.
+NetBSD
+IPv6 Documentation at
+<code></code><code>http://www.netbsd.org/Documentation/network/ipv6/</code>,
+RFC 3068.
<h3>
HISTORY
</h3>
@@ -235,6 +252,13 @@ Hubert Feyrer <hubert@feyrer.de>.
<h3>
BUGS
</h3>
-On systems running past-1.5 NetBSD-current, the
+On systems running past-1.5
+NetBSD-current,
+the
``ifconfig stf0 create''
should be run automatically.
+</font></body>
+</html>
+
+
+