<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>onvox.net &#187; Andrew Greenwood</title>
	<atom:link href="http://onvox.net/author/arg/feed" rel="self" type="application/rss+xml" />
	<link>http://onvox.net</link>
	<description></description>
	<lastBuildDate>Wed, 06 Apr 2011 15:46:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>How to create 6in4 tunnels in Arch Linux</title>
		<link>http://onvox.net/linux/how-to-create-6in4-tunnels-in-arch-linux</link>
		<comments>http://onvox.net/linux/how-to-create-6in4-tunnels-in-arch-linux#comments</comments>
		<pubDate>Sun, 25 Jan 2009 21:41:16 +0000</pubDate>
		<dc:creator>Andrew Greenwood</dc:creator>
				<category><![CDATA[IPv6]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[6in4]]></category>

		<guid isPermaLink="false">http://onvox.net/?p=131</guid>
		<description><![CDATA[Arch Linux uses a BSD-style network interface configuration located in /etc/rc.conf, which can make exotic network configurations interesting, to say the least. The following rc.d script is meant to help remedy the situation by providing a configurable wrapper to sanely manage a 6in4 link interface. This script uses the route2 method; make sure that the [...]]]></description>
			<content:encoded><![CDATA[<p>Arch Linux uses a BSD-style network interface configuration located in <em>/etc/rc.conf</em>, which can make exotic network configurations interesting, to say the least. The following rc.d script is meant to help remedy the situation by providing a configurable wrapper to sanely manage a 6in4 link interface.</p>
<ul>
<li>This script uses the <em>route2</em> method; make sure that the <strong>iproute2</strong> package is installed.</li>
</ul>
<p>As <em>root</em>, write the following rc.d init script to <em>/etc/rc.d/6in4-tunnel</em>:</p>
<pre>#!/bin/bash

### begin user configuration

##############################################
#                                            #
#  Stop this script before you reconfigure!  #
#                                            #
##############################################

# if_name     - interface name that is to be created for the 6in4 link
if_name=6in4

# server_ipv4 - ipv4 address of the server that is providing the 6in4 tunnel
server_ipv4=127.0.0.1

# client_ipv4 - ipv4 address of the client that is receiving the 6in4 tunnel
client_ipv4=127.0.0.1

# client_ipv6 - ipv6 address of the client 6in4 tunnel endpoint
client_ipv6=2001:feed:face:beef::2/64

# link_mtu    - set the mtu for the 6in4 link
link_mtu=1480

# tunnel_ttl  - set the ttl for the 6in4 tunnel
tunnel_ttl=64

### end user configuration

daemon_name=6in4-tunnel

. /etc/rc.conf
. /etc/rc.d/functions

case "$1" in
  start)
    stat_busy "Starting $daemon_name daemon"

    ifconfig $if_name &amp;&gt;/dev/null
    if [ $? -eq 0 ]; then
      stat_busy "Interface $if_name already exists"
      stat_fail
      exit 1
    fi

    ip tunnel add $if_name mode sit remote $server_ipv4 local $client_ipv4 ttl $tunnel_ttl
    ip link set $if_name up mtu $link_mtu
    ip addr add $client_ipv6 dev $if_name
    ip route add ::/0 dev $if_name

    add_daemon $daemon_name
    stat_done
    ;;

  stop)
    stat_busy "Stopping $daemon_name daemon"

    ifconfig $if_name &amp;&gt;/dev/null
    if [ $? -ne 0 ]; then
      stat_busy "Interface $if_name does not exist"
      stat_fail
      exit 1
    fi

    ip link set $if_name down
    ip tunnel del $if_name

    rm_daemon $daemon_name
    stat_done
    ;;

  *)
    echo "usage: $0 {start|stop}"
esac
exit 0</pre>
<p>You will need to provide your 6in4 link configuration between the following sections of <em>/etc/rc.d/6in4-tunnel</em>:</p>
<pre>### begin user configuration</pre>
<pre>### end user configuration</pre>
<p>Once <em>/etc/rc.d/6in4-tunnel</em> has been configured properly, give it permission to be executed:</p>
<pre># chmod +x /etc/rc.d/6in4-tunnel</pre>
<p>To create the 6in4 tunnel link and bring up the interface:</p>
<pre># /etc/rc.d/6in4-tunnel start</pre>
<p>To delete the 6in4 tunnel link and remove the interface:</p>
<pre># /etc/rc.d/6in4-tunnel stop</pre>
<p>The following method allows <em>/etc/rc.d/6in4-tunnel</em> to start automatically at system startup.</p>
<dl>
<dd>
<ul>
<li> Verify that the 6in4 tunnel link is configured and working properly before doing this!</li>
</ul>
</dd>
</dl>
<p>As <em>root</em>, insert <em>6in4-tunnel</em> right after <em>network</em> in the <strong>DAEMONS</strong> line of <em>/etc/rc.conf</em>.</p>
<p>After this addition, the <strong>DAEMONS</strong> line in <em>/etc/rc.conf</em> should look something like this:</p>
<pre>...

#
# -----------------------------------------------------------------------
# DAEMONS
# -----------------------------------------------------------------------
#
# Daemons to start at boot-up (in this order)
#   - prefix a daemon with a ! to disable it
#   - prefix a daemon with a @ to start it up in the background
#
DAEMONS=(syslog-ng iptables ip6tables network 6in4-tunnel openntpd ...

...</pre>
]]></content:encoded>
			<wfw:commentRss>http://onvox.net/linux/how-to-create-6in4-tunnels-in-arch-linux/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

