I was attempting to setup an internal DHCPv6 server on my network with tomato as my gateway.
Unfortunatly I was unable to accomplish this because DHCPv6 does not allow for setting a gateway and tomato in default settings does not allow for changing the default radvd settings easily to allow use of DHCPv6.
There may be an easier way to do this but I was unable to find it.
After researching the issue I found the problem to be located here.
"/release/src/router/rc/services.c"
768 fprintf(f,
769 "interface %s\n"
770 "{\n"
771 " IgnoreIfMissing on;\n"
772 " AdvSendAdvert on;\n"
773 " MaxRtrAdvInterval 60;\n"
774 " AdvHomeAgentFlag off;\n"
775 " AdvManagedFlag off;\n"
776 "%s%s%s" 7
77 " prefix %s/64 \n"
778 " {\n"
779 " AdvOnLink on;\n"
780 " AdvAutonomous on;\n"
781 "%s"
782 "%s%s%s"
783 " };\n",
784 nvram_safe_get("lan_ifname"),
785 mtu ? " AdvLinkMTU " : "", mtu ? : "", mtu ? ";\n" : "",
786 prefix,
787 (do_6to4 || do_6rd) ? " AdvValidLifetime 300;\n AdvPreferredLifetime 120;\n" : "",
788 do_6to4 ? " Base6to4Interface " : "", 789 do_6to4 ? get_wanface() : "",
790 do_6to4 ? ";\n" : "");
791
792 if (do_dns) {
793 fprintf(f, " RDNSS %s {};\n", ip);
794 }
This bit of code in the source will always revert the radvd.conf file to defaults.
"/tmp/etc/radvd.conf"
interface br0
{
IgnoreIfMissing on;
AdvSendAdvert on;
MaxRtrAdvInterval 60;
AdvHomeAgentFlag off;
AdvManagedFlag off;
AdvLinkMTU 1480;
prefix ????:????:????:????::/64
{
AdvOnLink on;
AdvAutonomous on;
};
RDNSS ????:????:????:????::? {};
};
????:????:????:???? is specific to your router settings.
Now these settings work for the default user but doesn't allow for any advanced settings. To get around this I came up with this solution.
Remember This tutorial assumes you already have tomato setup to use IPv6 and you have a DHCPv6 server already setup on your network
First*: In the router gui, I endabled and formated the remainder of my space in jffs. "Administration»JFFS". You do not need to use jffs, you can use a USB device if you wish to. Make sure to save when done.
Second: IMPORTANT In the router gui, You need to disable Router Advertisments. "Basic»IPv6" remove checkmark on "Enable Router Advertisments". Again save when done.
Most of the next I use ssh for.
Third: I SSH into the router, after I logged in I typed
mkdir /jffs/config
This creates a config directory on the jffs partition.
Fourth: Weneed to create the config file and then edit it with vi. You can do this two ways
1. You can copy the file from the original location, "/tmp/etc/radvd.conf" if you have it there, to give you a base file.
cp /tmp/etc/radvd.conf /jffs/config/radvd.conf
vi /jffs/config/radvd.conf
2. Other way you can create the file from nothing.
vi /jffs/config/radvd.conf
Fourth: Use vi to edit — arrow keys to navigate the page — "i" > sets you to edit Mode — "Esc" > Takes you out of edit Mode — when not in edit mode "ZZ" to exit and save file.
This is what the end file needs to look like.
interface br0
{
IgnoreIfMissing on;
AdvSendAdvert on;
MaxRtrAdvInterval 60;
AdvHomeAgentFlag off;
AdvManagedFlag on;
AdvOtherConfigFlag on;
AdvLinkMTU 1480;
prefix ????:????:????:????::/64
{
AdvOnLink on;
AdvAutonomous off;
};
RDNSS ????:????:????:????::? {};
};
????:????:????:???? is specific to your router settings. Also if you need to change ony other settings for radvd do it here.
Ok we are done with ssh now.
Fifth: In the router gui, Create an Init script, "Administration»Scripts" and save.
#!/bin/sh
sleep 20
radvd -C /jffs/config/radvd.conf
this starts radvd and the -C tells radvd to use the new script location
Finally: Reboot your router
These settings tell your router only to advertise the default gateway. Each computer will get that information but will not have any other IPv6 information. Now you will need to setup your DHCPv6 server to handle giving out IPv6 addresses.