From 3bc405eaa0e6dc5b6eb411a060ebb79325b409fa Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sat, 4 Jan 2020 16:18:38 +0100 Subject: dhcp: remove example statements from cfgcmd definition --- docs/services/dhcp.rst | 145 +++++++++++++++++++++++++++---------------------- 1 file changed, 79 insertions(+), 66 deletions(-) (limited to 'docs/services/dhcp.rst') diff --git a/docs/services/dhcp.rst b/docs/services/dhcp.rst index 9f2f57f7..36ca3e17 100644 --- a/docs/services/dhcp.rst +++ b/docs/services/dhcp.rst @@ -19,73 +19,51 @@ addresses. Multiple ranges can be defined and can contain holes. Static mappings can be set to assign "static" addresses to clients based on their MAC address. -Example -------- - -In this example, we are offering address space in the 192.0.2.0/24 network. -We are using the network name `dhcpexample`. - -.. code-block:: none - - set service dhcp-server shared-network-name dhcpexample authoritative - set service dhcp-server shared-network-name dhcpexample subnet 192.0.2.0/24 default-router 192.0.2.1 - set service dhcp-server shared-network-name dhcpexample subnet 192.0.2.0/24 dns-server 192.0.2.1 - set service dhcp-server shared-network-name dhcpexample subnet 192.0.2.0/24 lease 86400 - set service dhcp-server shared-network-name dhcpexample subnet 192.0.2.0/24 range 0 start 192.0.2.100 - set service dhcp-server shared-network-name dhcpexample subnet 192.0.2.0/24 range 0 stop 192.0.2.199 - -The generated config will look like: - -.. code-block:: none - - vyos@vyos# show service dhcp-server shared-network-name dhcpexample - authoritative - subnet 192.0.2.0/24 { - default-router 192.0.2.1 - dns-server 192.0.2.1 - lease 86400 - range 0 { - start 192.0.2.100 - stop 192.0.2.199 - } - } - -Explanation -^^^^^^^^^^^ +Configuration +------------- -.. cfgcmd:: set service dhcp-server shared-network-name dhcpexample authoritative +.. cfgcmd:: set service dhcp-server shared-network-name authoritative This says that this device is the only DHCP server for this network. If other devices are trying to offer DHCP leases, this machine will send 'DHCPNAK' to any device trying to request an IP address that is not valid for this network. -.. cfgcmd:: set service dhcp-server shared-network-name dhcpexample subnet 192.0.2.0/24 default-router 192.0.2.1 +.. cfgcmd:: set service dhcp-server shared-network-name subnet default-router
- This is a configuration parameter for the subnet, saying that as part of the - response, tell the client that I am the default router for this network. + This is a configuration parameter for the ``, saying that as part of + the response, tell the client that the default gateway can be reached at + `
`. -.. cfgcmd:: set service dhcp-server shared-network-name dhcpexample subnet 192.0.2.0/24 dns-server 192.0.2.1 +.. cfgcmd:: set service dhcp-server shared-network-name subnet dns-server
This is a configuration parameter for the subnet, saying that as part of the - response, tell the client that I am the DNS server for this network. If you - do not want to run a DNS server, you could also provide one of the public - DNS servers, such as google's. You can add multiple entries by repeating the - line. + response, tell the client that the DNS server can be found at `
`. + + Multiple DNS servers can be defined. + +.. cfgcmd:: set service dhcp-server shared-network-name subnet lease