# kernel: udp6_output: IPV6_V6ONLY option was set for a connected socket



## Ben (Dec 14, 2012)

Hi,

I am trying to implement IPv6 step by step and since I started I have this log entry filling my logfiles:



> kernel: udp6_output: IPV6_V6ONLY option was set for a connected socket



How can I find out what's causing this? [CMD="sockstat -6"][/CMD] only tells me that Varnish is listening on a IPv6 address, besides nothing.

Can anybody help me out?


----------



## SirDice (Dec 14, 2012)

I think this is caused by something that's compiled with IPv6 support only. When it tries to contact an IPv4 address it needs to use an IPv4 mapped IPv6 address. This is turned off by default.


```
ipv6_ipv4mapping="NO"           # Set to "YES" to enable IPv4 mapped IPv6 addr
                                # communication. (like ::ffff:a.b.c.d)
```

Unless you are planning on an IPv6 only network I suggest enabling both IPv4 and IPv6 (IPv6 will take precedence).


----------



## Ben (Dec 14, 2012)

Ok, so I need to set this to YES, right, in order to support both.

Thanks.

UPDATE: I set [CMD="sysctl net.inet6.ip6.v6only=0"][/CMD] and will check what happens now. Thanks!


----------



## SirDice (Dec 14, 2012)

No, you don't really need it. I have both IPv4 and IPv6 enabled but have this turned off. As long as both stacks are available it'll use the IPv4 stack for IPv4. It should only be needed to access IPv4 addresses if you are on IPv6 only.


----------



## Ben (Dec 14, 2012)

Strange. I am using both at the same time, even I use ::ffff:127.0.0.0 for internal addresses.

I will keep an eye on it.


----------



## SirDice (Dec 14, 2012)

Ben said:
			
		

> Strange. I am using both at the same time, even I use ::ffff:127.0.0.0 for internal addresses.


That's an IPv4 mapped IPv6 address, use ::1.


----------



## Ben (Dec 14, 2012)

I have jails using 127.0.0.10-15 for example. I also assigned ::ffff:127.0.0.10-15. This is not ok?

I thought this way I can access the jails via IPv6 easily and keeping it simple.


----------



## SirDice (Dec 14, 2012)

Just use your global addresses for it. I'm guessing you received a /64 or even a /48, so you'll have plenty of IP addresses to spare.


----------



## Ben (Dec 14, 2012)

Yes I have a /64 but I was hoping to keep it clean and "easy to handle".


----------



## bbzz (Dec 14, 2012)

Ben said:
			
		

> How can I find out what's causing this? [CMD="sockstat -6"][/CMD] only tells me that Varnish is listening on a IPv6 address, besides nothing.



http://tools.ietf.org/html/rfc3493#page-22

In other words, it's the flag used to specify that socket will use only IPv6.


----------



## SirDice (Dec 14, 2012)

Those ::ffff:a.b.c.d addresses are for accessing IPv4 addresses from IPv6. If you're going to use IPv6 you might as well assign them a proper IPv6 address. Since there's no need for something like NAT this is in fact the easiest to handle. Jails can have both an IPv4 address and an IPv6 address.


----------



## bbzz (Dec 14, 2012)

Ben said:
			
		

> Yes I have a /64 but I was hoping to keep it clean and "easy to handle".



Forget about IPv4 addresses if you are using IPv6. The global range you received should be 2001::/64 or similar. Keep in mind no need for nat so be sure to know what you'r doing.


----------

