[Kea-users] What is the purpose of the router array

Marcin Siodelski marcin at isc.org
Tue Aug 16 13:34:17 UTC 2016


On 09.08.2016 19:39, Munroe Sollog wrote:
> Below is my config.  I see that kea's documentation supports an array type for the 'routers'
> parameters.  In practice it seems like the clients always use the first IP listed.  I'm trying to
> understand the purpose of the array then.  I am interested in the DHCP serving these elements of the
> array either non-deterministically or in some sort of load-balanced fashion in order to spread
> traffic evenly across both of our internet connections.
> 
> ===My Config===
> {
> "Dhcp4":
> {
>   "interfaces-config": {
>     "interfaces": ["eth0" ]
>   },
>   "lease-database": {
>     "type": "memfile"
>   },
>   "expired-leases-processing": {
>     "reclaim-timer-wait-time": 10,
>     "flush-reclaimed-timer-wait-time": 25,
>     "hold-reclaimed-time": 3600,
>     "max-reclaim-leases": 100,
>     "max-reclaim-time": 250,
>     "unwarned-reclaim-cycles": 5
>   },
>   "valid-lifetime": 4000,
>     "subnet4": [
> 	{
> 	    "subnet": "172.31.0.0/18",
> 	    "reservations": [
> 		{
> 		    "hw-address": "a4:17:31:f5:05:fc",
> 		    "ip-address": "172.31.63.250"
> 		},
> 	    ],
> 	    "option-data": [
>                 {
> 		    "name": "domain-name-servers",
> 		    "data": "8.8.8.8, 8.8.4.4"
> 		},
> 		{
> 		    "name": "routers",
> 		    "data": "172.31.63.254, 172.31.0.1"
> 		},
> 	    ]
> 	}
> 	
>     ]
> },
> 
> 

The RFC2132, section 3.5 specifies that Router option holds a list of IP
addresses for routers on the client's subnet. It also indicates that
routers should be listed in order of preference. Kea merely implements
this specification.

I think that on some operating systems it is possible to maintain
multiple default gateways for a particular subnet, of which one is the
active default gateway. The active default gateway is selected by
preference (which is determined by the order of addresses in the Router
options). The operating system can possibly detect that the link with
the default gateway goes down and switch the active gateway to another
address received in the Routers option (with lower preference).

With the typical DHCP clients you won't be able to achieve load
balancing using the array of 'routers' as they would pick the one with
highest preference. What you rather want to do is to apply a logic on
the server side, which would serve a different address in Router
options, depending on a client. That you could achieve by creating a
Hook application for Kea.

See
http://git.kea.isc.org/~tester/kea/doxygen/df/d46/hooksdgDevelopersGuide.html

Marcin Siodelski
ISC




More information about the Kea-users mailing list