# native IPv6 and miredo coexisting problem



## haohaolee (Jun 27, 2011)

I have a native IPv6 setting that worked well until I installed the miredo client. After starting the miredo daemon, it will create a new default route overriding the original one. My intention is to use miredo to connect to other teredo nodes, not for IPv6 surfing.

And, according to the miredo.conf:


```
NOTE:  Use  of Miredo as a Teredo client is possible even if the
              system  already  has  IPv6  connectivity  through  another   way
              (native, 6to4, TSP, etc). In that case, Miredo will only be used
              to reach other Teredo clients, as its tunneling interface has  a
              default route with a higher metric (which is to say a lower pri-
              ority) than the other network interfaces.
```

So I'm sure it can work that way, and it did work on my other (Linux) box. Any suggestion is appreciated.


----------



## tingo (Jun 27, 2011)

So, what are the metrics for the routes involved?


----------



## haohaolee (Jun 28, 2011)

tingo said:
			
		

> So, what are the metrics for the routes involved?



It seems there is no routing metric concept in FreeBSD, so I cannot use different default routes with different metrics.


----------



## tingo (Jul 2, 2011)

How about posting the output of `# netstat -r`?

Why do you think that you can have more than one *default* route?


----------



## haohaolee (Jul 3, 2011)

tingo said:
			
		

> How about posting the output of `# netstat -r`?
> 
> Why do you think that you can have more than one *default* route?



Sorry, it's a concept on other platform. Maybe the correct question is how to make balance route when having multi-interface


----------



## tingo (Jul 3, 2011)

Another platform than FreeBSD? If so, why are you asking this question in a FreeBSD forum?


----------



## DutchDaemon (Jul 4, 2011)

Look at things like lagg(4), setfib(1), setfib(2). Not sure what you're looking for exactly.


----------



## haohaolee (Jul 4, 2011)

tingo said:
			
		

> Another platform than FreeBSD? If so, why are you asking this question in a FreeBSD forum?



I'm new to FreeBSD, so I thought it would have the same concept. Never mind, I solved this specific problem myself.

Miredo has a script called client-hook, which is called when teredo tunnel is established and is to set up routing:


```
....
case "$STATE" in
        up)
                "$IFCONFIG" "$IFACE" up
                "$IFCONFIG" "$IFACE" inet6 "${LLADDRESS}/64"
                "$IFCONFIG" "$IFACE" inet6 "${ADDRESS}/32"
                "$ROUTE" delete -inet6 default
                "$ROUTE" add -inet6 default -iface "$IFACE"
                ;;
.....
```

I just commented out two lines of the above to make mine work.

BTW, this script on other platforms like Linux does not delete default route, but adds another default route with different metric. I think this is why the default install on Linux seems all right.


----------



## ecazamir (Jul 4, 2011)

FreeBSD does not allow at this time to have multiple routes to the same destination on a single FIB (Forward Information Base, routing table). 
If you need to reach some destination using multiple paths, one solution can be 'pf', which is able to override kernel's routing table on a single FIB and it allows use of multiple routes to the same destination network/mask.
If you need to use 'metrics', /usr/ports/net/quagga's zebra routing daemon can be helpful.


----------

