static

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: 8 Imported by: 0

README


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

static

Name

static - MAC address based static IP addresses

Description

The static plugin allows configuration of static IP address based on the MAC address of the requesting client

Syntax

static MAC IP

where

  • MAC is the MAC address of the client (like "aa:bb:cc:dd:ee:ff") and
  • IP is the IP address that should be assigned (like "192.168.0.10")

Examples

10.1.0.1/24 {
    leaseTime 1h
    static 00:aa:de:ad:be:ef 10.1.0.10
    range 10.1.0.100 10.1.0.200
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Plugin

type Plugin struct {
	Config    *dhcpserver.Config
	Next      plugin.Handler
	Addresses map[string]net.IP
	L         log.Logger
}

Plugin allows assignment of static IP addresses to clients based on the MAC address. It implements plugin.Handler

func (*Plugin) Name

func (s *Plugin) Name() string

Name returns "static" and implements plugin.Handler

func (*Plugin) ServeDHCP

func (s *Plugin) ServeDHCP(ctx context.Context, req, res *dhcpv4.DHCPv4) error

ServeDHCP serves a DHCP request and implements plugin.Handler. If the requesting MAC address of the client is configured a static IP lease will be sent

Jump to

Keyboard shortcuts

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