# Configuring IPv6 with gentoo

## binfu

Hi, ive had plenty of problems trying to get ipv6 to work with my machine. the ipv6 module is working, etc...

has anyone sucessfully completed the task of an ipv6 setup on their machine? care to write a simple tutorial on doing so?

thanks,

  Kyle L.

----------

## mglauche

I did try it once, but i only got simple link-connection with ping and ssh working ....

There are quite a lot programs for ipv6 missing (like the radvd routing advertising daemon) in gentoo, and unfortunately there seems little interest in these things ...

I can make some ebuilds for some of the core packages, and hopefully some 6to4 stuff (when i get it working  :Razz: )

Which point are you stuck exactly ?

----------

## binfu

well, i downloaded the radvd deal, compiled/copied the binary to /bin/sbin and ran tspc -vf tspc.conf. I also did a compile of the latest iptools2, etc...

it returns code 0, 0 being no error, but i still cant ping6 out anywhere. Also, it gives me an error with the -C flag when using radvd.

My cpu fan is currently dead so i cant paste the output. Im headed out the door now to get one.

ifconfig -a shows an ipv6 address along with sit0.

----------

## binfu

ok, after the tspc gets the ipv6 address and outputs the Start of configuration scrpt.

Script: linux.sh

sit0 setup

Setting up link to to 206.123.31.114

Removing old ipv6 address etc.....

... (add garble here)

Removing old ipv6 address etc....

Create new /usr/local/tsp.tsprtadvd.conf

Error while executing /usr/sbin/radvd

  Command: /usr/sbin/radvd -u radvd -C /usr/localtsp/tsprtadvd.conf

Closing, exit status: 0

Exiting with return code : 0 (0 = no error)

----------

## xterminus

radvd isn't necessary unless your machine is going to be acting as a router for other clients running ipv6.  If all that your going to be doing is using your one machine as a single client on freenet6 (or whatever), all you need really need is the freenet6 client (tscp)

I do have a ipv6 'network', so I use radvd on my linux router/firewall.  I didn't have too many problems getting things running - but here is what I did... FYI

Compiled and installed both radvd and tscp, compiled kernel with ipv6 support.   Opened up firewall to allow socket 4343 tcp (freenet negotation i think), and ip protocol 41 (6 to 4 tunneling i think).

In my tscp.conf, I added the username, password, and the three doodads required for routing (host_type=router, prefixlen=48, if_prefix, etc).  The freenet website covered the configuration of tscp.conf fairly well.

fired up tscp.  Now I had a global link address assigned by freenet.  Could ping other boxes (www.kame.net's ipv6 addy, etc) via ping6.

```

eth0      Link encap:Ethernet  HWaddr 00:10:4B:C8:BD:59

          inet addr:12.229.132.40  Bcast:255.255.255.255  Mask:255.255.252.0

          inet6 addr: 3ffe:b80:1149:1::1/64 Scope:Global

          inet6 addr: fe80::210:4bff:fec8:bd59/10 Scope:Link

```

If all your doing as acting as a client with a single ipv6 address - you need not go any further.  

If anyone gets past this point - let me know and I'll go through a radvd configuration as well as setting up your other ethernet interface and establishing routes on any machines behind that router.

I can also post my tscp.conf if needed - not that it's incredably unique.

But really people - this stuff is all covered in the Linux+IPV6-HOWTO ;)[/code]

----------

## binfu

"ping6 hostname" resolves the address, but yet it still wont connect. i AM using NAT here if thats going to be a big issue configuring my system.

----------

## xterminus

To begin with - do you have a valid ipv6 global or network link address even assigned?  (just ifconfig eth0 to find out).

And just so we're on the same page - resolving www.kame.net points to apple.kame.net (3ffe:501:4819:2000:203:47ff:fea5:3085)

You can dig this stuff out by doing a

```
host -t aaaa www.kame.net
```

The easiest way to test ipv6 of course is just to point your browser at www.kame.net.  If the turtle is animated - your working.

If that doesn't work - do a 

```
tcpdump -i eth0 ip6
```

 and watch to make sure that packets (ipv6) are leaving your system.  Now do the same on your sit0 or sit1 interface.  This is your 6to4 tunnel.  Packets leaving?

If your really stuck - try chatting me up in irc.  xterminus on openprojects.

----------

## FINITE

What is ipv6 for, well why is it there I guess should be the question. And where did 5 go? Just currious what the deal is with it.

----------

## xterminus

From the Linux IPV6 HOWTO

 *Quote:*   

> 
> 
> IPv6 is a new layer 3 transport protocol (see linuxports/howto/intro_to_networking/ISO - OSI Model) which will supersede IPv4 (also known as IP). IPv4 was designed long time ago (RFC 760 from January 1980) and since its inception, there have been many requests for more addresses and enhanced capabilities. Major changes in IPv6 are the redesign of the header, including the increase of address size from 32 bits to 128 bits. Because layer 3 is responsible for end-to-end packet transport using packet routing based on addresses, it must include the new IPv6 addresses (source and destination), like IPv4

 

