Differences between revisions 2 and 3
Revision 2 as of 2007-09-24 16:42:57
Size: 4267
Editor: mohacsi
Comment:
Revision 3 as of 2007-10-03 17:01:15
Size: 2096
Editor: mohacsi
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
Describe FreeBSD 6to4 konfiguráció here.
Details of the example configuration
=====================================
= FreeBSD 6to4 relay konfiguráció =
Line 5: Line 3:
The example below is assuming that the public IPv4 address in the WAN
interface of the BSD is 192.1.2.3. You should replace that with the right
information for your own case, same with other data used in the example.
[[TableOfContents]]
Line 9: Line 5:
Also, you need to understand how to calculate the 6to4 IPv6 address for your
router. This is done using the IPv4 address and the IPv6 6to4 prefix.
== Követelmények ==
 * Publikus IPv4 cím a relay routernek
 * Saját IPv6 prefix jó IPv6 kijárattal
Line 12: Line 9:
The 6to4 prefix 2002::/16 is taking the first (high order) 16 bits. Then the
bits 17 to 48 are the nibble notation of the IPv4 address. So in our example
it will be:
== 6to4 anycast relay konfiguráció ==
Line 16: Line 11:
192 = c0
1 = 01
2 = 02
3 = 03
=== 6to4 tunnel konfiguráció ===
{{{
    # ifconfig stf create
}}}
    Alapesetben az {{{stf}}} interfész nincsen engedélyezve
Line 21: Line 17:
So consequently:
2002:c001:0203::/48
=== 6to4 cím konfigurálása az interfészre ===
('''Figyelem:''' prefix length 16 kötelező!)
Line 24: Line 20:
We will use the first address of the prefix for the WAN interface, so
2002:c001:0203::1/128

Also, the anycast address for 6to4 is: 192.88.99.1

In the text below, both, the generic commands and example data is used.
{{{
    # ifconfig stf0 inet6 6to4addr prefixlen 16
}}}
Line 32: Line 25:
A) Configure 6to4 tunneling
============================
Line 35: Line 26:
Create an stf interface (in case it doesn't exist): === IPv6 kapcsolat konfigurálása ===
Line 37: Line 28:
    # ifconfig stf create Mivel 6to4 relay-t konfigurálunk szükséges jó IPv6 kapcsolat is (lehet natív, vagy tunnelezett)
Line 39: Line 30:
    By default the stf interface is not enabled. Tegyük fel az IPv6 kapcsolat 2001:db8:1::1 Gateway-en keresztül érhető el a fxp0 interfészen:
IPv6 cím konfigurálása:
{{{
  # ifconfig fxp0 inet6 alias 2001:db8:1::2
}}}
Line 41: Line 36:
Add local 6to4 address to interface (note: prefix length 16 is very
important!)
Default route konfigurálása:
Line 44: Line 38:
    # ifconfig stf0 inet6 6to4addr prefixlen 16 {{{
  # route add -inet6 default 2001:db8:1::1
}}}
Line 46: Line 42:
    # ifconfig stf0 inet6 2002:c001:0203::1 prefixlen 16 == Relay publikálás ==
Line 48: Line 44:
 1. Meg kell hirdetni BGP-n 2002::/16 prefix-et, hogy elérhető a felkonfigurált 6to4 relay IPv6 címén. ( A példában: 2001:db8:1::2 ) Ezáltal a natív IPv6 csomópontok el fogják tudni érni a 6to4 csomópontokat (2002::/16 címűeket).
Line 49: Line 46:
B) Configure IPv6 connectivity
================================
 2. Meg kell hirdetni a 6to4 relay IPv4 anycast címét (192.88.99.1) tipikusan BGP-n a anycast prefixet (192.88.99.0/24) kell meghirdetni. Ezáltal a relay-t automatikusan el kezdik használni a 6to4 csomópontok (2002::/16 című gépek) és továbbításra kerülnek a natív IPv6 csomópontokhoz.
Line 52: Line 48:
Because we are configuring a 6to4 relay it should have IPv6 connectivity
(either native or via a tunnel) through an IPv6 gateway (for our example we
use 2001:7f9:1::1 as GW address). After having configured an IPv6 address on
the corresponding interface, the default route should be configured:
== Konfiguációs fájlba írás ==
Line 57: Line 50:
If our IPv6 interface is interface ne0:

To configure the IPv6 address:

  # ifconfig ne0 inet6 alias 2001:7f9:1::2

To add a default route:

  # route add -inet6 default 2001:7f9:1::1


C) Configure prefix advertisements
===================================

Somewhere on the Relay network, the device in charge of announcing prefixes
(typically a BGP router) should announce 2002::/16 prefix to its IPv6
peerings.

This would allow native IPv6 nodes to reach 6to4 nodes (2002::/16
addresses).

Regarding the IPv4 reachability of the Relay there are two options:

