Re: ipv6

John Crowhurst <[email protected]>
Newsgroups gmane.linux.slackware
Message-ID <[email protected]>
On 04/03/2014 11:37, Nick Edwards wrote:
> On 3/3/14, John Crowhurst <[email protected]> wrote:
>> On 02/03/2014 12:08, Gil André wrote:
>>> Hey,
>>>
>>> On 01 Mar 2014, at 17:00, Andreas Vögele <[email protected]>
>>> wrote:
>>>
>>>> Nick Edwards <[email protected]> writes:
>>>>
>>>>> [...] This is not for home use, I have them assigned by editing
>>>>> rc.inet1 which we know, we should never do since it will be overwrote
>>>>> every update
>>>> rc.inet1 and rc.wireless are both marked as configuration files and
>>>> won't be overwritten by default.  Furthermore, there's no need to
>>>> install the wireless-tools package, which provides the regular
>>>> rc.wireless script, on servers.  Just create your own script of that
>>>> name and it will never be touched by any package management tool.
>>> Sticking IPv6 in rc.wireless, even if said file is never overwritten
>>> by upgrading tools, and even if it is not needed on a server-class
>>> machine, strikes me as a pretty poor hack. Useful, yes, but definitely
>>> not a clean solution.
>>>
>>> I tend to agree with Nick & Noel here: what is needed is either a set
>>> of IPV6-specific rc scripts or (even better) integration of IPv6
>>> functions
>>> in the standard rc.inet1 scripts.
>>>
>>> -- Gil.
>>>
>> Hi,
>>
>> I would replace the ip_up function of Noel's rc.ipv6 script with
>> something like:
>>
>> files=/etc/rc.d/rc.ipv6conf/*.conf
>> for f in $files; do
>>     if [ -f "$f" ]; then
>>      source $f
>>     /usr/sbin/ip addr add $sub_ip dev $intf
>>     /usr/sbin/ip addr add $pri_ip dev $intf
>>    fi
>> done
>>
>> So for /etc/rc.d/rc.ipv6conf/darkstar.conf:
>>
>> # IPv6 Config file for darkstar.org, create a new one using this
>> template for your IP address or hostname
>> # Your interface, such as eth0
>> intf=eth0
>> # Sub IP v6 address
>> sub_ip=2001:xxxxxxxxxx:7/64
>> # Primary IPv6 address
>> pri_ip=2001:xxxxxxxxxx:dba/64
>>
>> darkstar.conf (with its variables commented out) could be used as a
>> dummy file that can be installed and upgraded without affecting the real
>> config files you create for your IP addresses in that folder.
>>
> Your close, but the problem with this is, each conf file doesnt need a
> primary IP, there can only be one primary IP per INT. and it must be
> the last IP loaded overall
Okay then, you could do:
# Load sub IP addresses from individual config files as required
secfiles=/etc/rc.d/rc.ipv6.conf.d/sub*.conf
for f in $files; do
   if [ -f "$f" ]; then
source $f
/usr/sbin/ip addr add $sub_ip dev $intf
   fi
done
# Load primary IP address from individual config files as required
prifiles=/etc/rc.d/rc.ipv6.conf.d/pri*.conf
for f in $files; do
   if [ -f "$f" ]; then
source $f
/usr/sbin/ip addr add $pri_ip dev $intf
   fi
done

That way you get two example files:

sub-darkstar.conf:
# IPv6 Sub IP Config file for darkstar.org
# create a new one using this template for your sub IP address or hostname
# Your interface, such as eth0
intf=eth0
# Sub IP v6 address
sub_ip=2001:xxxxxxxxxx:7/64

pri-darkstar.conf:
# IPv6 Primary IP Config file for darkstar.org
# create a new one using this template for your primary IP address or hostname
# Your interface, such as eth0
intf=eth0
# Primary IP v6 address
pri_ip=2001:xxxxxxxxxx:dba/64


Best,

John
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.