ranges

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 23, 2020 License: MIT Imports: 10 Imported by: 0

README


title: "range" date: 2019-09-20T19:00:00+02:00 draft: false

range

Name

range - configure a range of IP address to be leased

Description

The range plugin allows to dynamically lease IP addresses to requesting clients. Each client requesting will be assigned an IP address from one of the configured ranges. If the client has already been assigned an address (i.e. in RENEWING state) it will get the very same address assigned. If the range plugin is not able to find a suitable address the next plugin will be called. Typically, the range plugin should be one of the last plugins used. This plugin may be specified multiple times per DHCP server block.

Syntax

range START_IP END_IP
  • START_IP is the (inclusive) start IP of the range (like 192.168.0.1)
  • END_IP is the (inclusive) end IP of the range (like 192.168.0.100)

Examples

The following example allows dynamic clients to receive IP addresses from two different pools:

192.168.0.1/24 {
    range 192.168.0.100 192.168.0.150
    range 192.168.0.200 192.168.0.250
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RangePlugin

type RangePlugin struct {
	// Next is the next handler in the chain
	Next plugin.Handler

	// Ranges holds all IP ranges that can be used by the plugin
	Ranges iprange.IPRanges

	// Network defines the network that is served by the plugin
	// setupRange copies this from the dhcpserver.Config
	Network net.IPNet

	// L holds the logger to use
	L log.Logger
}

RangePlugin assigned IP address from preconfigured ranges

func (*RangePlugin) Name

func (p *RangePlugin) Name() string

Name returns "range" and implements the plugin.Handler interface

func (*RangePlugin) ServeDHCP

func (p *RangePlugin) ServeDHCP(ctx context.Context, req, res *dhcpv4.DHCPv4) error

ServeDHCP implements the plugin.Handler interface and served DHCP requests

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL