# IPv4/IPv6 starting scripts



## krik (Apr 10, 2010)

Hi,

I'm trying to setup a dual stack IPv4/IPv6 server and I can't find which rc.d script to run...

I've started the server without any IP then I've put the following into rc.conf


```
#IPv4 config
ifconfig_re0="inet 192.168.1.10 netmask 255.255.255.0"
static_routes="default"
route_default="default 192.168.1.1"

#IPv6 config
ipv6_enable="YES"
ipv6_ifconfig_re0="2001:db8:abcd::e/56"
ipv6_static_routes="default"
ipv6_route_default="default 2001:db8:abcd::1"
```

Then I've started the network with the following scripts:

/etc/rc.d/netif start
/etc/rc.d/routing start
/etc/rc.d/network_ipv6 start

The IPv4 is working perfectly, the IPv6 defined address is there but the link-local address is missing. If I reboot the server everything is there... What script do I need to start/restart to get the link-local address without rebooting?

Thanks for your help ,
Christophe


----------



## phoenix (Apr 13, 2010)

A quick grep of /etc/rc.d/ for ipv6 will show you the answer (`# grep ipv6 /etc/rc.d/*`).    There are separate IPv4 and IPv6 scripts for networking, routing, firewalling, etc.

Also, check the output of rcorder to see which order to call things:  `# rcorder /etc/rc.d/* /usr/local/etc/rc.d/*`


----------



## krik (Apr 13, 2010)

Thanks for the advise, I've at least learn a new command... I didn't knew rcorder. But unfortunately it doesn't work... I've restarted all the scripts containing _ipv6_ in the order shown by rcorder but the link-local ipv6 address is still missing.

Christophe


----------



## SirDice (Apr 13, 2010)

I think it has to do with the net.inet6.ip6.auto_linklocal sysctl. Which gets set in /etc/rc.d/auto_linklocal.


----------



## DutchDaemon (Apr 13, 2010)

Just about to post that after a [cmd=]# grep -rl "::1" /etc[/cmd]


----------



## SirDice (Apr 13, 2010)

I remembered some fuss about ipv6 and specifically link-local addresses with the beta/rc of 8.0


----------



## krik (Apr 13, 2010)

Got it!

As stated by SirDice, the script `# /etc/rc.d/auto_linklocal` set net.inet6.ip6.auto_linklocal to 0 and prevents `# /etc/rc.d/netif` to add the link-local address... When I set net.inet6.ip6.auto_linklocal to 1 and then restart `# /etc/rc.d/netif` the link-local address is automatically set. 

Now the issue is that restarting netif brings down all the network interfaces what I tried to avoid by not rebooting the server. :\

Thanks for your help!

Christophe


----------



## DutchDaemon (Apr 13, 2010)

It should bring them right back up, but you'll need to restart /etc/rc.d/routing as well after that.


----------

