Repository navigation
Dhcp relay agent - #1820
Draft
troglobit wants to merge 10 commits into
Draft
Dhcp relay agent#1820troglobit wants to merge 10 commits into
troglobit wants to merge 10 commits into
Conversation
DHCP relay agent with option 82, for an IP address per port on a switch. Installed as an available Finit service, to be enabled when a relay is configured. Enabled in all defconfigs that have the DHCP server. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
A node with a when expression that refers to another subtree was never offered for completion, e.g. a list that only applies when the interface its parent names is a bridge. Bump klish-plugin-sysrepo, which now evaluates the expression against the candidate datastore. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
The address of a static host is not used while another client has a lease on it. With a host that matches on the port a client is connected to, option 82, a device that replaces a broken one does not get the address of the port until the lease of the old device expires. With preempt on the dhcp-host the new client takes over the address at once. Issue #705 Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
dnsmasq binds UDP port 67 on the wildcard address without allowing another socket on the port, so a relay agent on the same system cannot bind it on its gateway addresses. With bind-dynamic it can. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
A subnet in the DHCP server without a pool, only static hosts, was not served at all: no client got an address from it. The model allows it, and it is the natural setup when every address is reserved. dnsmasq only serves a subnet it has a dhcp-range for, and the range was written from the pool. Write a static range for a subnet without one. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
A static host in the DHCP server can be matched on MAC address, hostname or client-id, all of which follow the device. With a DHCP relay agent that adds option 82, the server can instead hand out an address per port, whatever is connected to it. Add an option82 case to the host match, with circuit-id and remote-id as string or hex, and a preempt setting, which lets a device that replaces a broken one take over the address before the old lease has expired. Issue #705 Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Brings what the relay agent needs to run under confd: it waits for interfaces and addresses that are not there yet, can turn off option 82 per interface, and relays from trunk ports in each of their VLANs. It also fixes relaying with the server on the same subnet as the clients. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Clients cannot get an address from a DHCP server on another subnet, and a server cannot hand out an address per port, without a relay agent that tells it where a request came from, option 82. Add the infix-dhcp-relay model and generate the configuration for dhcprelayd from it. An interface that is a bridge, or a VLAN interface on a bridge, relays per bridge port: all ports of a bridge, or the ports with the VLAN as PVID and its tagged members. The port list of an interface only holds the exceptions: a port that should not relay, a trusted port towards another relay agent, or a circuit-id other than the port name. For a server on the device itself, at 127.0.0.1, the server identifier override is always on, or the clients would be told that their server is 127.0.0.1. Fixes #438 Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Five tests, one for each way the relay agent is meant to be used: to a server on another subnet, to a server on the device itself with a replaced client, from an interface that is not a bridge without option 82, in a chain of two switches where the first gets its own address through the second, and on a VLAN filtering bridge with an access port and a trunk port. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
wip
Checklist
Tick relevant boxes, this PR is-a or has-a: