# IPv6 6to4 Behind NAT (miredo)

## Sakkath

According to http://gentoo-wiki.com/HOWTO_IPv6, I need miredo to get 6to4 working behind NAT. The example conf uses an interface called 'teredo,' but that didn't work when I issued /etc/init.d/net.6to4 start, it said:

```
 *       No global IPv4 addresses found on interface eth0                 [ !! ]
```

I even tried the directive "InterfaceName eth0" and "6to4" same errors. Maybe I've messed up the conf somewhere else, I wouldn't be sure though, it all looks nice and the miredo process is running. With "InterfaceName teredo" the iface "teredo" is successfully created.

----------

## Sakkath

Come one, someone must have used a teredo client or miredo  :Sad: .

I'm "Apprentice" now, I miss being "Tux's Lil' Helper"  :Sad: .

----------

## wiflye81

To use a 6to4 script, your gentoo must be connected directly on your cable or dsl modem.

For me, miredo work out of the box with the source provide on the author website.

The last solution is to set a tunnel to access ipv6 from your computer which is behind the router

and share it with radvd for example.

----------

## Sakkath

I wonder why miredo doesn't work then, that's really what this post is about.

I'm not sure what radvd does.

And yes, this box IS behind NAT, that's why I know the regular 6to4 script won't work and I need miredo  :Smile: .

Thanks for the reply.

----------

## wiflye81

Miredo is running and you don't have an ipv6 access ?

Can you post your ifconfig ?

----------

## Sakkath

```
loki ~ # ifconfig

eth0      Link encap:Ethernet  HWaddr 00:14:BF:57:20:53

          inet addr:192.168.1.45  Bcast:192.168.1.255  Mask:255.255.255.0

          inet6 addr: fe80::214:bfff:fe57:2053/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:42994881 errors:0 dropped:0 overruns:0 frame:0

          TX packets:42041801 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:10272846558 (9796.9 Mb)  TX bytes:26618502635 (25385.3 Mb)

          Interrupt:169 Base address:0x2000

lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1/128 Scope:Host

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:1999031 errors:0 dropped:0 overruns:0 frame:0

          TX packets:1999031 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:13736865145 (13100.4 Mb)  TX bytes:13736865145 (13100.4 Mb)

teredo    Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00                                                                                                 -00

          inet6 addr: fe80::ffff:ffff:ffff/64 Scope:Link

          inet6 addr: 2001:0:53aa:64c:0:6a88:b737:402b/32 Scope:Global

          UP POINTOPOINT RUNNING NOARP  MTU:1280  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:3 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:500

          RX bytes:0 (0.0 b)  TX bytes:144 (144.0 b)

tun0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00                                                                                                 -00

          inet addr:10.8.88.6  P-t-P:10.8.88.5  Mask:255.255.255.255

          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:100

          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

loki ~ #

```

```
loki ~ # ps -eF|grep miredo

root     17716     1  0  2785   384   0 Feb26 ?        00:00:00 miredo

nobody   17717 17716  0 13566   556   0 Feb26 ?        00:00:00 miredo

root     17719 17717  0  2785   164   0 Feb26 ?        00:00:00 miredo

root     12094 11980  0   657   552   0 18:13 pts/8    00:00:00 grep --colour=auto miredo

loki ~ #
```

```
loki ~ # /etc/init.d/net.6to4 start

 * Starting 6to4

 *   Bringing up 6to4

 *     ip6to4

 *       No global IPv4 addresses found on interface eth0                                                                                                                  [ !! ]

loki ~ #

```

Hope that helps.

Thanks again for your help.

----------

## wiflye81

Ok, so miredo is working and at this moment I'm pretty sure you have ipv6 access, try ping6 www.ipv6tf.org to be sure.

When using teredo or miredo you don't have to use the 6to4 script, you can only use it when you are not behind a nat

and in your case it's useless.

----------

## Sakkath

Oh, I see.  I thought miredo was a way to make the 6to4 script work from behind NAT.

So this is still 6to4?  Can I get a prefix with miredo?  At *least* a /64?

----------

## wiflye81

Teredo mechanism provide a prefix : 3FFE:831F::/32 but I don't know how to configure radvd for it.

Personnaly I recommend you to use 6to4 (if you can use a pc as a gateway) or a tunnel (some script auto configure tunnel and radvd   :Very Happy:  ).

----------

## Sakkath

Naw, this server at my friends and he doesn't have a spare box to use as a gateway, he has a Betgear router.  We are going to do some rerouting and make this box his MAIN router then have the Netgear route after that, too bad you can't set it to be just a switch like you can with my old old Belkin.  Netgear sucks!

Even if I *could* have gotten the /32 to work, that would be nice  :Sad: .

----------

## Sakkath

Anyone know how to do this?

----------

## devurandom