1) Configure the 6to4 anycast IPv4 address (192.88.99.1) and announce the
anycast prefix (192.88.99.0/24) to the site IPv4 peerings.

2) Use another public IPv4 address.

If 1) is chosen 6to4 hosts will be able to find it automatically, with no
need for any manual configuration.

In case of choosing 2) some kind of advertisement of the IPv4 address is
needed (usually a FQDN-Fully Qualified Domain Name) in order to allow others
to configure our relay.

This will allow 6to4 nodes (2002::/16 addresses) to reach native IPv6 nodes
through our relay.


D) Making your configuration persistent
========================================

In order to make your configuration persistent a script could be used to be
executed at boot time. The idea is to have an script that executes all the
commands you need to configure everything as desired.

An example follows, it takes as argument the local host public IPv4
address:
=== Extra scripttel ===
{{{
Line 113: Line 59:
   STF_NET6="$PREFIX48":0000    STF_NET6="$PREFIX48":0001
Line 118: Line 64:
   ifconfig ne0 inet6 alias 2001:7f9:1::2
   route add -inet6 default 2001:7f9:1::1
   ifconfig ne0 inet6 alias 2001:db8:1::2
   route add -inet6 default 2001:db8:1::1
}}}
Line 121: Line 68:
For FreeBSD: === rc.conf fájllal ===
Írjuk be az {{{/etc/rc.conf}}} fájlba:
Line 123: Line 71:
  Set in /etc/rc.conf:
{{{
Line 126: Line 73:

  ipv6_defaultrouter="2001:7f9:1::1"

Configuration examples may vary for other BSD distributions.


Annex A: Remove a 6to4 tunnel using "ip" and a dedicated tunnel device
=======================================================================

Remove a 6to4 interface address

  # ifconfig stf0 inet6 -alias 2002:c001:0203::1

Remove 6to4 prefix route

 First we can see the route table with:

  # netstat -rn

 Now we can delete the route entry for 2002::/16 prefix via <gateway_IPv6>
with:

  # route delete -inet6 2002::/16 <gateway_IPv6>




  ipv6_defaultrouter="2001:db8:1::1"
}}}

FreeBSD 6to4 relay konfiguráció

TableOfContents

Követelmények

  • Publikus IPv4 cím a relay routernek
  • Saját IPv6 prefix jó IPv6 kijárattal

6to4 anycast relay konfiguráció

6to4 tunnel konfiguráció

    # ifconfig stf create
  • Alapesetben az stf interfész nincsen engedélyezve

6to4 cím konfigurálása az interfészre

(Figyelem: prefix length 16 kötelező!)

    # ifconfig stf0 inet6 6to4addr prefixlen 16

IPv6 kapcsolat konfigurálása

Mivel 6to4 relay-t konfigurálunk szükséges jó IPv6 kapcsolat is (lehet natív, vagy tunnelezett)

Tegyük fel az IPv6 kapcsolat 2001:db8:1::1 Gateway-en keresztül érhető el a fxp0 interfészen: IPv6 cím konfigurálása:

  # ifconfig fxp0 inet6 alias 2001:db8:1::2

Default route konfigurálása:

  # route add -inet6 default 2001:db8:1::1

Relay publikálás

  1. Meg kell hirdetni BGP-n 2002::/16 prefix-et, hogy elérhető a felkonfigurált 6to4 relay IPv6 címén. ( A példában: 2001:db8:1::2 ) Ezáltal a natív IPv6 csomópontok el fogják tudni érni a 6to4 csomópontokat (2002::/16 címűeket).
  2. Meg kell hirdetni a 6to4 relay IPv4 anycast címét (192.88.99.1) tipikusan BGP-n a anycast prefixet (192.88.99.0/24) kell meghirdetni. Ezáltal a relay-t automatikusan el kezdik használni a 6to4 csomópontok (2002::/16 című gépek) és továbbításra kerülnek a natív IPv6 csomópontokhoz.

Konfiguációs fájlba írás

Extra scripttel

   #!/bin/sh

   IPV4=$1
   PARTS=`echo $IPV4 | tr . ' '`
   PREFIX48=`printf "2002:%02x%02x:%02x%02x" $PARTS`

   STF_IF="stf0"
   STF_NET6="$PREFIX48":0001
   STF_IP6="$STF_NET6"::1

   ifconfig $STF_IF inet6 $STF_IP6 prefixlen 16 alias

   ifconfig ne0 inet6 alias 2001:db8:1::2
   route add -inet6 default 2001:db8:1::1

rc.conf fájllal

Írjuk be az /etc/rc.conf fájlba:

  stf_interface_ipv4addr="public_v4addr"
  ipv6_defaultrouter="2001:db8:1::1"

Campus6: FreeBSD_6to4_konfiguráció (last edited 2008-09-15 08:24:30 by mohacsi)