LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   IPv6 on Slackware 13.1 (http://www.linuxquestions.org/questions/slackware-14/ipv6-on-slackware-13-1-a-842553/)

Skaperen 11-05-2010 10:47 AM

IPv6 on Slackware 13.1
 
I'm setting up a Slackware 13.1 box for IPv6. This is just IPv6 within the LAN right now, not to the internet or a tunnel. The IPv6 addresses are static (although the auto-configured link-local addresses will be used, too).

Manually configuring with "ifconfig" works fine. Now I need to make it persistent. I could script this a couple ways. I could make an rc.local to just do the commands and there I am. Or I could hack the scripts to do it "the slackware way" (e.g. so the addresses are given in the /etc/rc.d/rc.inet1.conf file). That would have to be a hack to the /etc/rc.d/rc.inet1 script.

Any suggestions on how you think it should be done?

I'm not asking how to make it work. I can do that. This question is about how I should go about making it so others can readily use what I make. So it's more like "what would you need of this if you were doing some IPv6?".

I did this in Ubuntu a few months ago by adding on a whole new script I wrote and running it from within the numbered init scripts. It used a whole new file I called "/etc/network/aliases". I'd like to avoid so much of an abrupt change in Slackware. But I am at the crossroads in the decision process, and open to influences.

jovanoti 11-05-2010 11:25 AM

Well, I personally prefer not to change system scripts if they do not support given feature, IPv6 in this case. Thus they my configuration won't break when I decide to upgrade Slackware. I will make it as additional script which will add IPv6 addresses - either using ifconfig or ip.

qweasd 11-05-2010 11:53 AM

I was fiddling with IPv6 the other day, and when I brought it up (alongside IPv4), BIND decided to use it for lookup every now and then, and would just stop doing anything for a minute or so. But running it as /usr/sbin/named -4 worked fine.

mlangdn 11-05-2010 01:13 PM

In my opinion, hand-editing config files or scripts IS the Slackware way. I would go with rc.local simply because its the easiest when upgrading.

Skaperen 11-05-2010 02:44 PM

Doing this in rc.local would be the "modify my system relative to Slackware way" for sure. BTDT ... often. And I've even gone to the extreme of a system with none of the Slackware scripts even there at all, replaced with ones I wrote from scratch.

But for this exercise, I'm going back to a vanilla Slackware and starting over. And for this I'm treating it NOT as a "modify my system relative to Slackware way", but rather, "explore how Slackware might do it for itself when it gets to the point where IPv6 just works out of the box". It's the kind of thing that once it works solid and stable, would be contributed back to Pat for consideration (if he likes it, it saves him work if he hasn't done it by then). I'm even using his coding style instead of my own.

What I'm trying right now is extending how rc.inet1 and rc.inet1.conf work together by adding IP6ADDR[$i] as an array variable to configure the IPv6 addresses. IPv6 uses prefix lengths exclusively (not a netmask) and ifconfig figures out the broadcast and network addresses from that automatically (ipmask not needed ... but it doesn't support IPv6 anyway). I added one touch where a ',' separates multiple IPv6 addresses.

Maybe it would be better to just support IPv4 and IPv6 in the same variable? But that would have to extend and modify how IPv4 works to do that, since IPv4 network specs are given in different variables and IPv6 doesn't do it quite that way (though it is possible to do IPv4 the IPv6 way ... it will still require some handling before it gets to ifconfig).

I'd kinda like to do a better ifconfig, but that's a bigger project.

I'd like to do a smart network manager, too. Other distros really need that (they do use network managers ... which are rather dumb and do things wrong quite often). But does not seem the Slackware way to do a network manager (a daemon that monitors and manages the network configuration constantly to try to keep it at what the administrator decided it should be, even as things go up and down, etc).

But for now, I'm basically extending /etc/rc.d/rc.inet1 to make it IPv6 aware. The only hitch I'm running into is ifconfig isn't triggering udev to load the ipv6 module. However, rc.ssh seems to be doing that ... interesting.