I am behind a NAT as well and have tried 2 setups: AICCU and Miredo. Results are the same for both: Pinging a hostname fails. With Miredo even pinging a IP6 address fails, while it works with AICCU.

First setup: AICCU:

 *Quote:*   

> 
> 
> # ip -6 link
> 
> 1: lo: <LOOPBACK,UP,10000> mtu 16436 qdisc noqueue
> ...

 

 *Quote:*   

> 
> 
> # ip -6 addr
> 
> 1: lo: <LOOPBACK,UP,10000> mtu 16436
> ...

 

 *Quote:*   

> 
> 
> # ip -6 route
> 
> 2001:6f8:900:60d::/64 dev sixxs  metric 256  expires 21334344sec mtu 1280 advmss 1220 hoplimit 4294967295
> ...

 

 *Quote:*   

> 
> 
> # ping6 www.kame.net
> 
> connect: Network is unreachable
> ...

 

Second setup: Miredo:

 *Quote:*   

> 
> 
> # ip -6 link
> 
> 1: lo: <LOOPBACK,UP,10000> mtu 16436 qdisc noqueue
> ...

 

 *Quote:*   

> 
> 
> # ip -6 addr
> 
> 1: lo: <LOOPBACK,UP,10000> mtu 16436
> ...

 

 *Quote:*   

> 
> 
> # ip -6 route
> 
> 2001::/32 dev teredo  metric 256  expires 21333931sec mtu 1280 advmss 1220 hoplimit 4294967295
> ...

 

 *Quote:*   

> 
> 
> # ping6 www.ipv6tf.org
> 
> connect: Network is unreachable
> ...

 Last edited by devurandom on Thu May 03, 2007 9:58 am; edited 1 time in total

----------

## UberLord

Sounds like AICCU works fine.

But for both you're unable to resolve IPv6 DNS names

See what dig says for you.

```
roy@ds01 ~ $ dig AAAA www.kame.net

; <<>> DiG 9.3.4 <<>> AAAA www.kame.net

;; global options:  printcmd

;; Got answer:

;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 7120

;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 0

;; QUESTION SECTION:

;www.kame.net.                  IN      AAAA

;; ANSWER SECTION:

www.kame.net.           86382   IN      AAAA    2001:200:0:8002:203:47ff:fea5:3085

;; AUTHORITY SECTION:

kame.net.               86382   IN      NS      ns1.itojun.org.

kame.net.               86382   IN      NS      orange.kame.net.

;; Query time: 1 msec

;; SERVER: 127.0.0.1#53(127.0.0.1)

;; WHEN: Thu May  3 10:51:34 2007

;; MSG SIZE  rcvd: 107

```

----------

## devurandom

Thanks for the quick reply.

 *Quote:*   

> 
> 
> # dig AAAA www.kame.net
> 
> ; <<>> DiG 9.4.1 <<>> AAAA www.kame.net
> ...

 

----------

## Sakkath

Well, I guess I'll try out AICCU.  Thanks for replying on my thread; otherwise I never would have known what to do.  I want an IPv6 address I can bind to, essentially; possibly with rDNS.

----------

## devurandom

In case you get it to work: Please report back with detailed info how you did it. Maybe I am just missing something...

And AICCU is actually not a 6to4 client, but a client for the SixXS network.

----------

## UberLord

Maybe you're missing a route? My routing table is similar, but I have this entry also

```
2000::/3 dev 6to4
```

So you would do

```
ip route add 2000::/3 dev sixxs
```

----------

## devurandom

I have no idea what changed, but it suddenly started working.

I added

 *Quote:*   

> routes_sixxs=( "::/0 dev sixxs" )

 

to conf.d/net, but even when removing that line it keeps working (after restarting net.eth0 and thus aiccu).

I was reading http://www.feyrer.de/IPv6/ueberreuter-6to4.html for how to setup manual 6to4 routes (I used the anycast address 192.88.99.1 instead), but even after rebooting to remove all the changes I did, it is still working...

BTW: That worked, too, partly. I was able to resolve ip6 addresses. Just pinging didn't work. Either because I didn't manage to setup the routes in the correct way, or because of the NAT.

I will probably get banned for posting this link, but the article seems interesting for newbs (like me):

http://www.microsoft.com/germany/technet/datenbank/articles/600330.mspx

http://www.microsoft.com/technet/prodtechnol/winxppro/maintain/teredo.mspx

----------

## Sakkath

Oh, I kind of liked the idea of 6to4.  SixXS doesn't like IRC I don't think.

----------

## devurandom

I don't know about IRC servers, but till now they didn't complain and their FAQ doesn't say they forbid it, just ask you to not abuse it.

But if you run an IRC server, 6to4 should work fairly easy (it did on mine), since you usually are not behind a NAT.

----------

## Sakkath

I couldn't figure out how to get a specific IP to work with miredo (obviously 6to4 initscript won't work because I am behind NAT) and how to bind to that IP and set rDNS.

----------

