# Prefer IPv4 over IPv6



## HalfEatenPie (Feb 22, 2015)

So I'm just going to toss this out there and see if anyone can point me in the right direction.

I just finished setting up the IPv6 tunnel via HE Tunnelbroker for my home connection.  It's absolutely fantastic!  Problem is, HE's IPv6 location closest to me is still pretty far away (network latency-wise).  

I was wondering out of curiosity if anyone knew how to set it up so IPv4 is preferred over IPv6 (e.g. IPv4 fails, it moves to IPv6)?

My router is dd-wrt router (it gets the job done haha) if that matters at all.


----------



## Aldryic C'boas (Feb 22, 2015)

It's your gai.conf.  Just comment out the following line in /etc/gai.conf :


```
precedence ::ffff:0:0/96 100
```


----------



## HalfEatenPie (Feb 22, 2015)

Aldryic C said:


> It's your gai.conf.  Just comment out the following line in /etc/gai.conf :
> 
> 
> precedence ::ffff:0:0/96 100


Thanks.  That would have worked.  If...  I didn't grow frustrated a few minutes later at how terrible the IPv6 traffic was.  Added 100 ms from me to BuyVM Las Vegas between IPv4 and v6, added 300 ms from me to Google, and the straw that broke the camel's back was that it started giving me Google Japan. (since using HE Japan for the tunnel)

Yeah...  Not gonna deal with that.  I foresaw getting Japanese results as something that'd get annoying pretty soon.  

Immediately undid everything I just setup.


----------



## TheLinuxBug (Feb 22, 2015)

The google thing can be adjusted -- I sometimes get this when using proxies -- there is a way to reset Google to use the global version.

I believe this article will help with that.

Now, as far as the latency issues, you'll have to find your own solution to that  :lol:

Cheers!


----------



## HalfEatenPie (Feb 22, 2015)

TheLinuxBug said:


> The google thing can be adjusted -- I sometimes get this when using proxies -- there is a way to reset Google to use the global version.
> 
> I believe this article will help with that.
> 
> ...


Haha yeah, I've setup similar things as that in the past but for this one of the end goals is to make this as painless for everyone else in the house (and guests) and done automatically instead of manually configuring Google.  Either way, IPv6 was more of a novelty and a test than anything. 

While Latency is a killer, oh man that Google thing really annoyed me.


----------



## zed (Feb 22, 2015)

Run a trace to each HE endpoint, might find one with better latency even if physically further out. Er, if you ever feel like revisiting the situation!


----------



## HalfEatenPie (Feb 22, 2015)

zed said:


> Run a trace to each HE endpoint, might find one with better latency even if physically further out. Er, if you ever feel like revisiting the situation!


Haha well already did that before  That's how Japan was chosen originally.  

Originally it was supposed to add 30ms or so to latency (totally workable), but instead it adds about 200ms.  Not so great.


----------

