Is ipv6_addrs_<NIC> supported?

Hi,

I changed my alias-configuration syntax to
Code:
ipv4_addrs_<NIC>
-Syntax. In the default configuration I can't find the IPv6 equivalent.

Is
Code:
ipv6_addrs_<NIC>
supported already? I currently have no machine to test it.

Thanks.
 
But this is not for alias configuration. This is to assign an IPv6 address, right?
 
Ben said:
But this is not for alias configuration. This is to assign an IPv6 address, right?

Correct, if you need an alias there is no difference in the syntax:

Code:
ifconfig_<NIC>_alias0="inet6 XXXX:XXXX:XXXX:XXXX::X"
 
Yes, this is the deprecated syntax which is not handy to use any more (a lot of aliases). That's why I switched to the other Syntax.

Just I can't find the equivalent for IPv6. That's a petty and inconsitent :(
 
Try the attached patch for /etc/network.subr. If it works it should allow you to write the ipv6 aliases this way:

Code:
ipv6_addrs_re0="2001:db8:1111:2222::1/64 2001:db8:1111:2222::2/64 "

This is not supported yet:

Code:
ipv6_addrs_re0="2001:db8:1111:2222::1 prefixlen 64"


Oh and this patch is against r242187 of /etc/network.subr in 9-STABLE. I don't know if it applies to 9.0-RELEASE or 9.1-RELEASE.
 

Attachments

  • network.subr_ipv6_addrs.patch
    1,009 bytes · Views: 223
  • Thanks
Reactions: Ben
Oh, thanks for the patch.

Is this going to be available in an upcoming 9.0-Release or 9.1 earliest?

Very nice, thanks!
 
This is still my own private hacking :p If it works I'll see if I could get it commited to HEAD and 9-STABLE.
 
By the way, 9.0-RELEASE and 9.1-RELEASE are feature locked so this type of enhancements that add new functionality are not going to make into them. 9.2-RELEASE it's certainly possible if my patch gets accepted to 9-STABLE.

I'll see if I can do any improvements, there's not a lot of error checking, not even in the original code I used as the starting point.
 
Patch updated in the PR, it's now possible to use ranges like this:

Code:
ipv6_addrs_re0="2001:db8:1111:2222::2-4/64 2001:db8:1111:2222::9-f/64"

It also allows silly ranges like:

Code:
2001:db8:1111:2222::1-ffff/64

Use with caution :)
 
  • Thanks
Reactions: Ben
My patch is getting more intrusive because I have to modify few more functions in network.subr. I have put up the patch at github as

https://gist.github.com/4362018

With this version it should be possible to assign all IPv6 addresses on an interface with a single setting in rc.conf(5)

Code:
ipv6_addrs_re0="2001:db8:1111:2222::1-4/64"

Previously there had to be ipv6_interfaces or ifconfig_IF_ipv6 for ipv6_addrs_IF to work.
 
Back
Top