The version number 5 is used for the Stream protocol (ST) which is designed to run alongside IP, with a subset of the IP header in common.  It implements similar (but different) functionality to IP with RSVP, RTP, MPLS, DiffServ and related efforts, but all smashed into a single protocol, and much older.  See IEN119, RFC1190/1819 for details, if you want (but believe me, you don't :-).

----------

## FINITE

Interesting, So ipv6 is completely backward compatible with ipv4. When is ipv6 slated for widspread use or to replace ipv4 if ever? Is it associated with "Internet2"? Sorry for the questions, ill check it out my self just kinda chatting.

----------

## mdpye

 *FINITE wrote:*   

> Interesting, So ipv6 is completely backward compatible with ipv4. When is ipv6 slated for widspread use or to replace ipv4 if ever? 

 

No, it isn't backwards compatible. At the moment, to use IPv6 you "tunnel" it though a v4 connection, so your v6 packets are transmitted via v4 until they reach another network which does support IPv6. Of course eventually we will have a global pure v6 network and v4 will be redundant, but at the moment your ISP probably doesn't support IPv6, so the only way out into the world is via v4.

----------

## whitney-wiliams

I'm having trouble getting the freenet6 tspc client to work (0.9.7)

I've compiled ipv6 options into the kernel (incl. 6over4 support), and compiled/installed the tspc client.

running the client connection program yields: 

<-- CUT HERE -->

--- Start of configuration script. ---

Script:  linux.sh

sit1 setup

Setting up link to 206.123.31.114

SIOGIFINDEX: No such device

Error while executing /sbin/ifconfig

   Command: /sbin/ifconfig sit1 tunnel ::206.123.31.114

Closing, exit status: 0

Exiting with return code : 0 (0 = no error)

<-- CUT HERE -->

Any ideas?

TIA

----------

## wolf31o2

 *xterminus wrote:*   

> 
> 
> If anyone gets past this point - let me know and I'll go through a radvd configuration as well as setting up your other ethernet interface and establishing routes on any machines behind that router.
> 
> 

 I am able to get IPv6 running perfectly on my firewall machine.  It gets the IPv6 /48 that is assigned to me.  I have forwarding enabled.  I have 2 interfaces, eth0 is local, eth1 is internet.  I can assign any IPv6 address within my /48 to my firewall, and it works perfectly, but I cannot get radvd to properly work.  Could you help me out a bit here?

----------

## starb0x

im getting the same error that whitney-wiliams is getting:

```

root@starb0x bin # ./tspc -v

tspc - Tunnel Server Protocol Client

Loading configuration file

Connecting to server

Using [80.212.179.33] as source IPv4 address.

Send request

Process response from server

TSP_HOST_TYPE                    host

TSP_TUNNEL_INTERFACE             sit1

TSP_HOME_INTERFACE               

TSP_CLIENT_ADDRESS_IPV4          80.212.179.33

TSP_CLIENT_ADDRESS_IPV6          3ffe:0bc0:8000:0000:0000:0000:0000:0a71

TSP_SERVER_ADDRESS_IPV4          206.123.31.115

TSP_SERVER_ADDRESS_IPV6          3ffe:0bc0:8000:0000:0000:0000:0000:0a70

TSP_TUNNEL_PREFIXLEN             128

TSP_VERBOSE                      1

TSP_HOME_DIR                     /usr/local/tsp

--- Start of configuration script. ---

Script:  linux.sh

sit1 setup

Setting up link to 206.123.31.115

SIOGIFINDEX: No such device

Error while executing /sbin/ifconfig

   Command: /sbin/ifconfig sit1 tunnel ::206.123.31.115

Exiting with return code : 0 (0 = no error)

```

anyone have a clue?

----------

## heavyt

Had the same error until I set  "if_tunnel=sit0" in  my tspc.conf file  :Exclamation: 

----------

## nutbuckle

anyone know when a new ebuild of freenet6 will be out? I emerged whats in portage but i get this error:

Sep  6 16:37:31 [TSPClient] main: ----- TSP Client Version 1.0.1 Initializing -------------------------

Sep  6 16:37:31 [TSPClient] main: tspc - Tunnel Server Protocol Client 

Sep  6 16:37:31 [TSPClient] main: Loading configuration file 

Sep  6 16:37:31 [TSPClient] main: Connecting to server 

Sep  6 16:37:31 [TSPClient] Authenticate: No success: Authentication failed 

Sep  6 16:37:31 [TSPClient] main: Closing, exit status: 1

I tryed compiling the new version from freenet6.net and i get this error:

Sep  6 16:34:04 [TSPClient] SetUpInterface: Executing configuration script. 

Sep  6 16:34:04 [TSPClient] SetUpInterface: /bin/sh  /home/trcjr/freenet6-client-0.9.9/template/linux.sh

Sep  6 16:34:04 [TSPClient] SetUpInterface:  

Sep  6 16:34:05 [modprobe] modprobe: Can't locate module sit1

--- Start of configuration script. ---

Script:  linux.sh

sit1 setup

Setting up link to 206.123.31.115

/sbin/ifconfig sit1 tunnel ::206.123.31.115

SIOGIFINDEX: No such device

Error while executing /sbin/ifconfig

   Command: /sbin/ifconfig sit1 tunnel ::206.123.31.115

Exiting with return code : 0 (0 = no error)

What is sit1 ? What do I not have compiled in to the kernel?

----------

## masikh

Many people are having difficulties setting up a IPv6 tunnel connection. Maybe this will help people a bit. 

Have fun,

Robert Nagtegaal

```

<snip>

 if ! [ -f /proc/net/if_inet6 ] 

    then echo "ERROR: No IPv6 support in you kernel. Trying to load kernel module." 1>&2; modprobe ipv6;

  fi

<snap>

```

I re-edited this code. See one message below for a proper runscript.

----------

## masikh

See here for a gentoo runlevel script https://forums.gentoo.org/viewtopic.php?t=4732&highlight=ipv6+script for starting a IPv6 Tunnel to a broker.

Can anybody help me make a ebuild from it. I'd like to submit this script to bugs.gentoo.org.

Many Thanks,

Robert Nagtegaal

----------

## Redeeman

IPv6 runs for me, i use freenet6 tunnel broker, i get some errors from tspc client though, but it works  :Wink: 

----------

## ikaro

Hi.

Ive been using ipv6 everyday for a couple of years now.

what i use it the most is for IRC, DNS,HTTPD,FTP,SSHD all use ipv6

Of course you can choose if you want to use v4 or v6.

At  some point, I had 7 tunnels working simultaneouslly.

Thats nice, and gives you 100% connection. if one TB goes down, you can switch to another on the fly  :Smile: 

but at the momment, Iam only using 1 TB from norway, which iam fairlly satisfied with.

this is my script:

in /etc/init.d/tunnels:

```

#!/sbin/runscript

depend() {

        need net

}

start() {

ebegin "starting ipv6 tunnels"

        /usr/bin/tunnels

        eend $? "failed to start ipv6 tunnels"

}

```

then i did 

```
 rc-update add tunnels default
```

to auto start it on boot.

in /usr/bin/tunnels i have the script with the tunnels info:

```

#!/bin/sh

#

# ipv6 multi-tunnel configuration

# last modified on 06-june-2003 by me ( ikaro@bersirc.com )

# this script is for personal use, and the endpoints will therefor

# not work for anyone else, however you can use it if you modify those.

#

# explanation:

#

# ip tunnel add <alias> mode sit local <local ipv4> remote < TB ipv4 > ttl 64

# ip -6 route add 2000::/3 dev <alias> ( sets default route )

# ip -6 route add 2001:abcd:1234:11::/64 dev <alias> ( routing )

# ip -6 addr add 2001:730:11::1:7b/64 dev <alias> ( adds an address )

# http://www.unixcore.com ; location:Europe

ip tunnel add unixc mode sit local 10.0.0.2 remote 213.225.74.2 ttl 64

ip link set unixc up

ip -6 route add 2000::/3 dev unixc

ip -6 route add 2001:730:11::/64 dev unixc

ip -6 addr add 2001:730:11::1:7b/64 dev unixc

it goes on and on ... 

```

*edit*

This script is using my own ip, so it wont work for you.

Just a reminder, so you dont come asking why it doesnt work

*/edit*

Maybe there are other, more simple ways of doing this.

But this works for me, and i never had any problems  :Smile: 

then you can try this url to test it http://[2001:730:11:36::2]

Hope it helps.

----------

## masikh

Your script might work but it doesn't follow the gentoo init standard nor does it do any error checking. Not to say that I made better (that would not be nice) code but I do think it might be worth looking [url]https://forums.gentoo.org/viewtopic.php?t=4732&highlight=ipv6+script[/url]

at. 

Anyway both scripts work. I submitted a gentoo init script to bugs.gentoo.org btw. For anyone interrested.

Have a nice day.

----------

## ikaro

my script does works and i can just add / remove new entries for more tunnels.

Its tested and works.

however iam not a coder  :Very Happy: , and since this is a "private" script, with no intention to send for publishing, i didnt care about if it follows this or that rules.

usually i try to make things work, with less trouble as possible for my situation.  :Smile: 

but your script is nicer and better coded then my own 

and since you intend to make a ebuild and all that, sure it gotta be more complete, which  looks like it is.

 :Rolling Eyes: 

----------