sahko 11-05-2010 03:13 PM

straterra from ##slackware had made a patch in order to use ipv6 with dhcp instead of dhcpcd which isnt ipv6 capable yet, but was rejected by Pat a while ago. I cant find the link to it right now, maybe you could ask him to share when he gets online.

Skaperen 11-05-2010 04:05 PM

I have it working now, having added a conditional "modprobe ipv6" that only loads IPv6 if an interface is configured with an ipv6 address. Here is part of /etc/rc.d/rc.inet1.conf showing how to code a static IPv6 address this way:

Code:

# Config information for eth0:
IPADDR[0]="172.30.60.2"
NETMASK[0]="255.255.0.0"
USE_DHCP[0]=""
DHCP_HOSTNAME[0]=""
IP6ADDR[0]="fcca::3c02/16,fdca::3c02/16"

# Config information for eth1:
IPADDR[1]="192.168.1.240"
NETMASK[1]="255.255.255.0"
USE_DHCP[1]=""
DHCP_HOSTNAME[1]=""
IP6ADDR[1]="fc00::10f0/16,fd00::10f0/16"

Does this look simple enough for you to use? Note that this is for static IPv6 addresses, such as might be done for an IPv6 addressible server. The more common scenario will be for auto-configuration via an upstream IPv6-aware router from which the network part of the address will be obtained, and the lower 64 bits will be from the MAC address. In those cases, merely enabling IPv6 should be enough, or if not, then DHCP6 somehow. If you do IPv6 via a tunnel broker, the setup software should take care of it.

In the future, I want to add IPv6 awareness to the setup scripts for network configuration for IPv6-only networks.

The LQ upload tool didn't like the /etc/rc.d/rc.inet1 script file, so I put it over on this URL: http://slashusr.net/lq/2010-11-05/rc.inet1
You can also find the sample .conf file there by changing the name.

infamy 04-29-2014 02:01 AM

Quote:

Originally Posted by Skaperen (Post 4150480)
I have it working now, having added a conditional "modprobe ipv6" that only loads IPv6 if an interface is configured with an ipv6 address. Here is part of /etc/rc.d/rc.inet1.conf showing how to code a static IPv6 address this way:

Code:

# Config information for eth0:
IPADDR[0]="172.30.60.2"
NETMASK[0]="255.255.0.0"
USE_DHCP[0]=""
DHCP_HOSTNAME[0]=""
IP6ADDR[0]="fcca::3c02/16,fdca::3c02/16"

# Config information for eth1:
IPADDR[1]="192.168.1.240"
NETMASK[1]="255.255.255.0"
USE_DHCP[1]=""
DHCP_HOSTNAME[1]=""
IP6ADDR[1]="fc00::10f0/16,fd00::10f0/16"

Does this look simple enough for you to use? Note that this is for static IPv6 addresses, such as might be done for an IPv6 addressible server. The more common scenario will be for auto-configuration via an upstream IPv6-aware router from which the network part of the address will be obtained, and the lower 64 bits will be from the MAC address. In those cases, merely enabling IPv6 should be enough, or if not, then DHCP6 somehow. If you do IPv6 via a tunnel broker, the setup software should take care of it.

In the future, I want to add IPv6 awareness to the setup scripts for network configuration for IPv6-only networks.

The LQ upload tool didn't like the /etc/rc.d/rc.inet1 script file, so I put it over on this URL: http://slashusr.net/lq/2010-11-05/rc.inet1
You can also find the sample .conf file there by changing the name.


Dont forget to add this in /etc/rc.d/rc.inet1.conf for IPv6 as well.. Its obvious but some people may just not even know and just assume the above is all thats needed. If its a native IPv6 thats assigned to you, you will have to add the gateway too.

Code:

GATEWAY6="fcca::3c02:1"


All times are GMT -5. The time now is 02:13 AM.