View Single Post
  #1   (View Single Post)  
Old 11th March 2013
sysfu sysfu is offline
Port Guard
 
Join Date: Jun 2008
Posts: 36
Default Howto: Automatically configure OpenBSD as DHCPv6 IPv6 client at boot

1. Setup LAN router as DHCPv6 server. For example: http://doc.pfsense.org/index.php/Using_IPv6_on_2.0

2. Install wide-dhcpv6 package;
Code:
sudo pkg_add -iv wide-dhcpv6
3. Copy the dhcp6c.conf file to /etc
Code:
sudo cp /usr/local/share/examples/wide-dhcpv6/dhcp6c.conf.sample /etc/dhcp6c.conf
4. Edit dhcp6c.conf like so, editing out the other examples and substituting the correct network interface name for this section
Code:
# The following is a sample configuration for a client on a LAN
# where IPv6 addresses are assigned via DHCPv6 ("stateful address
# assignment"). Use this if you want the client to query the
# DHCPv6 server for an IPv6 address and for DNS servers, as in
# traditional IPv4 DHCP.

interface <your interface name here> {
        send ia-na 0;
        send rapid-commit;
        send domain-name-servers;
};

id-assoc na {
};
5. edit the appropriate /etc/hostname.if file for your network adapter and add the line "rtsol"

6. add a line to /etc/rc.local like this:
Code:
/usr/local/sbin/dhcp6c -c /etc/dhcp6c.conf <your interface goes here>
Here's a one-liner you can copy-paste after substituting your interface
Code:
echo """ echo "/usr/local/sbin/dhcp6c -c /etc/dhcp6c.conf <your interface goes here>" >> /etc/rc.local """|sudo sh
7. add these two lines to /etc/sysctl.conf

Code:
net.inet6.icmp6.rediraccept=1
net.inet6.ip6.accept_rtadv=1
8. Reboot and check to see if the adapter pulled an IPv6 address. You should see two, the first autoconfigured one starting with fe80:: and the second one being your IPv6 address pulled from the DHCPv6 server.
Code:
ifconfig <your interface name goes here> | grep inet6
9. Test connectivity by pinging an IPv6 host
Code:
ping6 ipv6.google.com
Reply With Quote