summaryrefslogtreecommitdiff
path: root/data/templates/dhcp-client
AgeCommit message (Collapse)Author
2024-04-01dhcpv6-client: T2590: fix vyos-hostsd update for nameserver and search domainsChristian Breunig
After migrating from ISC DHCLIENT for IPv6 to wide-dhcp-client the logic which was present to update /etc/resolv.conf with the DHCP specified nameservers and also the search domain list was no longer present. This commit adds a per interface rendered script to inform vyos-hostsd about the received IPv6 nameservers and search domains. (cherry picked from commit ece425f0191762638b7c967097accd8739e9103d)
2024-03-28op-mode: T6175: "renew dhcp interface <name>" does not check for DHCP interfaceChristian Breunig
The current op-mode script simply calls sudo systemctl restart "dhclient@$4.service" with no additional information about a client interface at all. This results in useless dhclient processes root 47812 4.7 0.0 5848 3584 ? Ss 00:30 0:00 /sbin/dhclient -4 -d root 48121 0.0 0.0 4188 3072 ? S 00:30 0:00 \_ /bin/sh /sbin/dhclient-script root 48148 50.0 0.2 18776 11264 ? R 00:30 0:00 \_ python3 - Which also assign client leases to all local interfaces, if we receive one valid DHCPOFFER vyos@vyos:~$ show interfaces Codes: S - State, L - Link, u - Up, D - Down, A - Admin Down Interface IP Address MAC VRF MTU S/L Description ----------- ----------------- ----------------- ------- ----- ----- ------------- eth0 - 00:50:56:bf:c5:6d default 1500 u/u eth0.10 172.16.33.102/24 00:50:56:bf:c5:6d default 1500 u/u eth1 172.16.33.131/24 00:50:56:b3:38:c5 default 1500 u/u 172.16.33.102/24 and 172.16.33.131/24 are stray DHCP addresses. This commit moved the renew command to the DHCP op-mode script to properly validate if the interface we request a renew for, has actually a dhcp address configured. In additional this exposes the renew feature to the API. (cherry picked from commit 7dbaa25a199a781aaa9f269741547e576410cb11)
2023-11-20dhcp-client: T5760: add CLI option to pass user-class parameterChristian Breunig
Example: set interfaces ethernet eth0 dhcp-options user-class VyOS or set interfaces ethernet eth0 dhcp-options user-class 56:79:4f:53 (cherry picked from commit 260645d0c6ff078cc89601f3a586195902f9c18e)
2023-11-20dhcp-client: T5760: add constraints for dhclient string optionsChristian Breunig
The string data type specifies either an NVT ASCII string enclosed in double quotes, or a series of octets specified in hexadecimal, separated by colons. For example: set interfaces ethernet eth0 dhcp-options client-id CLIENT-FOO or set interfaces ethernet eth0 dhcp-options client-id 43:4c:49:45:54:2d:46:4f:4f As of now there was no input validation performed. (cherry picked from commit bed1cd01904ef89b5d31bd47de0f230214900f16)
2023-08-17Revert: dhcp: T5428: always release lease from default VRFChristian Breunig
This reverts commit 9afcea251bdc895ffd49cb11f455fd636fdf817b A DHCP relese must also be originated from the VRF where the dhclient program is running, else the RELEASE message can not be send through the interface towards the DHCP server. The reason it did not work in the past was because of https://vyos.dev/T5476
2023-08-07dhcp: T5428: always release lease from default VRFChristian Breunig
Otherwise packet can be received in a VRF that was already deleted. Image of the following CLI commands: del interface ethernet eth0 address dhcp del interface ethernet eth0 vrf red del vrf name red VRF could be deleted even if dhclient release was not yet completely processed.
2023-08-05dhcpv6: T5428: client renewal fails when running inside VRFChristian Breunig
2023-08-05dhcp: T5428: remove hardcoded path to client runtime directoriesChristian Breunig
2023-08-04dhcp: T5428: client renewal fails when running inside VRFChristian Breunig
vyos@vyos# run show vrf MGMT processes 2282 sshd There is no dhclient process running in given VRF. dhclient complains it can not send out packets via the given interface (as it's not bound to that VRF) Aug 02 20:29:54 dhclient[1686]: send_packet: Network is unreachable Aug 02 20:29:54 dhclient[1686]: send_packet: please consult README file regarding broadcast address. Aug 02 20:29:54 dhclient[1686]: dhclient.c:3001: Failed to send 300 byte long packet over fallback interface.
2023-07-31dhcpv6-pd: T5387: add support for no-release flag1vivy
When no-release is specified, dhcp6c client will not release allocated address or prefix on client exit. vyos.ifconfig: dhcpv6: T5387: re-use options_file for no release flag [WIP] * Todo: render Jinja2 template and fill it vyos.ifconfig: dhcpv6: T5387: finish options_file and no release flag in cli vyos.ifconfig: dhcpv6: T5387: fix missing/wrong end tag vyos.ifconfig: dhcpv6: T5387: fix options, no var for -n dhcpv6-client: T5387: fix missing / from filepaths
2022-09-21dhcpv6-pd: T2821: bugfix Jinja2 template - missing conditional ifChristian Poessinger
Specifying "dhcpv6-options pd 0" for any interface without an interface where we delegate an address to resulted in a commit error: {% for interface, interface_config in pd_config.interface.items() if pd_config.interface is vyos_defined %} jinja2.exceptions.UndefinedError: 'dict object' has no attribute 'interface'
2022-04-16dhcp(v6)-client: T4353: fix Jinja2 linting errorsChristian Poessinger
2022-04-08dhcp(v6): T4333: migrate to new vyos_defined Jinja2 testChristian Poessinger
2021-11-18dhcp: T4008: change client retry interval form 300 -> 60 secondsChristian Poessinger
(cherry picked from commit e1539b6fffaf10863e41a73a380f9de40f6aece6)
2021-10-15dhclient: T3832: Add hexadecimal format for client-idViacheslav
The hedadecimal option dhcp-cliend-identifier format is required to set values without quotes, separated by colons.
2021-04-02interfaces: dhcp-client: T3454: add reject optionCharles Surett
Sometimes a modem might give a local IP before it retrieves a WAN IP. This can be an issue with failover routes, since the default route will get overridden.
2021-02-15dhcp: T3300: add DHCP default route distanceBrandon Stepler
2021-01-27dhcpv6: T3240: send DUID when only DHCPv6 PD is configuredBrandon Stepler
2021-01-22dhcpv6: T3240: support per-interface client DUIDsBrandon Stepler
2020-11-07interfaces: dhcp-client: T2997: add option to not request DHCP router addressChristian Poessinger
Some might want to have an IP address handed out by a DHCP server but not want a default route to be installed. This can be done using the CLI command: "set interfaces ethernet eth2 dhcp-options no-default-route"
2020-08-23dhcpv6-pd: T2677: add support for rapid-commit optionChristian Poessinger
When rapid-commit is specified, dhcp6c will include a rapid-commit option in solicit messages and wait for an immediate reply instead of advertisements.
2020-08-23dhcpv6-pd: T2821: support dhcpv6-pd without "address dhcpv6"Christian Poessinger
Currently DHCPv6-PD requires an interface address configured to dhcpv6 on the CLI. This is not required also sometimes there is either no dhcpv6 interface addressing available (PPPoE) or wanted. This limitation was artificial due to the old interface code. Change the implementation to spawn the DHCPv6 client and request a prefix even when there is no address request configured.
2020-08-22dhcpv6-pd: T2677: optimize CLI interface for PD configurationChristian Poessinger
The current CLI did not support multiple prefix-delegations per interface. Some ISPs only send one /64 to a client per prefix-delegation request, but they allow the customer to request multiple prefixes. The 'dhcpv6-options prefix-delegation' node has been renamed and converted to a tag node named 'dhcpv6-options pd'. The tag node specifies a PD request (>=0). In the past the user needed to know what prefix will be assigned and required to calculate the sla-len by himself. The 'sla-len' node was dropped and is now calculated in the background from the 'dhcpv6-options pd 0 length' node. It is no longer mandatory to supply the 'sla-id' node, if sla-id is not specified it is 'guessed' by counting upwards. Example configuration: ---------------------- ethernet eth1 { address dhcpv6 dhcpv6-options { pd 0 { length 56 interface eth2 { address 1 } } } } This will request a /56 assignment from the ISP and will delegate a /64 network to interface eth2. VyOS will use the interface address ::1 on the delegate interface (eth2) as its local address.
2020-08-18dhcpv6: T2510: fix missing id-assoc for non temporary addressChristian Poessinger
2020-08-14templates: dhcp-client: fix "Autogenerated by" script nameChristian Pössinger
Commit 21bc98f1 ("ifconfig: dhcp: T2767: client must not start when interface is disabled") dropped dhcp.py which is now directly handled by interface.py. This change should also be reflected in the generated files.
2020-08-03ifconfig: T2653: unify DHCPv4 configurationChristian Poessinger
Pass the interface dictionary transparently to the DHCP module and render the DHCP client config template directly from the same source instead of transcoding it once more.
2020-08-03ifconfig: T2740: pass config dict to DHCP class for IPv6Christian Poessinger
This removes additional code paths as we can instatly work with the input dict the same was as it was done for PPPoE. This fixes the entire DHCPv6-PD support on non PPPoE interfaces as this was lost in translation while processing T2653.
2020-07-01ifconfig: T2653: move pppoe interface to get_config_dict()Christian Poessinger
2020-05-26dhcpv6-pd: T2506: add option to request specific prefix lengthChristian Poessinger
Some ISPs (e.g. Comcast) only delegate a /64 by default. You have to explicitly "ask" for a bigger (e.g. /60) prefix. This commit adds a CLI node to request a specific prefix length in the range 32 - 64. dhcpv6-options { prefix-delegation { length 60 } }
2020-05-26dhcpv6-pd: pppoe: T2506: restructure CLIChristian Poessinger
Rename the CLI nodes for prefix delegation from "dhcpv6-options delegate <interface>" to "dhcpv6-options prefix-delegation interface <interface>". The change is required to add the possibility to request for specific prefix sized via the CLI. That option was not possible with the old configuration tree.
2020-05-24fromdos: fix wrong line encodingChristian Poessinger
2020-05-17pppoe: dhcpv6-pd: T421: initial supportChristian Poessinger
The following configuration will assign a /64 prefix out of a /56 delegation to eth0. The IPv6 address assigned to eth0 will be <prefix>::ffff/64. If you do not know the prefix size delegated to you, start with sla-len 0. pppoe pppoe0 { authentication { password vyos user vyos } description sadfas dhcpv6-options { delegate eth0 { interface-id 65535 sla-id 0 sla-len 8 } } ipv6 { address { autoconf } enable } source-interface eth1 } vyos@vyos:~$ show interfaces Codes: S - State, L - Link, u - Up, D - Down, A - Admin Down Interface IP Address S/L Description --------- ---------- --- ----------- eth0 2001:db8:8003:400::ffff/64 u/u
2020-05-17dhcpv6-pd: T421: migrate from ISC dhclient to wide-dhcpv6-clientChristian Poessinger
ISC does not support running the client on PPP(oE) interfaces which makes it unusable for DHCPv6 Prefix Delegation tasks. Internet Systems Consortium DHCP Client 4.4.1 Copyright 2004-2018 Internet Systems Consortium. All rights reserved. For info, please visit https://www.isc.org/software/dhcp/ Unsupported device type 512 for "pppoe0"
2020-04-28dhclient: T2393: remove intermediate _DHCP helper classChristian Poessinger
The intermedite class only held the path to the configuration files - thus its existence was doubtworthy. For better readability and a clean inheritance graph that class has been dropped.
2020-04-28dhclient6: T2393: T2394: migrate from SysVinit to systemdChristian Poessinger
2020-04-28dhclient: T2393: migrate from SysVinit to systemdChristian Poessinger
2020-04-11dhcp: T2230: use external template filesThomas Mangin