From aa44f17768570f9beb205ffd9ce7f17d601ed115 Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Fri, 13 Dec 2024 07:41:24 +0530 Subject: dhcp: T6948: Keep DHCP server leases in sync with hostd records Keep DHCP server leases in sync with vyos-hostd records via helper script invoked with `ExecStartPost` directive in kea-dhcp4-server.service. The helper script updates VyOS hostd records from DHCP server leases. This ensures that hostd records with the DHCP server leases are kept in sync with VyOS hostd records right after DHCP server is started. This is similar to the capability exposed via kea hook `libdhcp_run_script.so` which is invoked internally by kea when a single lease changes state. Since the kea hook is currently implemented for DHCPv4 only, this helper script is implemented for DHCPv4 only as well. --- src/system/sync-dhcp-lease-to-hosts.py | 112 +++++++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100755 src/system/sync-dhcp-lease-to-hosts.py (limited to 'src/system') diff --git a/src/system/sync-dhcp-lease-to-hosts.py b/src/system/sync-dhcp-lease-to-hosts.py new file mode 100755 index 000000000..5c8b18faf --- /dev/null +++ b/src/system/sync-dhcp-lease-to-hosts.py @@ -0,0 +1,112 @@ +#!/usr/bin/env python3 +# +# Copyright (C) 2025 VyOS maintainers and contributors +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 or later as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +import argparse +import logging + +import vyos.opmode +import vyos.hostsd_client + +from vyos.configquery import ConfigTreeQuery + +from vyos.kea import kea_get_active_config +from vyos.kea import kea_get_dhcp_pools +from vyos.kea import kea_get_server_leases + +# Configure logging +logger = logging.getLogger(__name__) +# set stream as output +logs_handler = logging.StreamHandler() +logger.addHandler(logs_handler) + + +def _get_all_server_leases(inet_suffix='4') -> list: + mappings = [] + try: + active_config = kea_get_active_config(inet_suffix) + except Exception: + raise vyos.opmode.DataUnavailable('Cannot fetch DHCP server configuration') + + try: + pools = kea_get_dhcp_pools(active_config, inet_suffix) + mappings = kea_get_server_leases( + active_config, inet_suffix, pools, state=[], origin=None + ) + except Exception: + raise vyos.opmode.DataUnavailable('Cannot fetch DHCP server leases') + + return mappings + + +if __name__ == '__main__': + # Parse command arguments + parser = argparse.ArgumentParser() + group = parser.add_mutually_exclusive_group(required=True) + group.add_argument('--inet', action='store_true', help='Use IPv4 DHCP leases') + group.add_argument('--inet6', action='store_true', help='Use IPv6 DHCP leases') + args = parser.parse_args() + + inet_suffix = '4' if args.inet else '6' + service_suffix = '' if args.inet else 'v6' + + if inet_suffix == '6': + raise vyos.opmode.UnsupportedOperation( + 'Syncing IPv6 DHCP leases are not supported yet' + ) + + # Load configuration + config = ConfigTreeQuery() + + # Check if DHCP server is configured + # Using warning instead of error since this check may fail during first-time + # DHCP server setup when the service is not yet configured in the config tree. + # This happens when called from systemd's ExecStartPost the first time. + if not config.exists(f'service dhcp{service_suffix}-server'): + logger.warning(f'DHCP{service_suffix} server is not configured') + + # Check if hostfile-update is enabled + if not config.exists(f'service dhcp{service_suffix}-server hostfile-update'): + logger.debug( + f'Hostfile update is disabled for DHCP{service_suffix} server, skipping hosts update' + ) + exit(0) + + lease_data = _get_all_server_leases(inet_suffix) + + try: + hc = vyos.hostsd_client.Client() + + for mapping in lease_data: + ip_addr = mapping.get('ip') + mac_addr = mapping.get('mac') + name = mapping.get('hostname') + name = name if name else f'host-{mac_addr.replace(":", "-")}' + domain = mapping.get('domain') + fqdn = f'{name}.{domain}' if domain else name + hc.add_hosts( + { + f'dhcp-server-{ip_addr}': { + fqdn: {'address': [ip_addr], 'aliases': []} + } + } + ) + + hc.apply() + + logger.debug('Hosts store updated successfully') + + except vyos.hostsd_client.VyOSHostsdError as e: + raise vyos.opmode.InternalError(str(e)) -- cgit v1.2.3 From 1478516ae437f19ebeb7d6ff9b83dd74f8e76758 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Sat, 28 Jun 2025 20:51:21 +0200 Subject: T7591: remove copyright years from source files The legal team says years are not necessary so we can go ahead with it, since it will simplify backporting. Automatically removed using: git ls-files | grep -v libvyosconfig | xargs sed -i -E \ 's/^# Copyright (19|20)[0-9]{2}(-[0-9]{4})? VyOS maintainers.*/# Copyright VyOS maintainers and contributors /g' In addition we will error-out during "make" if someone re-adds a legacy copyright notice --- Makefile | 9 ++++++++- debian/copyright | 6 +++--- python/vyos/accel_ppp.py | 2 +- python/vyos/accel_ppp_util.py | 2 +- python/vyos/airbag.py | 2 +- python/vyos/base.py | 2 +- python/vyos/component_version.py | 2 +- python/vyos/compose_config.py | 2 +- python/vyos/config.py | 2 +- python/vyos/config_mgmt.py | 2 +- python/vyos/configdep.py | 2 +- python/vyos/configdict.py | 2 +- python/vyos/configdiff.py | 2 +- python/vyos/configquery.py | 2 +- python/vyos/configsession.py | 2 +- python/vyos/configsource.py | 2 +- python/vyos/configtree.py | 2 +- python/vyos/configverify.py | 2 +- python/vyos/debug.py | 2 +- python/vyos/defaults.py | 2 +- python/vyos/ethtool.py | 2 +- python/vyos/firewall.py | 2 +- python/vyos/frrender.py | 2 +- python/vyos/ifconfig/__init__.py | 2 +- python/vyos/ifconfig/afi.py | 2 +- python/vyos/ifconfig/bond.py | 2 +- python/vyos/ifconfig/bridge.py | 2 +- python/vyos/ifconfig/control.py | 2 +- python/vyos/ifconfig/dummy.py | 2 +- python/vyos/ifconfig/ethernet.py | 2 +- python/vyos/ifconfig/geneve.py | 2 +- python/vyos/ifconfig/input.py | 2 +- python/vyos/ifconfig/interface.py | 2 +- python/vyos/ifconfig/l2tpv3.py | 2 +- python/vyos/ifconfig/loopback.py | 2 +- python/vyos/ifconfig/macsec.py | 2 +- python/vyos/ifconfig/macvlan.py | 2 +- python/vyos/ifconfig/operational.py | 2 +- python/vyos/ifconfig/pppoe.py | 2 +- python/vyos/ifconfig/section.py | 2 +- python/vyos/ifconfig/sstpc.py | 2 +- python/vyos/ifconfig/tunnel.py | 2 +- python/vyos/ifconfig/veth.py | 2 +- python/vyos/ifconfig/vrrp.py | 2 +- python/vyos/ifconfig/vti.py | 2 +- python/vyos/ifconfig/vtun.py | 2 +- python/vyos/ifconfig/vxlan.py | 2 +- python/vyos/ifconfig/wireguard.py | 2 +- python/vyos/ifconfig/wireless.py | 2 +- python/vyos/ifconfig/wwan.py | 2 +- python/vyos/iflag.py | 2 +- python/vyos/include/__init__.py | 2 +- python/vyos/include/uapi/__init__.py | 2 +- python/vyos/include/uapi/linux/__init__.py | 2 +- python/vyos/include/uapi/linux/fib_rules.py | 2 +- python/vyos/include/uapi/linux/icmpv6.py | 2 +- python/vyos/include/uapi/linux/if_arp.py | 2 +- python/vyos/include/uapi/linux/lwtunnel.py | 2 +- python/vyos/include/uapi/linux/neighbour.py | 2 +- python/vyos/include/uapi/linux/rtnetlink.py | 2 +- python/vyos/initialsetup.py | 2 +- python/vyos/ioctl.py | 2 +- python/vyos/ipsec.py | 2 +- python/vyos/kea.py | 2 +- python/vyos/limericks.py | 2 +- python/vyos/load_config.py | 2 +- python/vyos/logger.py | 2 +- python/vyos/migrate.py | 2 +- python/vyos/nat.py | 2 +- python/vyos/opmode.py | 2 +- python/vyos/pki.py | 2 +- python/vyos/priority.py | 2 +- python/vyos/progressbar.py | 2 +- python/vyos/proto/generate_dataclass.py | 2 +- python/vyos/proto/vyconf_client.py | 2 +- python/vyos/qos/__init__.py | 2 +- python/vyos/qos/base.py | 2 +- python/vyos/qos/cake.py | 2 +- python/vyos/qos/droptail.py | 2 +- python/vyos/qos/fairqueue.py | 2 +- python/vyos/qos/fqcodel.py | 2 +- python/vyos/qos/limiter.py | 2 +- python/vyos/qos/netem.py | 2 +- python/vyos/qos/priority.py | 2 +- python/vyos/qos/randomdetect.py | 2 +- python/vyos/qos/ratelimiter.py | 2 +- python/vyos/qos/roundrobin.py | 2 +- python/vyos/qos/trafficshaper.py | 2 +- python/vyos/raid.py | 2 +- python/vyos/remote.py | 2 +- python/vyos/snmpv3_hashgen.py | 2 +- python/vyos/system/__init__.py | 2 +- python/vyos/system/compat.py | 2 +- python/vyos/system/disk.py | 2 +- python/vyos/system/grub.py | 2 +- python/vyos/system/grub_util.py | 2 +- python/vyos/system/image.py | 2 +- python/vyos/system/raid.py | 2 +- python/vyos/template.py | 2 +- python/vyos/tpm.py | 2 +- python/vyos/utils/__init__.py | 2 +- python/vyos/utils/assertion.py | 2 +- python/vyos/utils/auth.py | 2 +- python/vyos/utils/backend.py | 2 +- python/vyos/utils/boot.py | 2 +- python/vyos/utils/commit.py | 2 +- python/vyos/utils/config.py | 2 +- python/vyos/utils/configfs.py | 2 +- python/vyos/utils/convert.py | 2 +- python/vyos/utils/cpu.py | 2 +- python/vyos/utils/dict.py | 2 +- python/vyos/utils/disk.py | 2 +- python/vyos/utils/error.py | 2 +- python/vyos/utils/file.py | 2 +- python/vyos/utils/io.py | 2 +- python/vyos/utils/kernel.py | 2 +- python/vyos/utils/list.py | 2 +- python/vyos/utils/locking.py | 2 +- python/vyos/utils/misc.py | 2 +- python/vyos/utils/network.py | 2 +- python/vyos/utils/permission.py | 2 +- python/vyos/utils/process.py | 2 +- python/vyos/utils/serial.py | 2 +- python/vyos/utils/session.py | 2 +- python/vyos/utils/strip_config.py | 2 +- python/vyos/utils/system.py | 2 +- python/vyos/utils/vti_updown_db.py | 2 +- python/vyos/version.py | 2 +- python/vyos/vyconf_session.py | 2 +- python/vyos/wanloadbalance.py | 2 +- python/vyos/xml_ref/__init__.py | 2 +- python/vyos/xml_ref/definition.py | 2 +- python/vyos/xml_ref/generate_cache.py | 2 +- python/vyos/xml_ref/generate_op_cache.py | 2 +- python/vyos/xml_ref/op_definition.py | 2 +- python/vyos/xml_ref/update_cache.py | 2 +- schema/interface_definition.rnc | 2 +- schema/interface_definition.rng | 10 +++++----- schema/op-mode-definition.rnc | 2 +- schema/op-mode-definition.rng | 10 +++++----- scripts/build-command-op-templates | 2 +- scripts/build-command-templates | 2 +- scripts/generate-configd-include-json.py | 2 +- scripts/override-default | 2 +- scripts/transclude-template | 2 +- smoketest/bin/vyos-configtest | 2 +- smoketest/bin/vyos-configtest-pki | 2 +- smoketest/bin/vyos-smoketest | 2 +- smoketest/scripts/cli/base_accel_ppp_test.py | 2 +- smoketest/scripts/cli/base_interfaces_test.py | 2 +- smoketest/scripts/cli/base_vyostest_shim.py | 2 +- smoketest/scripts/cli/test_backslash_escape.py | 2 +- smoketest/scripts/cli/test_cgnat.py | 2 +- smoketest/scripts/cli/test_config_dependency.py | 2 +- smoketest/scripts/cli/test_configd_init.py | 2 +- smoketest/scripts/cli/test_container.py | 2 +- smoketest/scripts/cli/test_firewall.py | 2 +- smoketest/scripts/cli/test_high-availability_virtual-server.py | 2 +- smoketest/scripts/cli/test_high-availability_vrrp.py | 2 +- smoketest/scripts/cli/test_interfaces_bonding.py | 2 +- smoketest/scripts/cli/test_interfaces_bridge.py | 2 +- smoketest/scripts/cli/test_interfaces_dummy.py | 2 +- smoketest/scripts/cli/test_interfaces_ethernet.py | 2 +- smoketest/scripts/cli/test_interfaces_geneve.py | 2 +- smoketest/scripts/cli/test_interfaces_input.py | 2 +- smoketest/scripts/cli/test_interfaces_l2tpv3.py | 2 +- smoketest/scripts/cli/test_interfaces_loopback.py | 2 +- smoketest/scripts/cli/test_interfaces_macsec.py | 2 +- smoketest/scripts/cli/test_interfaces_openvpn.py | 2 +- smoketest/scripts/cli/test_interfaces_pppoe.py | 2 +- smoketest/scripts/cli/test_interfaces_pseudo-ethernet.py | 2 +- smoketest/scripts/cli/test_interfaces_tunnel.py | 2 +- smoketest/scripts/cli/test_interfaces_virtual-ethernet.py | 2 +- smoketest/scripts/cli/test_interfaces_vti.py | 2 +- smoketest/scripts/cli/test_interfaces_vxlan.py | 2 +- smoketest/scripts/cli/test_interfaces_wireguard.py | 2 +- smoketest/scripts/cli/test_interfaces_wireless.py | 2 +- smoketest/scripts/cli/test_load-balancing_haproxy.py | 2 +- smoketest/scripts/cli/test_load-balancing_wan.py | 2 +- smoketest/scripts/cli/test_nat.py | 2 +- smoketest/scripts/cli/test_nat64.py | 2 +- smoketest/scripts/cli/test_nat66.py | 2 +- smoketest/scripts/cli/test_netns.py | 2 +- smoketest/scripts/cli/test_op-mode_show.py | 2 +- smoketest/scripts/cli/test_pki.py | 2 +- smoketest/scripts/cli/test_policy.py | 2 +- smoketest/scripts/cli/test_policy_local-route.py | 2 +- smoketest/scripts/cli/test_policy_route.py | 2 +- smoketest/scripts/cli/test_protocols_babel.py | 2 +- smoketest/scripts/cli/test_protocols_bfd.py | 2 +- smoketest/scripts/cli/test_protocols_bgp.py | 2 +- smoketest/scripts/cli/test_protocols_igmp-proxy.py | 2 +- smoketest/scripts/cli/test_protocols_isis.py | 2 +- smoketest/scripts/cli/test_protocols_mpls.py | 2 +- smoketest/scripts/cli/test_protocols_nhrp.py | 2 +- smoketest/scripts/cli/test_protocols_openfabric.py | 2 +- smoketest/scripts/cli/test_protocols_ospf.py | 2 +- smoketest/scripts/cli/test_protocols_ospfv3.py | 2 +- smoketest/scripts/cli/test_protocols_pim.py | 2 +- smoketest/scripts/cli/test_protocols_pim6.py | 2 +- smoketest/scripts/cli/test_protocols_rip.py | 2 +- smoketest/scripts/cli/test_protocols_ripng.py | 2 +- smoketest/scripts/cli/test_protocols_rpki.py | 2 +- smoketest/scripts/cli/test_protocols_segment-routing.py | 2 +- smoketest/scripts/cli/test_protocols_static.py | 2 +- smoketest/scripts/cli/test_protocols_static_arp.py | 2 +- smoketest/scripts/cli/test_qos.py | 2 +- smoketest/scripts/cli/test_service_broadcast-relay.py | 2 +- smoketest/scripts/cli/test_service_dhcp-relay.py | 2 +- smoketest/scripts/cli/test_service_dhcp-server.py | 2 +- smoketest/scripts/cli/test_service_dhcpv6-relay.py | 2 +- smoketest/scripts/cli/test_service_dhcpv6-server.py | 2 +- smoketest/scripts/cli/test_service_dns_dynamic.py | 2 +- smoketest/scripts/cli/test_service_dns_forwarding.py | 2 +- smoketest/scripts/cli/test_service_https.py | 2 +- smoketest/scripts/cli/test_service_ipoe-server.py | 2 +- smoketest/scripts/cli/test_service_lldp.py | 2 +- smoketest/scripts/cli/test_service_mdns_repeater.py | 2 +- smoketest/scripts/cli/test_service_monitoring_network_event.py | 2 +- smoketest/scripts/cli/test_service_monitoring_prometheus.py | 2 +- smoketest/scripts/cli/test_service_monitoring_telegraf.py | 2 +- smoketest/scripts/cli/test_service_monitoring_zabbix-agent.py | 2 +- smoketest/scripts/cli/test_service_ndp-proxy.py | 2 +- smoketest/scripts/cli/test_service_ntp.py | 2 +- smoketest/scripts/cli/test_service_pppoe-server.py | 2 +- smoketest/scripts/cli/test_service_router-advert.py | 2 +- smoketest/scripts/cli/test_service_salt-minion.py | 2 +- smoketest/scripts/cli/test_service_snmp.py | 2 +- smoketest/scripts/cli/test_service_ssh.py | 2 +- smoketest/scripts/cli/test_service_stunnel.py | 2 +- smoketest/scripts/cli/test_service_tftp-server.py | 2 +- smoketest/scripts/cli/test_service_webproxy.py | 2 +- smoketest/scripts/cli/test_system_acceleration_qat.py | 2 +- smoketest/scripts/cli/test_system_conntrack.py | 2 +- smoketest/scripts/cli/test_system_flow-accounting.py | 2 +- smoketest/scripts/cli/test_system_frr.py | 2 +- smoketest/scripts/cli/test_system_ip.py | 2 +- smoketest/scripts/cli/test_system_ipv6.py | 2 +- smoketest/scripts/cli/test_system_login.py | 2 +- smoketest/scripts/cli/test_system_logs.py | 2 +- smoketest/scripts/cli/test_system_option.py | 2 +- smoketest/scripts/cli/test_system_resolvconf.py | 2 +- smoketest/scripts/cli/test_system_sflow.py | 2 +- smoketest/scripts/cli/test_system_syslog.py | 2 +- smoketest/scripts/cli/test_vpn_ipsec.py | 2 +- smoketest/scripts/cli/test_vpn_l2tp.py | 2 +- smoketest/scripts/cli/test_vpn_openconnect.py | 2 +- smoketest/scripts/cli/test_vpn_pptp.py | 2 +- smoketest/scripts/cli/test_vpn_sstp.py | 2 +- smoketest/scripts/cli/test_vrf.py | 2 +- smoketest/scripts/system/test_config_mount.py | 2 +- smoketest/scripts/system/test_iproute2.py | 2 +- smoketest/scripts/system/test_kernel_options.py | 2 +- smoketest/scripts/system/test_module_load.py | 2 +- src/activation-scripts/20-ethernet_offload.py | 2 +- src/completion/list_bgp_neighbors.sh | 2 +- src/completion/list_container_sysctl_parameters.sh | 2 +- src/completion/list_ddclient_protocols.sh | 2 +- src/completion/list_disks.py | 2 +- src/completion/list_esi.sh | 2 +- src/completion/list_images.py | 2 +- src/completion/list_ipoe.py | 2 +- src/completion/list_ipsec_profile_tunnels.py | 2 +- src/completion/list_login_ttys.py | 2 +- src/completion/list_openconnect_users.py | 2 +- src/completion/list_openvpn_clients.py | 2 +- src/completion/list_openvpn_users.py | 2 +- src/completion/list_sysctl_parameters.sh | 2 +- src/completion/list_vni.sh | 2 +- src/completion/qos/list_traffic_match_group.py | 2 +- src/conf_mode/container.py | 2 +- src/conf_mode/firewall.py | 2 +- src/conf_mode/high-availability.py | 2 +- src/conf_mode/interfaces_bonding.py | 2 +- src/conf_mode/interfaces_bridge.py | 2 +- src/conf_mode/interfaces_dummy.py | 2 +- src/conf_mode/interfaces_ethernet.py | 2 +- src/conf_mode/interfaces_geneve.py | 2 +- src/conf_mode/interfaces_input.py | 2 +- src/conf_mode/interfaces_l2tpv3.py | 2 +- src/conf_mode/interfaces_loopback.py | 2 +- src/conf_mode/interfaces_macsec.py | 2 +- src/conf_mode/interfaces_openvpn.py | 2 +- src/conf_mode/interfaces_pppoe.py | 2 +- src/conf_mode/interfaces_pseudo-ethernet.py | 2 +- src/conf_mode/interfaces_sstpc.py | 2 +- src/conf_mode/interfaces_tunnel.py | 2 +- src/conf_mode/interfaces_virtual-ethernet.py | 2 +- src/conf_mode/interfaces_vti.py | 2 +- src/conf_mode/interfaces_vxlan.py | 2 +- src/conf_mode/interfaces_wireguard.py | 2 +- src/conf_mode/interfaces_wireless.py | 2 +- src/conf_mode/interfaces_wwan.py | 2 +- src/conf_mode/load-balancing_haproxy.py | 2 +- src/conf_mode/load-balancing_wan.py | 2 +- src/conf_mode/nat.py | 2 +- src/conf_mode/nat64.py | 2 +- src/conf_mode/nat66.py | 2 +- src/conf_mode/nat_cgnat.py | 2 +- src/conf_mode/netns.py | 2 +- src/conf_mode/pki.py | 2 +- src/conf_mode/policy.py | 2 +- src/conf_mode/policy_local-route.py | 2 +- src/conf_mode/policy_route.py | 2 +- src/conf_mode/protocols_babel.py | 2 +- src/conf_mode/protocols_bfd.py | 2 +- src/conf_mode/protocols_bgp.py | 2 +- src/conf_mode/protocols_eigrp.py | 2 +- src/conf_mode/protocols_failover.py | 2 +- src/conf_mode/protocols_igmp-proxy.py | 2 +- src/conf_mode/protocols_isis.py | 2 +- src/conf_mode/protocols_mpls.py | 2 +- src/conf_mode/protocols_nhrp.py | 2 +- src/conf_mode/protocols_openfabric.py | 2 +- src/conf_mode/protocols_ospf.py | 2 +- src/conf_mode/protocols_ospfv3.py | 2 +- src/conf_mode/protocols_pim.py | 2 +- src/conf_mode/protocols_pim6.py | 2 +- src/conf_mode/protocols_rip.py | 2 +- src/conf_mode/protocols_ripng.py | 2 +- src/conf_mode/protocols_rpki.py | 2 +- src/conf_mode/protocols_segment-routing.py | 2 +- src/conf_mode/protocols_static.py | 2 +- src/conf_mode/protocols_static_arp.py | 2 +- src/conf_mode/protocols_static_neighbor-proxy.py | 2 +- src/conf_mode/qos.py | 2 +- src/conf_mode/service_aws_glb.py | 2 +- src/conf_mode/service_broadcast-relay.py | 2 +- src/conf_mode/service_config-sync.py | 2 +- src/conf_mode/service_conntrack-sync.py | 2 +- src/conf_mode/service_console-server.py | 2 +- src/conf_mode/service_dhcp-relay.py | 2 +- src/conf_mode/service_dhcp-server.py | 2 +- src/conf_mode/service_dhcpv6-relay.py | 2 +- src/conf_mode/service_dhcpv6-server.py | 2 +- src/conf_mode/service_dns_dynamic.py | 2 +- src/conf_mode/service_dns_forwarding.py | 2 +- src/conf_mode/service_event-handler.py | 2 +- src/conf_mode/service_https.py | 2 +- src/conf_mode/service_ipoe-server.py | 2 +- src/conf_mode/service_lldp.py | 2 +- src/conf_mode/service_mdns_repeater.py | 2 +- src/conf_mode/service_monitoring_network_event.py | 2 +- src/conf_mode/service_monitoring_prometheus.py | 2 +- src/conf_mode/service_monitoring_telegraf.py | 2 +- src/conf_mode/service_monitoring_zabbix-agent.py | 2 +- src/conf_mode/service_ndp-proxy.py | 2 +- src/conf_mode/service_ntp.py | 2 +- src/conf_mode/service_pppoe-server.py | 2 +- src/conf_mode/service_router-advert.py | 2 +- src/conf_mode/service_salt-minion.py | 2 +- src/conf_mode/service_sla.py | 2 +- src/conf_mode/service_snmp.py | 2 +- src/conf_mode/service_ssh.py | 2 +- src/conf_mode/service_stunnel.py | 2 +- src/conf_mode/service_suricata.py | 2 +- src/conf_mode/service_tftp-server.py | 2 +- src/conf_mode/service_webproxy.py | 2 +- src/conf_mode/system_acceleration.py | 2 +- src/conf_mode/system_config-management.py | 2 +- src/conf_mode/system_conntrack.py | 2 +- src/conf_mode/system_console.py | 2 +- src/conf_mode/system_flow-accounting.py | 2 +- src/conf_mode/system_frr.py | 2 +- src/conf_mode/system_host-name.py | 2 +- src/conf_mode/system_ip.py | 2 +- src/conf_mode/system_ipv6.py | 2 +- src/conf_mode/system_lcd.py | 2 +- src/conf_mode/system_login.py | 2 +- src/conf_mode/system_login_banner.py | 2 +- src/conf_mode/system_logs.py | 2 +- src/conf_mode/system_option.py | 2 +- src/conf_mode/system_proxy.py | 2 +- src/conf_mode/system_sflow.py | 2 +- src/conf_mode/system_sysctl.py | 2 +- src/conf_mode/system_syslog.py | 2 +- src/conf_mode/system_task-scheduler.py | 2 +- src/conf_mode/system_timezone.py | 2 +- src/conf_mode/system_update-check.py | 2 +- src/conf_mode/system_wireless.py | 2 +- src/conf_mode/vpn_ipsec.py | 2 +- src/conf_mode/vpn_l2tp.py | 2 +- src/conf_mode/vpn_openconnect.py | 2 +- src/conf_mode/vpn_pptp.py | 2 +- src/conf_mode/vpn_sstp.py | 2 +- src/conf_mode/vrf.py | 2 +- src/etc/dhcp/dhclient-exit-hooks.d/99-ipsec-dhclient-hook | 2 +- src/etc/ipsec.d/vti-up-down | 2 +- src/etc/netplug/netplug | 2 +- src/etc/netplug/vyos-netplug-dhcp-client | 2 +- src/etc/ppp/ip-up.d/96-vyos-sstpc-callback | 2 +- src/etc/ppp/ip-up.d/99-vyos-pppoe-callback | 2 +- src/etc/ppp/ip-up.d/99-vyos-pppoe-wlb | 2 +- src/etc/telegraf/custom_scripts/vyos_services_input_filter.py | 2 +- .../vmware-tools/scripts/resume-vm-default.d/ether-resume.py | 2 +- src/helpers/add-system-version.py | 2 +- src/helpers/config_dependency.py | 2 +- src/helpers/geoip-update.py | 2 +- src/helpers/priority.py | 2 +- src/helpers/read-saved-value.py | 2 +- src/helpers/reset_section.py | 2 +- src/helpers/run-config-activation.py | 2 +- src/helpers/run-config-migration.py | 2 +- src/helpers/set_vyconf_backend.py | 2 +- src/helpers/show_commit_data.py | 2 +- src/helpers/strip-private.py | 2 +- src/helpers/teardown-config-session.py | 2 +- src/helpers/test_commit.py | 2 +- src/helpers/vyconf_cli.py | 2 +- src/helpers/vyos-boot-config-loader.py | 2 +- src/helpers/vyos-check-wwan.py | 2 +- src/helpers/vyos-config-encrypt.py | 2 +- src/helpers/vyos-failover.py | 2 +- src/helpers/vyos-interface-rescan.py | 2 +- src/helpers/vyos-load-balancer.py | 2 +- src/helpers/vyos-load-config.py | 2 +- src/helpers/vyos-merge-config.py | 2 +- src/helpers/vyos-save-config.py | 2 +- src/helpers/vyos_config_sync.py | 2 +- src/helpers/vyos_net_name | 2 +- src/init/vyos-router | 2 +- src/migration-scripts/bgp/0-to-1 | 2 +- src/migration-scripts/bgp/1-to-2 | 2 +- src/migration-scripts/bgp/2-to-3 | 2 +- src/migration-scripts/bgp/3-to-4 | 2 +- src/migration-scripts/bgp/4-to-5 | 2 +- src/migration-scripts/bgp/5-to-6 | 2 +- src/migration-scripts/cluster/1-to-2 | 2 +- src/migration-scripts/config-management/0-to-1 | 2 +- src/migration-scripts/conntrack-sync/1-to-2 | 2 +- src/migration-scripts/conntrack/1-to-2 | 2 +- src/migration-scripts/conntrack/2-to-3 | 2 +- src/migration-scripts/conntrack/3-to-4 | 2 +- src/migration-scripts/conntrack/4-to-5 | 2 +- src/migration-scripts/conntrack/5-to-6 | 2 +- src/migration-scripts/container/0-to-1 | 2 +- src/migration-scripts/container/1-to-2 | 2 +- src/migration-scripts/container/2-to-3 | 2 +- src/migration-scripts/dhcp-relay/1-to-2 | 2 +- src/migration-scripts/dhcp-server/10-to-11 | 2 +- src/migration-scripts/dhcp-server/4-to-5 | 2 +- src/migration-scripts/dhcp-server/5-to-6 | 2 +- src/migration-scripts/dhcp-server/6-to-7 | 2 +- src/migration-scripts/dhcp-server/7-to-8 | 2 +- src/migration-scripts/dhcp-server/8-to-9 | 2 +- src/migration-scripts/dhcp-server/9-to-10 | 2 +- src/migration-scripts/dhcpv6-server/0-to-1 | 2 +- src/migration-scripts/dhcpv6-server/1-to-2 | 2 +- src/migration-scripts/dhcpv6-server/2-to-3 | 2 +- src/migration-scripts/dhcpv6-server/3-to-4 | 2 +- src/migration-scripts/dhcpv6-server/4-to-5 | 2 +- src/migration-scripts/dhcpv6-server/5-to-6 | 2 +- src/migration-scripts/dns-dynamic/0-to-1 | 2 +- src/migration-scripts/dns-dynamic/1-to-2 | 2 +- src/migration-scripts/dns-dynamic/2-to-3 | 2 +- src/migration-scripts/dns-dynamic/3-to-4 | 2 +- src/migration-scripts/dns-forwarding/0-to-1 | 2 +- src/migration-scripts/dns-forwarding/1-to-2 | 2 +- src/migration-scripts/dns-forwarding/2-to-3 | 2 +- src/migration-scripts/dns-forwarding/3-to-4 | 2 +- src/migration-scripts/firewall/10-to-11 | 2 +- src/migration-scripts/firewall/11-to-12 | 2 +- src/migration-scripts/firewall/12-to-13 | 2 +- src/migration-scripts/firewall/13-to-14 | 2 +- src/migration-scripts/firewall/14-to-15 | 2 +- src/migration-scripts/firewall/15-to-16 | 2 +- src/migration-scripts/firewall/16-to-17 | 2 +- src/migration-scripts/firewall/17-to-18 | 2 +- src/migration-scripts/firewall/18-to-19 | 2 +- src/migration-scripts/firewall/5-to-6 | 2 +- src/migration-scripts/firewall/6-to-7 | 2 +- src/migration-scripts/firewall/7-to-8 | 2 +- src/migration-scripts/firewall/8-to-9 | 2 +- src/migration-scripts/firewall/9-to-10 | 2 +- src/migration-scripts/flow-accounting/0-to-1 | 2 +- src/migration-scripts/flow-accounting/1-to-2 | 2 +- src/migration-scripts/https/0-to-1 | 2 +- src/migration-scripts/https/1-to-2 | 2 +- src/migration-scripts/https/2-to-3 | 2 +- src/migration-scripts/https/3-to-4 | 2 +- src/migration-scripts/https/4-to-5 | 2 +- src/migration-scripts/https/5-to-6 | 2 +- src/migration-scripts/https/6-to-7 | 2 +- src/migration-scripts/ids/0-to-1 | 2 +- src/migration-scripts/ids/1-to-2 | 2 +- src/migration-scripts/interfaces/0-to-1 | 2 +- src/migration-scripts/interfaces/1-to-2 | 2 +- src/migration-scripts/interfaces/10-to-11 | 2 +- src/migration-scripts/interfaces/11-to-12 | 2 +- src/migration-scripts/interfaces/12-to-13 | 2 +- src/migration-scripts/interfaces/13-to-14 | 2 +- src/migration-scripts/interfaces/14-to-15 | 2 +- src/migration-scripts/interfaces/15-to-16 | 2 +- src/migration-scripts/interfaces/16-to-17 | 2 +- src/migration-scripts/interfaces/17-to-18 | 2 +- src/migration-scripts/interfaces/18-to-19 | 2 +- src/migration-scripts/interfaces/19-to-20 | 2 +- src/migration-scripts/interfaces/2-to-3 | 2 +- src/migration-scripts/interfaces/20-to-21 | 2 +- src/migration-scripts/interfaces/21-to-22 | 2 +- src/migration-scripts/interfaces/22-to-23 | 2 +- src/migration-scripts/interfaces/23-to-24 | 2 +- src/migration-scripts/interfaces/24-to-25 | 2 +- src/migration-scripts/interfaces/25-to-26 | 2 +- src/migration-scripts/interfaces/26-to-27 | 2 +- src/migration-scripts/interfaces/27-to-28 | 2 +- src/migration-scripts/interfaces/28-to-29 | 2 +- src/migration-scripts/interfaces/29-to-30 | 2 +- src/migration-scripts/interfaces/3-to-4 | 2 +- src/migration-scripts/interfaces/30-to-31 | 2 +- src/migration-scripts/interfaces/31-to-32 | 2 +- src/migration-scripts/interfaces/32-to-33 | 2 +- src/migration-scripts/interfaces/4-to-5 | 2 +- src/migration-scripts/interfaces/5-to-6 | 2 +- src/migration-scripts/interfaces/6-to-7 | 2 +- src/migration-scripts/interfaces/7-to-8 | 2 +- src/migration-scripts/interfaces/8-to-9 | 2 +- src/migration-scripts/interfaces/9-to-10 | 2 +- src/migration-scripts/ipoe-server/1-to-2 | 2 +- src/migration-scripts/ipoe-server/2-to-3 | 2 +- src/migration-scripts/ipoe-server/3-to-4 | 2 +- src/migration-scripts/ipsec/10-to-11 | 2 +- src/migration-scripts/ipsec/11-to-12 | 2 +- src/migration-scripts/ipsec/12-to-13 | 2 +- src/migration-scripts/ipsec/4-to-5 | 2 +- src/migration-scripts/ipsec/5-to-6 | 2 +- src/migration-scripts/ipsec/6-to-7 | 2 +- src/migration-scripts/ipsec/7-to-8 | 2 +- src/migration-scripts/ipsec/8-to-9 | 2 +- src/migration-scripts/ipsec/9-to-10 | 2 +- src/migration-scripts/isis/0-to-1 | 2 +- src/migration-scripts/isis/1-to-2 | 2 +- src/migration-scripts/isis/2-to-3 | 2 +- src/migration-scripts/l2tp/0-to-1 | 2 +- src/migration-scripts/l2tp/1-to-2 | 2 +- src/migration-scripts/l2tp/2-to-3 | 2 +- src/migration-scripts/l2tp/3-to-4 | 2 +- src/migration-scripts/l2tp/4-to-5 | 2 +- src/migration-scripts/l2tp/5-to-6 | 2 +- src/migration-scripts/l2tp/6-to-7 | 2 +- src/migration-scripts/l2tp/7-to-8 | 2 +- src/migration-scripts/l2tp/8-to-9 | 2 +- src/migration-scripts/lldp/0-to-1 | 2 +- src/migration-scripts/lldp/1-to-2 | 2 +- src/migration-scripts/lldp/2-to-3 | 2 +- src/migration-scripts/monitoring/0-to-1 | 4 ++-- src/migration-scripts/monitoring/1-to-2 | 2 +- src/migration-scripts/nat/4-to-5 | 2 +- src/migration-scripts/nat/5-to-6 | 2 +- src/migration-scripts/nat/6-to-7 | 2 +- src/migration-scripts/nat/7-to-8 | 2 +- src/migration-scripts/nat66/0-to-1 | 2 +- src/migration-scripts/nat66/1-to-2 | 4 ++-- src/migration-scripts/nat66/2-to-3 | 2 +- src/migration-scripts/nhrp/0-to-1 | 2 +- src/migration-scripts/ntp/0-to-1 | 2 +- src/migration-scripts/ntp/1-to-2 | 2 +- src/migration-scripts/ntp/2-to-3 | 2 +- src/migration-scripts/openconnect/0-to-1 | 2 +- src/migration-scripts/openconnect/1-to-2 | 2 +- src/migration-scripts/openconnect/2-to-3 | 2 +- src/migration-scripts/openvpn/0-to-1 | 2 +- src/migration-scripts/openvpn/1-to-2 | 2 +- src/migration-scripts/openvpn/2-to-3 | 2 +- src/migration-scripts/openvpn/3-to-4 | 2 +- src/migration-scripts/ospf/0-to-1 | 2 +- src/migration-scripts/ospf/1-to-2 | 2 +- src/migration-scripts/pim/0-to-1 | 2 +- src/migration-scripts/policy/0-to-1 | 2 +- src/migration-scripts/policy/1-to-2 | 2 +- src/migration-scripts/policy/2-to-3 | 2 +- src/migration-scripts/policy/3-to-4 | 2 +- src/migration-scripts/policy/4-to-5 | 2 +- src/migration-scripts/policy/5-to-6 | 2 +- src/migration-scripts/policy/6-to-7 | 2 +- src/migration-scripts/policy/7-to-8 | 2 +- src/migration-scripts/policy/8-to-9 | 2 +- src/migration-scripts/pppoe-server/0-to-1 | 2 +- src/migration-scripts/pppoe-server/1-to-2 | 2 +- src/migration-scripts/pppoe-server/10-to-11 | 2 +- src/migration-scripts/pppoe-server/2-to-3 | 2 +- src/migration-scripts/pppoe-server/3-to-4 | 2 +- src/migration-scripts/pppoe-server/4-to-5 | 2 +- src/migration-scripts/pppoe-server/5-to-6 | 2 +- src/migration-scripts/pppoe-server/6-to-7 | 2 +- src/migration-scripts/pppoe-server/7-to-8 | 2 +- src/migration-scripts/pppoe-server/8-to-9 | 2 +- src/migration-scripts/pppoe-server/9-to-10 | 2 +- src/migration-scripts/pptp/0-to-1 | 2 +- src/migration-scripts/pptp/1-to-2 | 2 +- src/migration-scripts/pptp/2-to-3 | 2 +- src/migration-scripts/pptp/3-to-4 | 2 +- src/migration-scripts/pptp/4-to-5 | 2 +- src/migration-scripts/qos/1-to-2 | 2 +- src/migration-scripts/qos/2-to-3 | 2 +- src/migration-scripts/quagga/10-to-11 | 2 +- src/migration-scripts/quagga/11-to-12 | 2 +- src/migration-scripts/quagga/2-to-3 | 2 +- src/migration-scripts/quagga/3-to-4 | 2 +- src/migration-scripts/quagga/4-to-5 | 2 +- src/migration-scripts/quagga/5-to-6 | 2 +- src/migration-scripts/quagga/6-to-7 | 2 +- src/migration-scripts/quagga/7-to-8 | 2 +- src/migration-scripts/quagga/8-to-9 | 2 +- src/migration-scripts/quagga/9-to-10 | 2 +- src/migration-scripts/reverse-proxy/0-to-1 | 2 +- src/migration-scripts/reverse-proxy/1-to-2 | 2 +- src/migration-scripts/reverse-proxy/2-to-3 | 2 +- src/migration-scripts/rip/0-to-1 | 2 +- src/migration-scripts/rpki/0-to-1 | 2 +- src/migration-scripts/rpki/1-to-2 | 2 +- src/migration-scripts/salt/0-to-1 | 2 +- src/migration-scripts/snmp/0-to-1 | 2 +- src/migration-scripts/snmp/1-to-2 | 2 +- src/migration-scripts/snmp/2-to-3 | 2 +- src/migration-scripts/ssh/0-to-1 | 2 +- src/migration-scripts/ssh/1-to-2 | 2 +- src/migration-scripts/sstp/0-to-1 | 2 +- src/migration-scripts/sstp/1-to-2 | 2 +- src/migration-scripts/sstp/2-to-3 | 2 +- src/migration-scripts/sstp/3-to-4 | 2 +- src/migration-scripts/sstp/4-to-5 | 2 +- src/migration-scripts/sstp/5-to-6 | 2 +- src/migration-scripts/system/10-to-11 | 2 +- src/migration-scripts/system/11-to-12 | 2 +- src/migration-scripts/system/12-to-13 | 2 +- src/migration-scripts/system/13-to-14 | 2 +- src/migration-scripts/system/14-to-15 | 2 +- src/migration-scripts/system/15-to-16 | 2 +- src/migration-scripts/system/16-to-17 | 2 +- src/migration-scripts/system/17-to-18 | 2 +- src/migration-scripts/system/18-to-19 | 2 +- src/migration-scripts/system/19-to-20 | 2 +- src/migration-scripts/system/20-to-21 | 2 +- src/migration-scripts/system/21-to-22 | 2 +- src/migration-scripts/system/22-to-23 | 2 +- src/migration-scripts/system/23-to-24 | 2 +- src/migration-scripts/system/24-to-25 | 2 +- src/migration-scripts/system/25-to-26 | 2 +- src/migration-scripts/system/26-to-27 | 2 +- src/migration-scripts/system/27-to-28 | 2 +- src/migration-scripts/system/28-to-29 | 2 +- src/migration-scripts/system/6-to-7 | 2 +- src/migration-scripts/system/7-to-8 | 2 +- src/migration-scripts/system/8-to-9 | 2 +- src/migration-scripts/vrf/0-to-1 | 2 +- src/migration-scripts/vrf/1-to-2 | 2 +- src/migration-scripts/vrf/2-to-3 | 2 +- src/migration-scripts/vrrp/1-to-2 | 2 +- src/migration-scripts/vrrp/2-to-3 | 2 +- src/migration-scripts/vrrp/3-to-4 | 2 +- src/migration-scripts/wanloadbalance/3-to-4 | 2 +- src/migration-scripts/webproxy/1-to-2 | 2 +- src/op_mode/accelppp.py | 2 +- src/op_mode/bgp.py | 2 +- src/op_mode/bonding.py | 2 +- src/op_mode/bridge.py | 2 +- src/op_mode/cgnat.py | 2 +- src/op_mode/clear_conntrack.py | 2 +- src/op_mode/config_mgmt.py | 2 +- src/op_mode/connect_disconnect.py | 2 +- src/op_mode/conntrack.py | 2 +- src/op_mode/conntrack_sync.py | 2 +- src/op_mode/container.py | 2 +- src/op_mode/cpu.py | 2 +- src/op_mode/dhcp.py | 2 +- src/op_mode/dns.py | 2 +- src/op_mode/evpn.py | 2 +- src/op_mode/execute_bandwidth_test.sh | 2 +- src/op_mode/execute_port-scan.py | 2 +- src/op_mode/file.py | 2 +- src/op_mode/firewall.py | 2 +- src/op_mode/flow_accounting_op.py | 2 +- src/op_mode/force_mtu_host.sh | 2 +- src/op_mode/force_root-partition-auto-resize.sh | 2 +- src/op_mode/format_disk.py | 2 +- src/op_mode/generate_interfaces_debug_archive.py | 2 +- src/op_mode/generate_ipsec_debug_archive.py | 2 +- src/op_mode/generate_openconnect_otp_key.py | 2 +- src/op_mode/generate_ovpn_client_file.py | 2 +- src/op_mode/generate_psk.py | 2 +- src/op_mode/generate_public_key_command.py | 2 +- src/op_mode/generate_service_rule-resequence.py | 2 +- src/op_mode/generate_ssh_server_key.py | 2 +- src/op_mode/generate_system_login_user.py | 2 +- src/op_mode/generate_tech-support_archive.py | 2 +- src/op_mode/igmp-proxy.py | 2 +- src/op_mode/ikev2_profile_generator.py | 2 +- src/op_mode/image_info.py | 2 +- src/op_mode/image_installer.py | 2 +- src/op_mode/image_manager.py | 2 +- src/op_mode/interfaces.py | 2 +- src/op_mode/interfaces_wireguard.py | 2 +- src/op_mode/interfaces_wireless.py | 2 +- src/op_mode/ipoe-control.py | 2 +- src/op_mode/ipsec.py | 2 +- src/op_mode/kernel_modules.py | 2 +- src/op_mode/lldp.py | 2 +- src/op_mode/load-balancing_haproxy.py | 2 +- src/op_mode/load-balancing_wan.py | 2 +- src/op_mode/log.py | 2 +- src/op_mode/maya_date.py | 2 +- src/op_mode/memory.py | 2 +- src/op_mode/mtr.py | 2 +- src/op_mode/mtr_execute.py | 2 +- src/op_mode/multicast.py | 2 +- src/op_mode/nat.py | 2 +- src/op_mode/neighbor.py | 2 +- src/op_mode/ntp.py | 2 +- src/op_mode/openconnect-control.py | 2 +- src/op_mode/openconnect.py | 2 +- src/op_mode/openvpn.py | 2 +- src/op_mode/otp.py | 4 ++-- src/op_mode/ping.py | 2 +- src/op_mode/pki.py | 2 +- src/op_mode/policy_route.py | 2 +- src/op_mode/powerctrl.py | 2 +- src/op_mode/ppp-server-ctrl.py | 2 +- src/op_mode/qos.py | 2 +- src/op_mode/raid.py | 2 +- src/op_mode/reset_openvpn.py | 2 +- src/op_mode/reset_vpn.py | 2 +- src/op_mode/reset_wireguard.py | 2 +- src/op_mode/restart.py | 2 +- src/op_mode/restart_dhcp_relay.py | 2 +- src/op_mode/restart_frr.py | 2 +- src/op_mode/route.py | 2 +- src/op_mode/secure_boot.py | 2 +- src/op_mode/serial.py | 2 +- src/op_mode/sflow.py | 2 +- src/op_mode/show-bond.py | 2 +- src/op_mode/show_acceleration.py | 2 +- src/op_mode/show_configuration_json.py | 2 +- src/op_mode/show_openconnect_otp.py | 2 +- src/op_mode/show_openvpn.py | 2 +- src/op_mode/show_openvpn_mfa.py | 2 +- src/op_mode/show_sensors.py | 2 +- src/op_mode/show_techsupport_report.py | 2 +- src/op_mode/show_usb_serial.py | 2 +- src/op_mode/show_users.py | 2 +- src/op_mode/show_virtual_server.py | 2 +- src/op_mode/show_wwan.py | 2 +- src/op_mode/snmp.py | 2 +- src/op_mode/snmp_ifmib.py | 2 +- src/op_mode/snmp_v3.py | 2 +- src/op_mode/ssh.py | 2 +- src/op_mode/storage.py | 2 +- src/op_mode/stp.py | 2 +- src/op_mode/system.py | 2 +- src/op_mode/tcpdump.py | 2 +- src/op_mode/tech_support.py | 2 +- src/op_mode/toggle_help_binding.sh | 2 +- src/op_mode/traceroute.py | 2 +- src/op_mode/uptime.py | 2 +- src/op_mode/version.py | 2 +- src/op_mode/vpn_ike_sa.py | 2 +- src/op_mode/vpn_ipsec.py | 2 +- src/op_mode/vrf.py | 2 +- src/op_mode/vrrp.py | 2 +- src/op_mode/webproxy_update_blacklist.sh | 2 +- src/op_mode/wireguard_client.py | 2 +- src/op_mode/zone.py | 2 +- src/services/api/graphql/bindings.py | 2 +- src/services/api/graphql/generate/generate_schema.py | 2 +- src/services/api/graphql/generate/schema_from_composite.py | 2 +- .../api/graphql/generate/schema_from_config_session.py | 2 +- src/services/api/graphql/generate/schema_from_op_mode.py | 2 +- src/services/api/graphql/graphql/auth_token_mutation.py | 2 +- src/services/api/graphql/graphql/directives.py | 2 +- src/services/api/graphql/graphql/mutations.py | 2 +- src/services/api/graphql/graphql/queries.py | 2 +- src/services/api/graphql/libs/key_auth.py | 2 +- src/services/api/graphql/libs/op_mode.py | 2 +- src/services/api/graphql/libs/token_auth.py | 2 +- src/services/api/graphql/routers.py | 2 +- src/services/api/graphql/session/composite/system_status.py | 2 +- .../session/override/remove_firewall_address_group_members.py | 2 +- src/services/api/graphql/session/session.py | 2 +- src/services/api/rest/models.py | 2 +- src/services/api/rest/routers.py | 2 +- src/services/api/session.py | 2 +- src/services/vyos-commitd | 2 +- src/services/vyos-configd | 2 +- src/services/vyos-conntrack-logger | 2 +- src/services/vyos-domain-resolver | 2 +- src/services/vyos-hostsd | 2 +- src/services/vyos-http-api-server | 2 +- src/services/vyos-network-event-logger | 2 +- src/shim/vyshim.c | 2 +- src/system/grub_update.py | 2 +- src/system/keepalived-fifo.py | 2 +- src/system/normalize-ip | 2 +- src/system/on-dhcp-event.sh | 2 +- src/system/on-dhcpv6-event.sh | 2 +- src/system/sync-dhcp-lease-to-hosts.py | 2 +- src/system/uacctd_stop.py | 2 +- src/system/vyos-config-cloud-init.py | 2 +- src/system/vyos-event-handler.py | 2 +- src/system/vyos-system-update-check.py | 2 +- src/tests/helper.py | 2 +- src/tests/test_config_diff.py | 2 +- src/tests/test_config_parser.py | 2 +- src/tests/test_configd_inspect.py | 2 +- src/tests/test_configverify.py | 2 +- src/tests/test_dependency_graph.py | 2 +- src/tests/test_dict_search.py | 2 +- src/tests/test_find_device_file.py | 2 +- src/tests/test_initial_setup.py | 2 +- src/tests/test_op_mode.py | 2 +- src/tests/test_task_scheduler.py | 2 +- src/tests/test_template.py | 2 +- src/tests/test_utils.py | 2 +- src/tests/test_utils_network.py | 2 +- src/utils/vyos-commands-to-config | 2 +- src/utils/vyos-config-file-query | 2 +- src/utils/vyos-hostsd-client | 2 +- src/utils/vyos-show-config | 2 +- src/validators/as-number-list | 2 +- src/validators/base64 | 2 +- src/validators/bgp-extended-community | 2 +- src/validators/bgp-large-community | 2 +- src/validators/bgp-large-community-list | 2 +- src/validators/bgp-rd-rt | 2 +- src/validators/bgp-regular-community | 2 +- src/validators/ddclient-protocol | 2 +- src/validators/ether-type | 2 +- src/validators/ip-protocol | 2 +- src/validators/psk-secret | 2 +- src/validators/script | 2 +- src/validators/sysctl | 2 +- src/validators/timezone | 2 +- src/validators/vrf-name | 2 +- src/validators/wireless-phy | 2 +- 833 files changed, 853 insertions(+), 846 deletions(-) (limited to 'src/system') diff --git a/Makefile b/Makefile index e85ccd7f4..59ecb7b51 100644 --- a/Makefile +++ b/Makefile @@ -89,7 +89,14 @@ vyshim: $(MAKE) -C $(SHIM_DIR) .PHONY: all -all: clean libvyosconfig interface_definitions op_mode_definitions test j2lint vyshim generate-configd-include-json +all: clean copyright libvyosconfig interface_definitions op_mode_definitions test j2lint vyshim generate-configd-include-json + +.PHONY: copyright +copyright: + @if git grep -q -E "Copyright (19|20)[0-9]{2}(-[0-9]{4})? VyOS maintainers"; then \ + echo "Error: Legacy copyright notice found."; \ + exit 1; \ + fi .PHONY: clean clean: diff --git a/debian/copyright b/debian/copyright index 20704c47c..b3b55b1d1 100644 --- a/debian/copyright +++ b/debian/copyright @@ -3,13 +3,13 @@ Thu, 17 Aug 2017 20:17:04 -0400 It's original content from the GIT repository -Upstream Author: +Upstream Author: -Copyright: +Copyright: - Copyright (C) 2017 VyOS maintainers and contributors + Copyright VyOS maintainers and contributors All Rights Reserved. License: diff --git a/python/vyos/accel_ppp.py b/python/vyos/accel_ppp.py index bae695fc3..b1160dc76 100644 --- a/python/vyos/accel_ppp.py +++ b/python/vyos/accel_ppp.py @@ -1,4 +1,4 @@ -# Copyright (C) 2022-2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 or later as diff --git a/python/vyos/accel_ppp_util.py b/python/vyos/accel_ppp_util.py index 49c0e3ede..85e8a964c 100644 --- a/python/vyos/accel_ppp_util.py +++ b/python/vyos/accel_ppp_util.py @@ -1,4 +1,4 @@ -# Copyright 2023-2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/airbag.py b/python/vyos/airbag.py index 3c7a144b7..a869daae8 100644 --- a/python/vyos/airbag.py +++ b/python/vyos/airbag.py @@ -1,4 +1,4 @@ -# Copyright 2019-2020 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/base.py b/python/vyos/base.py index 3173ddc20..67f92564e 100644 --- a/python/vyos/base.py +++ b/python/vyos/base.py @@ -1,4 +1,4 @@ -# Copyright 2018-2025 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/component_version.py b/python/vyos/component_version.py index 81d986658..136bd36e8 100644 --- a/python/vyos/component_version.py +++ b/python/vyos/component_version.py @@ -1,4 +1,4 @@ -# Copyright 2022-2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/compose_config.py b/python/vyos/compose_config.py index 79a8718c5..1e7837858 100644 --- a/python/vyos/compose_config.py +++ b/python/vyos/compose_config.py @@ -1,4 +1,4 @@ -# Copyright 2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/config.py b/python/vyos/config.py index f1086cd6e..6ba8834cb 100644 --- a/python/vyos/config.py +++ b/python/vyos/config.py @@ -1,4 +1,4 @@ -# Copyright 2017-2025 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/config_mgmt.py b/python/vyos/config_mgmt.py index 23eb3666e..67d03e76c 100644 --- a/python/vyos/config_mgmt.py +++ b/python/vyos/config_mgmt.py @@ -1,4 +1,4 @@ -# Copyright 2023-2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/configdep.py b/python/vyos/configdep.py index 747af8dbe..04de66493 100644 --- a/python/vyos/configdep.py +++ b/python/vyos/configdep.py @@ -1,4 +1,4 @@ -# Copyright 2023-2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/configdict.py b/python/vyos/configdict.py index 040eb49ba..d91d88d88 100644 --- a/python/vyos/configdict.py +++ b/python/vyos/configdict.py @@ -1,4 +1,4 @@ -# Copyright 2019-2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/configdiff.py b/python/vyos/configdiff.py index b6d4a5558..5e21a16e5 100644 --- a/python/vyos/configdiff.py +++ b/python/vyos/configdiff.py @@ -1,4 +1,4 @@ -# Copyright 2020-2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/configquery.py b/python/vyos/configquery.py index 4c4ead0a3..e8a3c0f99 100644 --- a/python/vyos/configquery.py +++ b/python/vyos/configquery.py @@ -1,4 +1,4 @@ -# Copyright 2021-2025 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/configsession.py b/python/vyos/configsession.py index 7af2cb333..af87d83a0 100644 --- a/python/vyos/configsession.py +++ b/python/vyos/configsession.py @@ -1,4 +1,4 @@ -# Copyright (C) 2019-2025 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or modify it under the terms of # the GNU Lesser General Public License as published by the Free Software Foundation; diff --git a/python/vyos/configsource.py b/python/vyos/configsource.py index e4ced6305..3931f1295 100644 --- a/python/vyos/configsource.py +++ b/python/vyos/configsource.py @@ -1,5 +1,5 @@ -# Copyright 2020-2025 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/configtree.py b/python/vyos/configtree.py index faf124480..9b3755841 100644 --- a/python/vyos/configtree.py +++ b/python/vyos/configtree.py @@ -1,5 +1,5 @@ # configtree -- a standalone VyOS config file manipulation library (Python bindings) -# Copyright (C) 2018-2025 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or modify it under the terms of # the GNU Lesser General Public License as published by the Free Software Foundation; diff --git a/python/vyos/configverify.py b/python/vyos/configverify.py index 07eb29a68..cc4419913 100644 --- a/python/vyos/configverify.py +++ b/python/vyos/configverify.py @@ -1,4 +1,4 @@ -# Copyright 2020-2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/debug.py b/python/vyos/debug.py index 6ce42b173..5b6e8172e 100644 --- a/python/vyos/debug.py +++ b/python/vyos/debug.py @@ -1,4 +1,4 @@ -# Copyright 2019 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/defaults.py b/python/vyos/defaults.py index 63f3b5358..fbb5a0393 100644 --- a/python/vyos/defaults.py +++ b/python/vyos/defaults.py @@ -1,4 +1,4 @@ -# Copyright 2018-2025 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/ethtool.py b/python/vyos/ethtool.py index 4710a5d40..6c362163c 100644 --- a/python/vyos/ethtool.py +++ b/python/vyos/ethtool.py @@ -1,4 +1,4 @@ -# Copyright 2021-2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/firewall.py b/python/vyos/firewall.py index 64022db84..5bb7afecc 100755 --- a/python/vyos/firewall.py +++ b/python/vyos/firewall.py @@ -1,4 +1,4 @@ -# Copyright (C) 2021-2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 or later as diff --git a/python/vyos/frrender.py b/python/vyos/frrender.py index d9e409cb4..f4ed69205 100644 --- a/python/vyos/frrender.py +++ b/python/vyos/frrender.py @@ -1,4 +1,4 @@ -# Copyright 2024-2025 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/ifconfig/__init__.py b/python/vyos/ifconfig/__init__.py index 206b2bba1..7838fa9a2 100644 --- a/python/vyos/ifconfig/__init__.py +++ b/python/vyos/ifconfig/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2019-2022 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/ifconfig/afi.py b/python/vyos/ifconfig/afi.py index fd263d220..a391cb8a0 100644 --- a/python/vyos/ifconfig/afi.py +++ b/python/vyos/ifconfig/afi.py @@ -1,4 +1,4 @@ -# Copyright 2019 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/ifconfig/bond.py b/python/vyos/ifconfig/bond.py index a659b9bd2..8a97243c5 100644 --- a/python/vyos/ifconfig/bond.py +++ b/python/vyos/ifconfig/bond.py @@ -1,4 +1,4 @@ -# Copyright 2019-2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/ifconfig/bridge.py b/python/vyos/ifconfig/bridge.py index 69dae42d3..ba06e3757 100644 --- a/python/vyos/ifconfig/bridge.py +++ b/python/vyos/ifconfig/bridge.py @@ -1,4 +1,4 @@ -# Copyright 2019-2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/ifconfig/control.py b/python/vyos/ifconfig/control.py index a886c1b9e..e5672ed50 100644 --- a/python/vyos/ifconfig/control.py +++ b/python/vyos/ifconfig/control.py @@ -1,4 +1,4 @@ -# Copyright 2019-2023 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/ifconfig/dummy.py b/python/vyos/ifconfig/dummy.py index 29a1965a3..93066c965 100644 --- a/python/vyos/ifconfig/dummy.py +++ b/python/vyos/ifconfig/dummy.py @@ -1,4 +1,4 @@ -# Copyright 2019-2021 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/ifconfig/ethernet.py b/python/vyos/ifconfig/ethernet.py index 93727bdf6..864a9d0bc 100644 --- a/python/vyos/ifconfig/ethernet.py +++ b/python/vyos/ifconfig/ethernet.py @@ -1,4 +1,4 @@ -# Copyright 2019-2023 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/ifconfig/geneve.py b/python/vyos/ifconfig/geneve.py index f53ef4166..7c5b7c0fb 100644 --- a/python/vyos/ifconfig/geneve.py +++ b/python/vyos/ifconfig/geneve.py @@ -1,4 +1,4 @@ -# Copyright 2019-2021 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/ifconfig/input.py b/python/vyos/ifconfig/input.py index 201d3cacb..6cb1eb64c 100644 --- a/python/vyos/ifconfig/input.py +++ b/python/vyos/ifconfig/input.py @@ -1,4 +1,4 @@ -# Copyright 2023 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/ifconfig/interface.py b/python/vyos/ifconfig/interface.py index 91b3a0c28..ca50d6ec1 100644 --- a/python/vyos/ifconfig/interface.py +++ b/python/vyos/ifconfig/interface.py @@ -1,4 +1,4 @@ -# Copyright 2019-2025 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/ifconfig/l2tpv3.py b/python/vyos/ifconfig/l2tpv3.py index dfaa006aa..ea9294e99 100644 --- a/python/vyos/ifconfig/l2tpv3.py +++ b/python/vyos/ifconfig/l2tpv3.py @@ -1,4 +1,4 @@ -# Copyright 2019-2023 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/ifconfig/loopback.py b/python/vyos/ifconfig/loopback.py index 13e8a2c50..f4fc2c906 100644 --- a/python/vyos/ifconfig/loopback.py +++ b/python/vyos/ifconfig/loopback.py @@ -1,4 +1,4 @@ -# Copyright 2019-2022 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/ifconfig/macsec.py b/python/vyos/ifconfig/macsec.py index 3b4dc223f..4d76a1d46 100644 --- a/python/vyos/ifconfig/macsec.py +++ b/python/vyos/ifconfig/macsec.py @@ -1,4 +1,4 @@ -# Copyright 2020-2023 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/ifconfig/macvlan.py b/python/vyos/ifconfig/macvlan.py index fe948b920..7a26f9ef5 100644 --- a/python/vyos/ifconfig/macvlan.py +++ b/python/vyos/ifconfig/macvlan.py @@ -1,4 +1,4 @@ -# Copyright 2019-2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/ifconfig/operational.py b/python/vyos/ifconfig/operational.py index dc2742123..e60518948 100644 --- a/python/vyos/ifconfig/operational.py +++ b/python/vyos/ifconfig/operational.py @@ -1,4 +1,4 @@ -# Copyright 2019 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/ifconfig/pppoe.py b/python/vyos/ifconfig/pppoe.py index 85ca3877e..4ca66cf4d 100644 --- a/python/vyos/ifconfig/pppoe.py +++ b/python/vyos/ifconfig/pppoe.py @@ -1,4 +1,4 @@ -# Copyright 2020-2022 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/ifconfig/section.py b/python/vyos/ifconfig/section.py index 50273cf67..4ea606495 100644 --- a/python/vyos/ifconfig/section.py +++ b/python/vyos/ifconfig/section.py @@ -1,4 +1,4 @@ -# Copyright 2020 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/ifconfig/sstpc.py b/python/vyos/ifconfig/sstpc.py index d92ef23dc..e43a2f177 100644 --- a/python/vyos/ifconfig/sstpc.py +++ b/python/vyos/ifconfig/sstpc.py @@ -1,4 +1,4 @@ -# Copyright 2022 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/ifconfig/tunnel.py b/python/vyos/ifconfig/tunnel.py index df904f7d5..f96364161 100644 --- a/python/vyos/ifconfig/tunnel.py +++ b/python/vyos/ifconfig/tunnel.py @@ -1,4 +1,4 @@ -# Copyright 2019-2021 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/ifconfig/veth.py b/python/vyos/ifconfig/veth.py index 2c8709d20..f4075fa02 100644 --- a/python/vyos/ifconfig/veth.py +++ b/python/vyos/ifconfig/veth.py @@ -1,4 +1,4 @@ -# Copyright 2022 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/ifconfig/vrrp.py b/python/vyos/ifconfig/vrrp.py index 3ee22706c..4949fe571 100644 --- a/python/vyos/ifconfig/vrrp.py +++ b/python/vyos/ifconfig/vrrp.py @@ -1,4 +1,4 @@ -# Copyright 2019-2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/ifconfig/vti.py b/python/vyos/ifconfig/vti.py index 78f5895f8..030aa1ed7 100644 --- a/python/vyos/ifconfig/vti.py +++ b/python/vyos/ifconfig/vti.py @@ -1,4 +1,4 @@ -# Copyright 2021-2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/ifconfig/vtun.py b/python/vyos/ifconfig/vtun.py index ee790f275..e6963ce5d 100644 --- a/python/vyos/ifconfig/vtun.py +++ b/python/vyos/ifconfig/vtun.py @@ -1,4 +1,4 @@ -# Copyright 2020-2021 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/ifconfig/vxlan.py b/python/vyos/ifconfig/vxlan.py index 58844885b..0f55acf10 100644 --- a/python/vyos/ifconfig/vxlan.py +++ b/python/vyos/ifconfig/vxlan.py @@ -1,4 +1,4 @@ -# Copyright 2019-2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/ifconfig/wireguard.py b/python/vyos/ifconfig/wireguard.py index 6b5e52412..c4e70056c 100644 --- a/python/vyos/ifconfig/wireguard.py +++ b/python/vyos/ifconfig/wireguard.py @@ -1,4 +1,4 @@ -# Copyright 2019-2025 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/ifconfig/wireless.py b/python/vyos/ifconfig/wireless.py index 121f56bd5..69fd87347 100644 --- a/python/vyos/ifconfig/wireless.py +++ b/python/vyos/ifconfig/wireless.py @@ -1,4 +1,4 @@ -# Copyright 2020-2021 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/ifconfig/wwan.py b/python/vyos/ifconfig/wwan.py index 004a64b39..2b5714b85 100644 --- a/python/vyos/ifconfig/wwan.py +++ b/python/vyos/ifconfig/wwan.py @@ -1,4 +1,4 @@ -# Copyright 2021 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/iflag.py b/python/vyos/iflag.py index 3ce73c1bf..179f33497 100644 --- a/python/vyos/iflag.py +++ b/python/vyos/iflag.py @@ -1,4 +1,4 @@ -# Copyright 2019-2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/include/__init__.py b/python/vyos/include/__init__.py index 22e836531..ba196ffed 100644 --- a/python/vyos/include/__init__.py +++ b/python/vyos/include/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2025 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/include/uapi/__init__.py b/python/vyos/include/uapi/__init__.py index 22e836531..ba196ffed 100644 --- a/python/vyos/include/uapi/__init__.py +++ b/python/vyos/include/uapi/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2025 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/include/uapi/linux/__init__.py b/python/vyos/include/uapi/linux/__init__.py index 22e836531..ba196ffed 100644 --- a/python/vyos/include/uapi/linux/__init__.py +++ b/python/vyos/include/uapi/linux/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2025 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/include/uapi/linux/fib_rules.py b/python/vyos/include/uapi/linux/fib_rules.py index 72f0b18cb..83544f69b 100644 --- a/python/vyos/include/uapi/linux/fib_rules.py +++ b/python/vyos/include/uapi/linux/fib_rules.py @@ -1,4 +1,4 @@ -# Copyright (C) 2025 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 or later as diff --git a/python/vyos/include/uapi/linux/icmpv6.py b/python/vyos/include/uapi/linux/icmpv6.py index 47e0c723c..cc30b76fd 100644 --- a/python/vyos/include/uapi/linux/icmpv6.py +++ b/python/vyos/include/uapi/linux/icmpv6.py @@ -1,4 +1,4 @@ -# Copyright (C) 2025 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 or later as diff --git a/python/vyos/include/uapi/linux/if_arp.py b/python/vyos/include/uapi/linux/if_arp.py index 90cb66ebd..80c16a83d 100644 --- a/python/vyos/include/uapi/linux/if_arp.py +++ b/python/vyos/include/uapi/linux/if_arp.py @@ -1,4 +1,4 @@ -# Copyright (C) 2025 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 or later as diff --git a/python/vyos/include/uapi/linux/lwtunnel.py b/python/vyos/include/uapi/linux/lwtunnel.py index 6797a762b..c598513a5 100644 --- a/python/vyos/include/uapi/linux/lwtunnel.py +++ b/python/vyos/include/uapi/linux/lwtunnel.py @@ -1,4 +1,4 @@ -# Copyright (C) 2025 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 or later as diff --git a/python/vyos/include/uapi/linux/neighbour.py b/python/vyos/include/uapi/linux/neighbour.py index d5caf44b9..8878353e3 100644 --- a/python/vyos/include/uapi/linux/neighbour.py +++ b/python/vyos/include/uapi/linux/neighbour.py @@ -1,4 +1,4 @@ -# Copyright (C) 2025 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 or later as diff --git a/python/vyos/include/uapi/linux/rtnetlink.py b/python/vyos/include/uapi/linux/rtnetlink.py index e31272460..f3778fa65 100644 --- a/python/vyos/include/uapi/linux/rtnetlink.py +++ b/python/vyos/include/uapi/linux/rtnetlink.py @@ -1,4 +1,4 @@ -# Copyright (C) 2025 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 or later as diff --git a/python/vyos/initialsetup.py b/python/vyos/initialsetup.py index cb6b9e459..bff3adf20 100644 --- a/python/vyos/initialsetup.py +++ b/python/vyos/initialsetup.py @@ -1,7 +1,7 @@ # initialsetup -- functions for setting common values in config file, # for use in installation and first boot scripts # -# Copyright (C) 2018-2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or modify it under the terms of # the GNU Lesser General Public License as published by the Free Software Foundation; diff --git a/python/vyos/ioctl.py b/python/vyos/ioctl.py index 51574c1db..7f9ad226a 100644 --- a/python/vyos/ioctl.py +++ b/python/vyos/ioctl.py @@ -1,4 +1,4 @@ -# Copyright 2019-2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/ipsec.py b/python/vyos/ipsec.py index 28f77565a..81f3d0812 100644 --- a/python/vyos/ipsec.py +++ b/python/vyos/ipsec.py @@ -1,4 +1,4 @@ -# Copyright 2020-2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/kea.py b/python/vyos/kea.py index 5eecbbaad..15c8564b0 100644 --- a/python/vyos/kea.py +++ b/python/vyos/kea.py @@ -1,4 +1,4 @@ -# Copyright 2023-2025 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/limericks.py b/python/vyos/limericks.py index 3c6744816..0c02d5292 100644 --- a/python/vyos/limericks.py +++ b/python/vyos/limericks.py @@ -1,4 +1,4 @@ -# Copyright 2015, 2018 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/load_config.py b/python/vyos/load_config.py index b910a2f92..f65e887f0 100644 --- a/python/vyos/load_config.py +++ b/python/vyos/load_config.py @@ -1,4 +1,4 @@ -# Copyright 2023-2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/logger.py b/python/vyos/logger.py index f7cc964d5..207f95c1b 100644 --- a/python/vyos/logger.py +++ b/python/vyos/logger.py @@ -1,4 +1,4 @@ -# Copyright 2020 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/migrate.py b/python/vyos/migrate.py index 9d1613676..c06f6a76c 100644 --- a/python/vyos/migrate.py +++ b/python/vyos/migrate.py @@ -1,4 +1,4 @@ -# Copyright 2019-2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/nat.py b/python/vyos/nat.py index 29f8e961b..7be957a0c 100644 --- a/python/vyos/nat.py +++ b/python/vyos/nat.py @@ -1,4 +1,4 @@ -# Copyright (C) 2022 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 or later as diff --git a/python/vyos/opmode.py b/python/vyos/opmode.py index 7b11d36dd..7f1fc6b4f 100644 --- a/python/vyos/opmode.py +++ b/python/vyos/opmode.py @@ -1,4 +1,4 @@ -# Copyright 2022-2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/pki.py b/python/vyos/pki.py index 55dc02631..4598c5daa 100644 --- a/python/vyos/pki.py +++ b/python/vyos/pki.py @@ -1,4 +1,4 @@ -# Copyright (C) 2023-2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 or later as diff --git a/python/vyos/priority.py b/python/vyos/priority.py index ab4e6d411..e61281d3c 100644 --- a/python/vyos/priority.py +++ b/python/vyos/priority.py @@ -1,4 +1,4 @@ -# Copyright 2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/progressbar.py b/python/vyos/progressbar.py index 8d1042672..eb8ed474a 100644 --- a/python/vyos/progressbar.py +++ b/python/vyos/progressbar.py @@ -1,4 +1,4 @@ -# Copyright 2023-2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/proto/generate_dataclass.py b/python/vyos/proto/generate_dataclass.py index c6296c568..64485cd10 100755 --- a/python/vyos/proto/generate_dataclass.py +++ b/python/vyos/proto/generate_dataclass.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# Copyright (C) 2025 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 or later as diff --git a/python/vyos/proto/vyconf_client.py b/python/vyos/proto/vyconf_client.py index b385f0951..a3ba9864c 100644 --- a/python/vyos/proto/vyconf_client.py +++ b/python/vyos/proto/vyconf_client.py @@ -1,4 +1,4 @@ -# Copyright 2025 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/qos/__init__.py b/python/vyos/qos/__init__.py index a2980ccde..4bffda2d2 100644 --- a/python/vyos/qos/__init__.py +++ b/python/vyos/qos/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2022 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/qos/base.py b/python/vyos/qos/base.py index b477b5b5e..487249714 100644 --- a/python/vyos/qos/base.py +++ b/python/vyos/qos/base.py @@ -1,4 +1,4 @@ -# Copyright 2022-2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/qos/cake.py b/python/vyos/qos/cake.py index ca5a26917..626cedb8f 100644 --- a/python/vyos/qos/cake.py +++ b/python/vyos/qos/cake.py @@ -1,4 +1,4 @@ -# Copyright 2022 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/qos/droptail.py b/python/vyos/qos/droptail.py index 427d43d19..223ab1e64 100644 --- a/python/vyos/qos/droptail.py +++ b/python/vyos/qos/droptail.py @@ -1,4 +1,4 @@ -# Copyright 2022 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/qos/fairqueue.py b/python/vyos/qos/fairqueue.py index f41d098fb..8f4fe2d47 100644 --- a/python/vyos/qos/fairqueue.py +++ b/python/vyos/qos/fairqueue.py @@ -1,4 +1,4 @@ -# Copyright 2022 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/qos/fqcodel.py b/python/vyos/qos/fqcodel.py index cd2340aa2..d574226ef 100644 --- a/python/vyos/qos/fqcodel.py +++ b/python/vyos/qos/fqcodel.py @@ -1,4 +1,4 @@ -# Copyright 2022 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/qos/limiter.py b/python/vyos/qos/limiter.py index 3f5c11112..dce376d3e 100644 --- a/python/vyos/qos/limiter.py +++ b/python/vyos/qos/limiter.py @@ -1,4 +1,4 @@ -# Copyright 2022 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/qos/netem.py b/python/vyos/qos/netem.py index 8bdef300b..8fdd75387 100644 --- a/python/vyos/qos/netem.py +++ b/python/vyos/qos/netem.py @@ -1,4 +1,4 @@ -# Copyright 2022 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/qos/priority.py b/python/vyos/qos/priority.py index 66d27a639..5f373f696 100644 --- a/python/vyos/qos/priority.py +++ b/python/vyos/qos/priority.py @@ -1,4 +1,4 @@ -# Copyright 2022-2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/qos/randomdetect.py b/python/vyos/qos/randomdetect.py index a3a39da36..63445bb62 100644 --- a/python/vyos/qos/randomdetect.py +++ b/python/vyos/qos/randomdetect.py @@ -1,4 +1,4 @@ -# Copyright 2022 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/qos/ratelimiter.py b/python/vyos/qos/ratelimiter.py index a4f80a1be..b0d7b3072 100644 --- a/python/vyos/qos/ratelimiter.py +++ b/python/vyos/qos/ratelimiter.py @@ -1,4 +1,4 @@ -# Copyright 2022 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/qos/roundrobin.py b/python/vyos/qos/roundrobin.py index 509c4069f..d07dc0f52 100644 --- a/python/vyos/qos/roundrobin.py +++ b/python/vyos/qos/roundrobin.py @@ -1,4 +1,4 @@ -# Copyright 2022 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/qos/trafficshaper.py b/python/vyos/qos/trafficshaper.py index 9f92ccd8b..3840e7d0e 100644 --- a/python/vyos/qos/trafficshaper.py +++ b/python/vyos/qos/trafficshaper.py @@ -1,4 +1,4 @@ -# Copyright 2022-2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/raid.py b/python/vyos/raid.py index 7fb794817..4ae63a100 100644 --- a/python/vyos/raid.py +++ b/python/vyos/raid.py @@ -1,4 +1,4 @@ -# Copyright 2023 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/remote.py b/python/vyos/remote.py index c54fb6031..f6ab5c3f9 100644 --- a/python/vyos/remote.py +++ b/python/vyos/remote.py @@ -1,4 +1,4 @@ -# Copyright 2021 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/snmpv3_hashgen.py b/python/vyos/snmpv3_hashgen.py index 324c3274d..57dba07a0 100644 --- a/python/vyos/snmpv3_hashgen.py +++ b/python/vyos/snmpv3_hashgen.py @@ -1,4 +1,4 @@ -# Copyright 2020 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/system/__init__.py b/python/vyos/system/__init__.py index 0c91330ba..42af8e3e8 100644 --- a/python/vyos/system/__init__.py +++ b/python/vyos/system/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2023 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/system/compat.py b/python/vyos/system/compat.py index d35bddea2..23a34d38a 100644 --- a/python/vyos/system/compat.py +++ b/python/vyos/system/compat.py @@ -1,4 +1,4 @@ -# Copyright 2023-2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/system/disk.py b/python/vyos/system/disk.py index c8908cd5c..268a3b195 100644 --- a/python/vyos/system/disk.py +++ b/python/vyos/system/disk.py @@ -1,4 +1,4 @@ -# Copyright 2023 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/system/grub.py b/python/vyos/system/grub.py index de8303ee2..0f04fa5e9 100644 --- a/python/vyos/system/grub.py +++ b/python/vyos/system/grub.py @@ -1,4 +1,4 @@ -# Copyright 2023-2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/system/grub_util.py b/python/vyos/system/grub_util.py index ad95bb4f9..e534334e6 100644 --- a/python/vyos/system/grub_util.py +++ b/python/vyos/system/grub_util.py @@ -1,4 +1,4 @@ -# Copyright 2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/system/image.py b/python/vyos/system/image.py index aae52e770..ed8a96fbb 100644 --- a/python/vyos/system/image.py +++ b/python/vyos/system/image.py @@ -1,4 +1,4 @@ -# Copyright 2023-2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/system/raid.py b/python/vyos/system/raid.py index 5b33d34da..c03764ad1 100644 --- a/python/vyos/system/raid.py +++ b/python/vyos/system/raid.py @@ -1,4 +1,4 @@ -# Copyright 2023 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/template.py b/python/vyos/template.py index bf2f13183..9a9234490 100755 --- a/python/vyos/template.py +++ b/python/vyos/template.py @@ -1,4 +1,4 @@ -# Copyright 2019-2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/tpm.py b/python/vyos/tpm.py index a24f149fd..663490dec 100644 --- a/python/vyos/tpm.py +++ b/python/vyos/tpm.py @@ -1,4 +1,4 @@ -# Copyright (C) 2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 or later as diff --git a/python/vyos/utils/__init__.py b/python/vyos/utils/__init__.py index 3759b2125..280cde17f 100644 --- a/python/vyos/utils/__init__.py +++ b/python/vyos/utils/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/utils/assertion.py b/python/vyos/utils/assertion.py index c7fa220c3..aa0614743 100644 --- a/python/vyos/utils/assertion.py +++ b/python/vyos/utils/assertion.py @@ -1,4 +1,4 @@ -# Copyright 2023 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/utils/auth.py b/python/vyos/utils/auth.py index 5d0e3464a..6e816af71 100644 --- a/python/vyos/utils/auth.py +++ b/python/vyos/utils/auth.py @@ -1,6 +1,6 @@ # authutils -- miscelanneous functions for handling passwords and publis keys # -# Copyright (C) 2023-2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or modify it under the terms of # the GNU Lesser General Public License as published by the Free Software Foundation; diff --git a/python/vyos/utils/backend.py b/python/vyos/utils/backend.py index 400ea9b69..1234e9aa4 100644 --- a/python/vyos/utils/backend.py +++ b/python/vyos/utils/backend.py @@ -1,4 +1,4 @@ -# Copyright 2025 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/utils/boot.py b/python/vyos/utils/boot.py index 708bef14d..f804cd94e 100644 --- a/python/vyos/utils/boot.py +++ b/python/vyos/utils/boot.py @@ -1,4 +1,4 @@ -# Copyright 2023-2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/utils/commit.py b/python/vyos/utils/commit.py index fc259dadb..4147c7fba 100644 --- a/python/vyos/utils/commit.py +++ b/python/vyos/utils/commit.py @@ -1,4 +1,4 @@ -# Copyright 2023-2025 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/utils/config.py b/python/vyos/utils/config.py index deda13c13..1f067e91e 100644 --- a/python/vyos/utils/config.py +++ b/python/vyos/utils/config.py @@ -1,4 +1,4 @@ -# Copyright 2023-2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/utils/configfs.py b/python/vyos/utils/configfs.py index 8617f0129..307e1446c 100644 --- a/python/vyos/utils/configfs.py +++ b/python/vyos/utils/configfs.py @@ -1,4 +1,4 @@ -# Copyright 2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/utils/convert.py b/python/vyos/utils/convert.py index 2f587405d..ea07f9514 100644 --- a/python/vyos/utils/convert.py +++ b/python/vyos/utils/convert.py @@ -1,4 +1,4 @@ -# Copyright 2023-2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/utils/cpu.py b/python/vyos/utils/cpu.py index 6f21eb526..0f47123a4 100644 --- a/python/vyos/utils/cpu.py +++ b/python/vyos/utils/cpu.py @@ -1,4 +1,4 @@ -# Copyright (C) 2022-2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/utils/dict.py b/python/vyos/utils/dict.py index 1a7a6b96f..e6ef943c6 100644 --- a/python/vyos/utils/dict.py +++ b/python/vyos/utils/dict.py @@ -1,4 +1,4 @@ -# Copyright 2023 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/utils/disk.py b/python/vyos/utils/disk.py index d4271ebe1..b822badde 100644 --- a/python/vyos/utils/disk.py +++ b/python/vyos/utils/disk.py @@ -1,4 +1,4 @@ -# Copyright 2023-2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/utils/error.py b/python/vyos/utils/error.py index 8d4709bff..75ad813f3 100644 --- a/python/vyos/utils/error.py +++ b/python/vyos/utils/error.py @@ -1,4 +1,4 @@ -# Copyright 2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/utils/file.py b/python/vyos/utils/file.py index cc46d77d1..31c2361df 100644 --- a/python/vyos/utils/file.py +++ b/python/vyos/utils/file.py @@ -1,4 +1,4 @@ -# Copyright 2023 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/utils/io.py b/python/vyos/utils/io.py index 205210b66..0883376d1 100644 --- a/python/vyos/utils/io.py +++ b/python/vyos/utils/io.py @@ -1,4 +1,4 @@ -# Copyright 2023 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/utils/kernel.py b/python/vyos/utils/kernel.py index 05eac8a6a..4d8544670 100644 --- a/python/vyos/utils/kernel.py +++ b/python/vyos/utils/kernel.py @@ -1,4 +1,4 @@ -# Copyright 2023-2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/utils/list.py b/python/vyos/utils/list.py index 63ef720ab..931084e7c 100644 --- a/python/vyos/utils/list.py +++ b/python/vyos/utils/list.py @@ -1,4 +1,4 @@ -# Copyright 2023 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/utils/locking.py b/python/vyos/utils/locking.py index 63cb1a816..f4cd6fd41 100644 --- a/python/vyos/utils/locking.py +++ b/python/vyos/utils/locking.py @@ -1,4 +1,4 @@ -# Copyright 2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/utils/misc.py b/python/vyos/utils/misc.py index d82655914..0ffd82696 100644 --- a/python/vyos/utils/misc.py +++ b/python/vyos/utils/misc.py @@ -1,4 +1,4 @@ -# Copyright 2023 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/utils/network.py b/python/vyos/utils/network.py index 0a84be478..2182642dd 100644 --- a/python/vyos/utils/network.py +++ b/python/vyos/utils/network.py @@ -1,4 +1,4 @@ -# Copyright 2023 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/utils/permission.py b/python/vyos/utils/permission.py index d938b494f..efd44bfeb 100644 --- a/python/vyos/utils/permission.py +++ b/python/vyos/utils/permission.py @@ -1,4 +1,4 @@ -# Copyright 2023 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/utils/process.py b/python/vyos/utils/process.py index 21335e6b3..86a2747af 100644 --- a/python/vyos/utils/process.py +++ b/python/vyos/utils/process.py @@ -1,4 +1,4 @@ -# Copyright 2023 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/utils/serial.py b/python/vyos/utils/serial.py index b646f881e..68aad676e 100644 --- a/python/vyos/utils/serial.py +++ b/python/vyos/utils/serial.py @@ -1,4 +1,4 @@ -# Copyright 2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/utils/session.py b/python/vyos/utils/session.py index 28559dc59..bc5240fc7 100644 --- a/python/vyos/utils/session.py +++ b/python/vyos/utils/session.py @@ -1,4 +1,4 @@ -# Copyright 2025 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/utils/strip_config.py b/python/vyos/utils/strip_config.py index 7a9c78c9f..17f6867cb 100644 --- a/python/vyos/utils/strip_config.py +++ b/python/vyos/utils/strip_config.py @@ -1,6 +1,6 @@ #!/usr/bin/python3 # -# Copyright 2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/utils/system.py b/python/vyos/utils/system.py index 6c112334b..e2197daf2 100644 --- a/python/vyos/utils/system.py +++ b/python/vyos/utils/system.py @@ -1,4 +1,4 @@ -# Copyright 2023-2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/utils/vti_updown_db.py b/python/vyos/utils/vti_updown_db.py index b491fc6f2..f4dd24007 100644 --- a/python/vyos/utils/vti_updown_db.py +++ b/python/vyos/utils/vti_updown_db.py @@ -1,4 +1,4 @@ -# Copyright 2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/version.py b/python/vyos/version.py index 86e96d0ec..01986e4da 100644 --- a/python/vyos/version.py +++ b/python/vyos/version.py @@ -1,4 +1,4 @@ -# Copyright 2017-2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/vyconf_session.py b/python/vyos/vyconf_session.py index 3cf847b6c..4a2e6e393 100644 --- a/python/vyos/vyconf_session.py +++ b/python/vyos/vyconf_session.py @@ -1,4 +1,4 @@ -# Copyright 2025 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/wanloadbalance.py b/python/vyos/wanloadbalance.py index 62e109f21..2381f7d1c 100644 --- a/python/vyos/wanloadbalance.py +++ b/python/vyos/wanloadbalance.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# Copyright (C) 2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 or later as diff --git a/python/vyos/xml_ref/__init__.py b/python/vyos/xml_ref/__init__.py index cd50a3ec2..41a25049e 100644 --- a/python/vyos/xml_ref/__init__.py +++ b/python/vyos/xml_ref/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/xml_ref/definition.py b/python/vyos/xml_ref/definition.py index 4e755ab72..015e7ee6e 100644 --- a/python/vyos/xml_ref/definition.py +++ b/python/vyos/xml_ref/definition.py @@ -1,4 +1,4 @@ -# Copyright 2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/xml_ref/generate_cache.py b/python/vyos/xml_ref/generate_cache.py index 093697993..f0a3ec35b 100755 --- a/python/vyos/xml_ref/generate_cache.py +++ b/python/vyos/xml_ref/generate_cache.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# Copyright (C) 2023-2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 or later as diff --git a/python/vyos/xml_ref/generate_op_cache.py b/python/vyos/xml_ref/generate_op_cache.py index 29697dc58..7a6974730 100755 --- a/python/vyos/xml_ref/generate_op_cache.py +++ b/python/vyos/xml_ref/generate_op_cache.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# Copyright (C) 2024-2025 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 or later as diff --git a/python/vyos/xml_ref/op_definition.py b/python/vyos/xml_ref/op_definition.py index 8e922ecb2..f749e0585 100644 --- a/python/vyos/xml_ref/op_definition.py +++ b/python/vyos/xml_ref/op_definition.py @@ -1,4 +1,4 @@ -# Copyright 2024 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/python/vyos/xml_ref/update_cache.py b/python/vyos/xml_ref/update_cache.py index 0842bcbe9..6643f9dc4 100755 --- a/python/vyos/xml_ref/update_cache.py +++ b/python/vyos/xml_ref/update_cache.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# Copyright (C) 2023 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 or later as diff --git a/schema/interface_definition.rnc b/schema/interface_definition.rnc index 9434f5d18..a338b875f 100644 --- a/schema/interface_definition.rnc +++ b/schema/interface_definition.rnc @@ -1,6 +1,6 @@ # interface_definition.rnc: VyConf reference tree XML grammar # -# Copyright (C) 2014. 2017 VyOS maintainers and contributors +# Copyright VyOS maintainers and contributors # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/schema/interface_definition.rng b/schema/interface_definition.rng index e3d582452..d653d1b01 100644 --- a/schema/interface_definition.rng +++ b/schema/interface_definition.rng @@ -2,19 +2,19 @@ +#include + + + Dynamically update Domain Name System (RFC4702) + + + #include + + + TSIG key definition for DNS updates + + #include + + Invalid TSIG key name. May only contain letters, numbers, hyphen and underscore + + + + + TSIG key algorithm + + md5 sha1 sha224 sha256 sha384 sha512 + + + md5 + MD5 HMAC algorithm + + + sha1 + SHA1 HMAC algorithm + + + sha224 + SHA224 HMAC algorithm + + + sha256 + SHA256 HMAC algorithm + + + sha384 + SHA384 HMAC algorithm + + + sha512 + SHA512 HMAC algorithm + + + (md5|sha1|sha224|sha256|sha384|sha512) + + Invalid TSIG key algorithm + + + + + TSIG key secret (base64-encoded) + + + + + + + + + + Forward DNS domain name + + + + Invalid forward DNS domain name + + + + + TSIG key name for forward DNS updates + + #include + + Invalid TSIG key name. May only contain letters, numbers, numbers, hyphen and underscore + + + #include + + + + + Reverse DNS domain name + + + + Invalid reverse DNS domain name + + + + + TSIG key name for reverse DNS updates + + #include + + Invalid TSIG key name. May only contain letters, numbers, numbers, hyphen and underscore + + + #include + + + + + + + DHCP high availability configuration + + + #include + + + Configure high availability mode + + active-active active-passive + + + active-active + Both server attend DHCP requests + + + active-passive + Only primary server attends DHCP requests + + + (active-active|active-passive) + + Invalid DHCP high availability mode + + active-active + + + + IPv4 remote address used for connection + + ipv4 + IPv4 address of high availability peer + + + + + + + + + Peer name used to identify connection + + #include + + Invalid failover peer name. May only contain letters, numbers and .-_ + + + + + High availability hierarchy + + primary secondary + + + primary + Configure this server to be the primary node + + + secondary + Configure this server to be the secondary node + + + (primary|secondary) + + Invalid DHCP high availability peer status + + + #include + #include + + + + + Updating /etc/hosts file (per client lease) + + + +#include +#include + + + Name of DHCP shared network + + #include + + Invalid shared network name. May only contain letters, numbers and .-_ + + + + + Dynamically update Domain Name System (RFC4702) + + + #include + + + + + Option to make DHCP server authoritative for this physical network + + + + #include + #include + #include + #include + + + DHCP subnet for shared network + + ipv4net + IPv4 address and prefix length + + + + + Invalid IPv4 subnet definition + + + #include + #include + #include + #include + + + Dynamically update Domain Name System (RFC4702) + + + #include + + + + + IP address to exclude from DHCP lease range + + ipv4 + IPv4 address to exclude from lease range + + + + + + + + + + Ignore client identifier for lease lookups + + + + + + Lease timeout in seconds + + u32 + DHCP lease time in seconds + + + + + DHCP lease time must be between 0 and 4294967295 (49 days) + + 86400 + + + + DHCP lease range + + #include + + Invalid range name, may only be alphanumeric, dot and hyphen + + + #include + + + First IP address for DHCP lease range + + ipv4 + IPv4 start address of pool + + + + + + + + + Last IP address for DHCP lease range + + ipv4 + IPv4 end address of pool + + + + + + + + + + + Hostname for static mapping reservation + + + + Invalid static mapping hostname + + + #include + #include + #include + #include + #include + #include + + + + + Unique ID mapped to leases in the lease file + + u32 + Unique subnet ID + + + + + + + + + + + diff --git a/interface-definitions/include/dhcp/dhcpv6-server-common-config.xml.i b/interface-definitions/include/dhcp/dhcpv6-server-common-config.xml.i new file mode 100644 index 000000000..798ecac4b --- /dev/null +++ b/interface-definitions/include/dhcp/dhcpv6-server-common-config.xml.i @@ -0,0 +1,276 @@ + +#include +#include + + + Do not install routes for delegated prefixes + + + + + + Additional global parameters for DHCPv6 server + + + #include + + + + + Preference of this DHCPv6 server compared with others + + u32:0-255 + DHCPv6 server preference (0-255) + + + + + Preference must be between 0 and 255 + + + + + DHCPv6 shared network name + + #include + + Invalid DHCPv6 shared network name. May only contain letters, numbers and .-_ + + + #include + #include + #include + #include + + + IPv6 DHCP subnet for this shared network + + ipv6net + IPv6 address and prefix length + + + + + + + #include + #include + + + Parameters setting ranges for assigning IPv6 addresses + + #include + + Invalid range name, may only be alphanumeric, dot and hyphen + + + #include + + + IPv6 prefix defining range of addresses to assign + + ipv6net + IPv6 address and prefix length + + + + + + + + + First in range of consecutive IPv6 addresses to assign + + ipv6 + IPv6 address + + + + + + + + + Last in range of consecutive IPv6 addresses + + ipv6 + IPv6 address + + + + + + + + + + + Parameters relating to the lease time + + + + + Default time (in seconds) that will be assigned to a lease + + u32:1-4294967295 + DHCPv6 valid lifetime + + + + + + + + + Maximum time (in seconds) that will be assigned to a lease + + u32:1-4294967295 + Maximum lease time in seconds + + + + + + + + + Minimum time (in seconds) that will be assigned to a lease + + u32:1-4294967295 + Minimum lease time in seconds + + + + + + + + + + + Parameters relating to IPv6 prefix delegation + + + + + IPv6 prefix to be used in prefix delegation + + ipv6 + IPv6 prefix used in prefix delegation + + + + + + + + + Length in bits of prefix + + u32:32-64 + Prefix length (32-64) + + + + + Prefix length must be between 32 and 64 + + + + + Length in bits of prefixes to be delegated + + u32:32-64 + Delegated prefix length (32-64) + + + + + Delegated prefix length must be between 32 and 96 + + + + + IPv6 prefix to be excluded from prefix delegation + + ipv6 + IPv6 prefix excluded from prefix delegation + + + + + + + + + Length in bits of excluded prefix + + u32:33-64 + Excluded prefix length (33-128) + + + + + Prefix length must be between 33 and 128 + + + + + + + + + Hostname for static mapping reservation + + + + Invalid static mapping hostname + + + #include + #include + #include + #include + + + Client IPv6 address for this static mapping + + ipv6 + IPv6 address for this static mapping + + + + + + + + + Client IPv6 prefix for this static mapping + + ipv6net + IPv6 prefix for this static mapping + + + + + + + + + + + Unique ID mapped to leases in the lease file + + u32 + Unique subnet ID + + + + + + + + + + + diff --git a/interface-definitions/service_dhcp-server.xml.in b/interface-definitions/service_dhcp-server.xml.in index 78f1cea4e..4d1172e03 100644 --- a/interface-definitions/service_dhcp-server.xml.in +++ b/interface-definitions/service_dhcp-server.xml.in @@ -9,346 +9,7 @@ 911 - #include - - - Dynamically update Domain Name System (RFC4702) - - - #include - - - TSIG key definition for DNS updates - - #include - - Invalid TSIG key name. May only contain letters, numbers, hyphen and underscore - - - - - TSIG key algorithm - - md5 sha1 sha224 sha256 sha384 sha512 - - - md5 - MD5 HMAC algorithm - - - sha1 - SHA1 HMAC algorithm - - - sha224 - SHA224 HMAC algorithm - - - sha256 - SHA256 HMAC algorithm - - - sha384 - SHA384 HMAC algorithm - - - sha512 - SHA512 HMAC algorithm - - - (md5|sha1|sha224|sha256|sha384|sha512) - - Invalid TSIG key algorithm - - - - - TSIG key secret (base64-encoded) - - - - - - - - - - Forward DNS domain name - - - - Invalid forward DNS domain name - - - - - TSIG key name for forward DNS updates - - #include - - Invalid TSIG key name. May only contain letters, numbers, numbers, hyphen and underscore - - - #include - - - - - Reverse DNS domain name - - - - Invalid reverse DNS domain name - - - - - TSIG key name for reverse DNS updates - - #include - - Invalid TSIG key name. May only contain letters, numbers, numbers, hyphen and underscore - - - #include - - - - - - - DHCP high availability configuration - - - #include - - - Configure high availability mode - - active-active active-passive - - - active-active - Both server attend DHCP requests - - - active-passive - Only primary server attends DHCP requests - - - (active-active|active-passive) - - Invalid DHCP high availability mode - - active-active - - - - IPv4 remote address used for connection - - ipv4 - IPv4 address of high availability peer - - - - - - - - - Peer name used to identify connection - - #include - - Invalid failover peer name. May only contain letters, numbers and .-_ - - - - - High availability hierarchy - - primary secondary - - - primary - Configure this server to be the primary node - - - secondary - Configure this server to be the secondary node - - - (primary|secondary) - - Invalid DHCP high availability peer status - - - #include - #include - - - - - Updating /etc/hosts file (per client lease) - - - - #include - #include - - - Name of DHCP shared network - - #include - - Invalid shared network name. May only contain letters, numbers and .-_ - - - - - Dynamically update Domain Name System (RFC4702) - - - #include - - - - - Option to make DHCP server authoritative for this physical network - - - - #include - #include - #include - #include - - - DHCP subnet for shared network - - ipv4net - IPv4 address and prefix length - - - - - Invalid IPv4 subnet definition - - - #include - #include - #include - #include - - - Dynamically update Domain Name System (RFC4702) - - - #include - - - - - IP address to exclude from DHCP lease range - - ipv4 - IPv4 address to exclude from lease range - - - - - - - - - - Ignore client identifier for lease lookups - - - - - - Lease timeout in seconds - - u32 - DHCP lease time in seconds - - - - - DHCP lease time must be between 0 and 4294967295 (49 days) - - 86400 - - - - DHCP lease range - - #include - - Invalid range name, may only be alphanumeric, dot and hyphen - - - #include - - - First IP address for DHCP lease range - - ipv4 - IPv4 start address of pool - - - - - - - - - Last IP address for DHCP lease range - - ipv4 - IPv4 end address of pool - - - - - - - - - - - Hostname for static mapping reservation - - - - Invalid static mapping hostname - - - #include - #include - #include - #include - #include - #include - - - - - Unique ID mapped to leases in the lease file - - u32 - Unique subnet ID - - - - - - - - - - + #include diff --git a/interface-definitions/service_dhcpv6-server.xml.in b/interface-definitions/service_dhcpv6-server.xml.in index a6763a345..d2b96061d 100644 --- a/interface-definitions/service_dhcpv6-server.xml.in +++ b/interface-definitions/service_dhcpv6-server.xml.in @@ -8,280 +8,7 @@ 900 - #include - #include - - - Do not install routes for delegated prefixes - - - - - - Additional global parameters for DHCPv6 server - - - #include - - - - - Preference of this DHCPv6 server compared with others - - u32:0-255 - DHCPv6 server preference (0-255) - - - - - Preference must be between 0 and 255 - - - - - DHCPv6 shared network name - - #include - - Invalid DHCPv6 shared network name. May only contain letters, numbers and .-_ - - - #include - #include - #include - #include - - - IPv6 DHCP subnet for this shared network - - ipv6net - IPv6 address and prefix length - - - - - - - #include - #include - - - Parameters setting ranges for assigning IPv6 addresses - - #include - - Invalid range name, may only be alphanumeric, dot and hyphen - - - #include - - - IPv6 prefix defining range of addresses to assign - - ipv6net - IPv6 address and prefix length - - - - - - - - - First in range of consecutive IPv6 addresses to assign - - ipv6 - IPv6 address - - - - - - - - - Last in range of consecutive IPv6 addresses - - ipv6 - IPv6 address - - - - - - - - - - - Parameters relating to the lease time - - - - - Default time (in seconds) that will be assigned to a lease - - u32:1-4294967295 - DHCPv6 valid lifetime - - - - - - - - - Maximum time (in seconds) that will be assigned to a lease - - u32:1-4294967295 - Maximum lease time in seconds - - - - - - - - - Minimum time (in seconds) that will be assigned to a lease - - u32:1-4294967295 - Minimum lease time in seconds - - - - - - - - - - - Parameters relating to IPv6 prefix delegation - - - - - IPv6 prefix to be used in prefix delegation - - ipv6 - IPv6 prefix used in prefix delegation - - - - - - - - - Length in bits of prefix - - u32:32-64 - Prefix length (32-64) - - - - - Prefix length must be between 32 and 64 - - - - - Length in bits of prefixes to be delegated - - u32:32-64 - Delegated prefix length (32-64) - - - - - Delegated prefix length must be between 32 and 96 - - - - - IPv6 prefix to be excluded from prefix delegation - - ipv6 - IPv6 prefix excluded from prefix delegation - - - - - - - - - Length in bits of excluded prefix - - u32:33-64 - Excluded prefix length (33-128) - - - - - Prefix length must be between 33 and 128 - - - - - - - - - Hostname for static mapping reservation - - - - Invalid static mapping hostname - - - #include - #include - #include - #include - - - Client IPv6 address for this static mapping - - ipv6 - IPv6 address for this static mapping - - - - - - - - - Client IPv6 prefix for this static mapping - - ipv6net - IPv6 prefix for this static mapping - - - - - - - - - - - Unique ID mapped to leases in the lease file - - u32 - Unique subnet ID - - - - - - - - - - + #include diff --git a/interface-definitions/vrf.xml.in b/interface-definitions/vrf.xml.in index 03128cb99..3fa95076e 100644 --- a/interface-definitions/vrf.xml.in +++ b/interface-definitions/vrf.xml.in @@ -116,6 +116,31 @@ + + + Enable services in the vrf itself + + + + + Dynamic Host Configuration Protocol (DHCP) for DHCP server + 912 + + + #include + + + + + DHCP for IPv6 (DHCPv6) server + 901 + + + #include + + + + Routing table associated with this instance diff --git a/op-mode-definitions/dhcp.xml.in b/op-mode-definitions/dhcp.xml.in index 2da3bb5dc..da14359f2 100644 --- a/op-mode-definitions/dhcp.xml.in +++ b/op-mode-definitions/dhcp.xml.in @@ -13,6 +13,22 @@ ${vyos_op_scripts_dir}/dhcp.py clear_dhcp_server_lease --family inet --address $4 + + + Clear DHCP server lease for vrf + + vrf name + + + + + + DHCP server lease + + ${vyos_op_scripts_dir}/dhcp.py clear_dhcp_server_lease --family inet --vrf $4 --address $6 + + + @@ -26,6 +42,22 @@ ${vyos_op_scripts_dir}/dhcp.py clear_dhcp_server_lease --family inet6 --address $4 + + + Clear DHCPv6 server lease for vrf + + vrf name + + + + + + DHCPv6 server lease + + ${vyos_op_scripts_dir}/dhcp.py clear_dhcp_server_lease --family inet6 --vrf $4 --address $6 + + + @@ -70,7 +102,7 @@ Show DHCP server leases - ${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet + ${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet --vrf '' @@ -79,7 +111,7 @@ local remote - ${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet --origin $6 + ${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet --vrf '' --origin $6 @@ -88,7 +120,7 @@ service dhcp-server shared-network-name - ${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet --pool $6 + ${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet --vrf '' --pool $6 @@ -97,7 +129,7 @@ end hostname ip mac pool remaining start state - ${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet --sort $6 + ${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet --vrf '' --sort $6 @@ -106,7 +138,7 @@ abandoned active all backup expired free released reset - ${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet --state $6 + ${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet --vrf '' --state $6 @@ -114,7 +146,7 @@ Show DHCP server static mappings - ${vyos_op_scripts_dir}/dhcp.py show_server_static_mappings --family inet + ${vyos_op_scripts_dir}/dhcp.py show_server_static_mappings --family inet --vrf '' @@ -123,7 +155,7 @@ service dhcp-server shared-network-name - ${vyos_op_scripts_dir}/dhcp.py show_server_static_mappings --family inet --pool $6 + ${vyos_op_scripts_dir}/dhcp.py show_server_static_mappings --family inet --vrf '' --pool $6 @@ -132,7 +164,7 @@ ip mac duid pool - ${vyos_op_scripts_dir}/dhcp.py show_server_static_mappings --family inet --sort $6 + ${vyos_op_scripts_dir}/dhcp.py show_server_static_mappings --family inet --vrf '' --sort $6 @@ -140,7 +172,7 @@ Show DHCP server statistics - ${vyos_op_scripts_dir}/dhcp.py show_server_pool_statistics --family inet + ${vyos_op_scripts_dir}/dhcp.py show_server_pool_statistics --family inet --vrf '' @@ -149,10 +181,107 @@ service dhcp-server shared-network-name - ${vyos_op_scripts_dir}/dhcp.py show_server_pool_statistics --family inet --pool $6 + ${vyos_op_scripts_dir}/dhcp.py show_server_pool_statistics --family inet --vrf '' --pool $6 + + + Show DHCP (Dynamic Host Configuration Protocol) information for vrf + + vrf name + + + + + + Show DHCP server leases + + ${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet --vrf $5 + + + + Show DHCP server leases granted by local or remote DHCP server + + local remote + + + ${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet --vrf $5 --origin $8 + + + + Show DHCP server leases for a specific pool + + service dhcp-server shared-network-name + + + ${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet --vrf $5 --pool $8 + + + + Show DHCP server leases sorted by the specified key + + end hostname ip mac pool remaining start state + + + ${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet --vrf $5 --sort $8 + + + + Show DHCP server leases with a specific state (can be multiple, comma-separated) + + abandoned active all backup expired free released reset + + + ${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet --vrf $5 --state $8 + + + + + + Show DHCP server static mappings + + ${vyos_op_scripts_dir}/dhcp.py show_server_static_mappings --family inet --vrf $5 + + + + Show DHCP server static mappings for a specific pool + + service dhcp-server shared-network-name + + + ${vyos_op_scripts_dir}/dhcp.py show_server_static_mappings --family inet --vrf $5 --pool $8 + + + + Show DHCP server static mappings sorted by the specified key + + ip mac duid pool + + + ${vyos_op_scripts_dir}/dhcp.py show_server_static_mappings --family inet --vrf $5 --sort $8 + + + + + + Show DHCP server statistics + + ${vyos_op_scripts_dir}/dhcp.py show_server_pool_statistics --family inet --vrf $5 + + + + Show DHCP server statistics for a specific pool + + service dhcp-server shared-network-name + + + ${vyos_op_scripts_dir}/dhcp.py show_server_pool_statistics --family inet --vrf $5 --pool $8 + + + + + @@ -171,7 +300,7 @@ Show DHCPv6 server leases - ${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet6 + ${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet6 --vrf '' @@ -180,7 +309,7 @@ service dhcpv6-server shared-network-name - ${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet6 --pool $6 + ${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet6 --vrf '' --pool $6 @@ -189,7 +318,7 @@ end duid ip last_communication pool remaining state type - ${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet6 --sort $6 + ${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet6 --vrf '' --sort $6 @@ -198,7 +327,7 @@ abandoned active all backup expired free released reset - ${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet6 --state $6 + ${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet6 --vrf '' --state $6 @@ -206,7 +335,7 @@ Show DHCPv6 server static mappings - ${vyos_op_scripts_dir}/dhcp.py show_server_static_mappings --family inet6 + ${vyos_op_scripts_dir}/dhcp.py show_server_static_mappings --family inet6 --vrf '' @@ -215,7 +344,7 @@ service dhcp-server shared-network-name - ${vyos_op_scripts_dir}/dhcp.py show_server_static_mappings --family inet6 --pool $6 + ${vyos_op_scripts_dir}/dhcp.py show_server_static_mappings --family inet6 --vrf '' --pool $6 @@ -224,7 +353,7 @@ ip mac duid pool - ${vyos_op_scripts_dir}/dhcp.py show_server_static_mappings --family inet6 --sort $6 + ${vyos_op_scripts_dir}/dhcp.py show_server_static_mappings --family inet6 --vrf '' --sort $6 @@ -232,7 +361,7 @@ Show DHCPv6 server statistics - ${vyos_op_scripts_dir}/dhcp.py show_server_pool_statistics --family inet6 + ${vyos_op_scripts_dir}/dhcp.py show_server_pool_statistics --family inet6 --vrf '' @@ -241,10 +370,98 @@ service dhcpv6-server shared-network-name - ${vyos_op_scripts_dir}/dhcp.py show_server_pool_statistics --family inet6 --pool $6 + ${vyos_op_scripts_dir}/dhcp.py show_server_pool_statistics --family inet6 --vrf '' --pool $6 + + + Show DHCPv6 (IPv6 Dynamic Host Configuration Protocol) information for vrf + + vrf name + + + + + + Show DHCPv6 server leases + + ${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet6 --vrf $5 + + + + Show DHCPv6 server leases for a specific pool + + service dhcpv6-server shared-network-name + + + ${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet6 --vrf $5 --pool $8 + + + + Show DHCPv6 server leases sorted by the specified key + + end duid ip last_communication pool remaining state type + + + ${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet6 --vrf $5 --sort $8 + + + + Show DHCPv6 server leases with a specific state (can be multiple, comma-separated) + + abandoned active all backup expired free released reset + + + ${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet6 --vrf $5 --state $8 + + + + + + Show DHCPv6 server static mappings + + ${vyos_op_scripts_dir}/dhcp.py show_server_static_mappings --family inet6 --vrf $5 + + + + Show DHCPv6 server static mappings for a specific pool + + service dhcp-server shared-network-name + + + ${vyos_op_scripts_dir}/dhcp.py show_server_static_mappings --family inet6 --vrf $5 --pool $8 + + + + Show DHCPv6 server static mappings sorted by the specified key + + ip mac duid pool + + + ${vyos_op_scripts_dir}/dhcp.py show_server_static_mappings --family inet6 --vrf $5 --sort $8 + + + + + + Show DHCPv6 server statistics + + ${vyos_op_scripts_dir}/dhcp.py show_server_pool_statistics --family inet6 --vrf $5 + + + + Show DHCPv6 server statistics for a specific pool + + service dhcpv6-server shared-network-name + + + ${vyos_op_scripts_dir}/dhcp.py show_server_pool_statistics --family inet6 --vrf $5 --pool $8 + + + + + @@ -263,6 +480,17 @@ Restart DHCP server ${vyos_op_scripts_dir}/restart.py restart_service --name dhcp + + + + Restart DHCP server on vrf + + vrf name + + + ${vyos_op_scripts_dir}/restart.py restart_service --name dhcp --vrf $5 + + @@ -282,6 +510,17 @@ Restart DHCPv6 server ${vyos_op_scripts_dir}/restart.py restart_service --name dhcpv6 + + + + Restart DHCPv6 server on vrf + + vrf name + + + ${vyos_op_scripts_dir}/restart.py restart_service --name dhcpv6 --vrf $5 + + diff --git a/op-mode-definitions/monitor-log.xml.in b/op-mode-definitions/monitor-log.xml.in index 721460be5..86c07fb02 100644 --- a/op-mode-definitions/monitor-log.xml.in +++ b/op-mode-definitions/monitor-log.xml.in @@ -45,6 +45,14 @@ Monitor last lines of DHCP server log journalctl --no-hostname --follow --boot --unit kea-dhcp4-server.service + + + + Monitor last lines of DHCP server log on specific vrf + + journalctl --no-hostname --follow --boot --unit "kea-dhcp4-server@$6.service" + + @@ -75,6 +83,14 @@ Monitor last lines of DHCPv6 server log journalctl --no-hostname --follow --boot --unit kea-dhcp6-server.service + + + + Monitor last lines of DHCPv6 server log on specific vrf + + journalctl --no-hostname --follow --boot --unit "kea-dhcp6-server@$6.service" + + diff --git a/op-mode-definitions/show-log.xml.in b/op-mode-definitions/show-log.xml.in index 499e7f84b..b301f3401 100755 --- a/op-mode-definitions/show-log.xml.in +++ b/op-mode-definitions/show-log.xml.in @@ -105,6 +105,14 @@ Show log for DHCP server journalctl --no-hostname --boot --unit kea-dhcp4-server.service + + + + Monitor last lines of DHCP server log on specific vrf + + journalctl --no-hostname --follow --boot --unit "kea-dhcp4-server@$6.service" + + @@ -135,6 +143,14 @@ Show log for DHCPv6 server journalctl --no-hostname --boot --unit kea-dhcp6-server.service + + + + Monitor last lines of DHCPv6 server log on specific vrf + + journalctl --no-hostname --boot --unit "kea-dhcp6-server@$6.service" + + diff --git a/python/vyos/kea.py b/python/vyos/kea.py index 5eecbbaad..4a8a8b4c8 100644 --- a/python/vyos/kea.py +++ b/python/vyos/kea.py @@ -60,7 +60,7 @@ kea6_options = { 'capwap_controller': 'capwap-ac-v6', } -kea_ctrl_socket = '/run/kea/dhcp{inet}-ctrl-socket' +kea_ctrl_socket = '/run/kea/dhcp{inet}{vrf_append}-ctrl-socket' def _format_hex_string(in_str): @@ -403,8 +403,13 @@ def kea_parse_ddns_settings(config): return data -def _ctrl_socket_command(inet, command, args=None): - path = kea_ctrl_socket.format(inet=inet) +def _ctrl_socket_command(inet, vrf_name, command, args=None): + if vrf_name: + vrf_append = f'-{vrf_name}' + else: + vrf_append = '' + + path = kea_ctrl_socket.format(inet=inet, vrf_append=vrf_append) if not os.path.exists(path): return None @@ -430,8 +435,8 @@ def _ctrl_socket_command(inet, command, args=None): return json.loads(result.decode('utf-8')) -def kea_get_leases(inet): - leases = _ctrl_socket_command(inet, f'lease{inet}-get-all') +def kea_get_leases(inet, vrf_name): + leases = _ctrl_socket_command(inet, vrf_name, f'lease{inet}-get-all') if not leases or 'result' not in leases or leases['result'] != 0: return [] @@ -441,6 +446,7 @@ def kea_get_leases(inet): def kea_add_lease( inet, + vrf_name, ip_address, host_name=None, mac_address=None, @@ -466,7 +472,7 @@ def kea_add_lease( if inet == '6' and iaid: args['iaid'] = iaid - result = _ctrl_socket_command(inet, f'lease{inet}-add', args) + result = _ctrl_socket_command(inet, vrf_name, f'lease{inet}-add', args) if result and 'result' in result: return result['result'] == 0 @@ -474,10 +480,10 @@ def kea_add_lease( return False -def kea_delete_lease(inet, ip_address): +def kea_delete_lease(inet, ip_address, vrf_name=''): args = {'ip-address': ip_address} - result = _ctrl_socket_command(inet, f'lease{inet}-del', args) + result = _ctrl_socket_command(inet, vrf_name, f'lease{inet}-del', args) if result and 'result' in result: return result['result'] == 0 @@ -485,8 +491,8 @@ def kea_delete_lease(inet, ip_address): return False -def kea_get_active_config(inet): - config = _ctrl_socket_command(inet, 'config-get') +def kea_get_active_config(inet, vrf_name): + config = _ctrl_socket_command(inet, vrf_name, 'config-get') if not config or 'result' not in config or config['result'] != 0: return None @@ -580,12 +586,12 @@ def kea_get_static_mappings(config, inet, pools=[]) -> list: return mappings -def kea_get_server_leases(config, inet, pools=[], state=[], origin=None) -> list: +def kea_get_server_leases(config, inet, vrf_name, pools=[], state=[], origin=None) -> list: """ Get DHCP server leases from active Kea DHCPv4 or DHCPv6 configuration :return list """ - leases = kea_get_leases(inet) + leases = kea_get_leases(inet, vrf_name) data = [] for lease in leases: diff --git a/smoketest/scripts/cli/test_service_dhcp-server.py b/smoketest/scripts/cli/test_service_dhcp-server.py index e421f04d2..d275ad2ea 100755 --- a/smoketest/scripts/cli/test_service_dhcp-server.py +++ b/smoketest/scripts/cli/test_service_dhcp-server.py @@ -1415,7 +1415,7 @@ class TestServiceDHCPServer(VyOSUnitTestSHIM.TestCase): client = f'client{seq}' mac = f'00:50:00:00:00:{seq:02}' ip = inc_ip(subnet, seq) - kea_add_lease(4, ip, host_name=client, mac_address=mac) + kea_add_lease(4, '', ip, host_name=client, mac_address=mac) # 2. Verify that leases are not available in vyos-hostsd tag_regex = re.escape(f'dhcp-server-{subnet.rsplit(".", 1)[0]}') diff --git a/smoketest/scripts/cli/test_vrf.py b/smoketest/scripts/cli/test_vrf.py index 30980f9ec..bba75f98d 100755 --- a/smoketest/scripts/cli/test_vrf.py +++ b/smoketest/scripts/cli/test_vrf.py @@ -34,6 +34,8 @@ from vyos.utils.network import is_intf_addr_assigned from vyos.utils.network import interface_exists from vyos.utils.process import cmd from vyos.utils.system import sysctl_read +from vyos.template import inc_ip +from vyos.utils.process import process_named_running base_path = ['vrf'] vrfs = ['red', 'green', 'blue', 'foo-bar', 'baz_foo'] @@ -72,6 +74,42 @@ class VRFTest(VyOSUnitTestSHIM.TestCase): for vrf in vrfs: self.assertFalse(interface_exists(vrf)) + def walk_path(self, obj, path): + current = obj + + for i, key in enumerate(path): + if isinstance(key, str): + self.assertTrue(isinstance(current, dict), msg=f'Failed path: {path}') + self.assertTrue(key in current, msg=f'Failed path: {path}') + elif isinstance(key, int): + self.assertTrue(isinstance(current, list), msg=f'Failed path: {path}') + self.assertTrue(0 <= key < len(current), msg=f'Failed path: {path}') + else: + assert False, 'Invalid type' + + current = current[key] + + return current + + def verify_config_object(self, obj, path, value): + base_obj = self.walk_path(obj, path) + self.assertTrue(isinstance(base_obj, list)) + self.assertTrue(any(True for v in base_obj if v == value)) + + def verify_config_value(self, obj, path, key, value): + base_obj = self.walk_path(obj, path) + if isinstance(base_obj, list): + self.assertTrue(any(True for v in base_obj if key in v and v[key] == value)) + elif isinstance(base_obj, dict): + self.assertTrue(key in base_obj) + self.assertEqual(base_obj[key], value) + + def verify_kea_service_running(self, process_name): + tmp = cmd('tail -n 100 /var/log/messages') + self.assertTrue( + process_named_running(process_name), msg=f'Service not running, log: {tmp}' + ) + def test_vrf_vni_and_table_id(self): base_table = '1000' table = base_table @@ -601,5 +639,360 @@ class VRFTest(VyOSUnitTestSHIM.TestCase): self.cli_delete(['nat']) + def test_dhcp_single_pool(self): + # Prepare the vrf and options + table = '100' + vrf = 'dhcp_smoke' + interface = 'dum8888' + subnet = '192.0.2.0/25' + router = inc_ip(subnet, 1) + dns_1 = inc_ip(subnet, 2) + dns_2 = inc_ip(subnet, 3) + domain_name = 'vyos.net' + + # declare fiels + process_name = 'kea-dhcp4' + kea4_conf = f'/run/kea/kea-{vrf}-dhcp4.conf' + + # create interface + cidr_mask = subnet.split('/')[-1] + self.cli_set( + ['interfaces', 'dummy', interface, 'address', f'{router}/{cidr_mask}'] + ) + self.cli_set(['interfaces', 'dummy', interface, 'vrf', f'{vrf}']) + + # create the vrf with table + base = base_path + ['name', vrf] + self.cli_set(base + ['table', table]) + + # set the dhcp scope + base = base_path + ['name', vrf, 'service', 'dhcp-server'] + shared_net_name = 'SMOKE-1' + + range_0_start = inc_ip(subnet, 10) + range_0_stop = inc_ip(subnet, 20) + range_1_start = inc_ip(subnet, 40) + range_1_stop = inc_ip(subnet, 50) + + self.cli_set(base + ['listen-interface', interface]) + + self.cli_set(base + ['shared-network-name', shared_net_name, 'ping-check']) + + pool = base + ['shared-network-name', shared_net_name, 'subnet', subnet] + self.cli_set(pool + ['subnet-id', '1']) + self.cli_set(pool + ['ignore-client-id']) + self.cli_set(pool + ['ping-check']) + # we use the first subnet IP address as default gateway + self.cli_set(pool + ['option', 'default-router', router]) + self.cli_set(pool + ['option', 'name-server', dns_1]) + self.cli_set(pool + ['option', 'name-server', dns_2]) + self.cli_set(pool + ['option', 'domain-name', domain_name]) + + # check validate() - No DHCP address range or active static-mapping set + with self.assertRaises(ConfigSessionError): + self.cli_commit() + self.cli_set(pool + ['range', '0', 'start', range_0_start]) + self.cli_set(pool + ['range', '0', 'stop', range_0_stop]) + self.cli_set(pool + ['range', '1', 'start', range_1_start]) + self.cli_set(pool + ['range', '1', 'stop', range_1_stop]) + + # commit changes + self.cli_commit() + + config = read_file(kea4_conf) + obj = loads(config) + + self.verify_config_value( + obj, ['Dhcp4', 'interfaces-config'], 'interfaces', [interface] + ) + self.verify_config_value( + obj, ['Dhcp4', 'shared-networks'], 'name', shared_net_name + ) + self.verify_config_value( + obj, ['Dhcp4', 'shared-networks', 0, 'subnet4'], 'subnet', subnet + ) + self.verify_config_value( + obj, ['Dhcp4', 'shared-networks', 0, 'subnet4'], 'id', 1 + ) + self.verify_config_value( + obj, ['Dhcp4', 'shared-networks', 0, 'subnet4'], 'match-client-id', False + ) + self.verify_config_value( + obj, ['Dhcp4', 'shared-networks', 0, 'subnet4'], 'valid-lifetime', 86400 + ) + self.verify_config_value( + obj, ['Dhcp4', 'shared-networks', 0, 'subnet4'], 'max-valid-lifetime', 86400 + ) + + # Verify ping-check + self.verify_config_value( + obj, + ['Dhcp4', 'shared-networks', 0, 'user-context'], + 'enable-ping-check', + True, + ) + + self.verify_config_value( + obj, + ['Dhcp4', 'shared-networks', 0, 'subnet4', 0, 'user-context'], + 'enable-ping-check', + True, + ) + + # Verify options + self.verify_config_object( + obj, + ['Dhcp4', 'shared-networks', 0, 'subnet4', 0, 'option-data'], + {'name': 'domain-name', 'data': domain_name}, + ) + self.verify_config_object( + obj, + ['Dhcp4', 'shared-networks', 0, 'subnet4', 0, 'option-data'], + {'name': 'domain-name-servers', 'data': f'{dns_1}, {dns_2}'}, + ) + self.verify_config_object( + obj, + ['Dhcp4', 'shared-networks', 0, 'subnet4', 0, 'option-data'], + {'name': 'routers', 'data': router}, + ) + + # Verify pools + self.verify_config_object( + obj, + ['Dhcp4', 'shared-networks', 0, 'subnet4', 0, 'pools'], + {'pool': f'{range_0_start} - {range_0_stop}'}, + ) + self.verify_config_object( + obj, + ['Dhcp4', 'shared-networks', 0, 'subnet4', 0, 'pools'], + {'pool': f'{range_1_start} - {range_1_stop}'}, + ) + + # Check for running process + self.verify_kea_service_running(process_name) + + # perform cleanup + self.cli_delete(['interfaces', 'dummy', interface, 'address']) + self.cli_delete(['interfaces', 'dummy', interface, 'vrf']) + self.cli_delete(base) + self.cli_commit() + + def test_dhcpv6_single_pool(self): + # Prepare the vrf and other options + table = '100' + vrf = 'dhcp_smoke' + subnet = '2001:db8:f00::/64' + dns_1 = '2001:db8::1' + dns_2 = '2001:db8::2' + domain = 'vyos.net' + nis_servers = ['2001:db8:ffff::1', '2001:db8:ffff::2'] + interface = 'dum8888' + interface_addr = inc_ip(subnet, 1) + '/64' + + # declare fiels + process_name = 'kea-dhcp6' + kea6_conf = f'/run/kea/kea-{vrf}-dhcp6.conf' + + # create interface + self.cli_set(['interfaces', 'dummy', interface, 'address', f'{interface_addr}']) + self.cli_set(['interfaces', 'dummy', interface, 'vrf', f'{vrf}']) + + # create the vrf with table + base = base_path + ['name', vrf] + self.cli_set(base + ['table', table]) + + # set the dhcp scope + base = base_path + ['name', vrf, 'service', 'dhcpv6-server'] + + shared_net_name = 'SMOKE-1' + search_domains = ['foo.vyos.net', 'bar.vyos.net'] + lease_time = '1200' + max_lease_time = '72000' + min_lease_time = '600' + preference = '10' + sip_server = 'sip.vyos.net' + sntp_server = inc_ip(subnet, 100) + range_start = inc_ip(subnet, 256) # ::100 + range_stop = inc_ip(subnet, 65535) # ::ffff + + pool = base + ['shared-network-name', shared_net_name, 'subnet', subnet] + + self.cli_set(base + ['preference', preference]) + self.cli_set(pool + ['interface', interface]) + self.cli_set(pool + ['subnet-id', '1']) + # we use the first subnet IP address as default gateway + self.cli_set(pool + ['lease-time', 'default', lease_time]) + self.cli_set(pool + ['lease-time', 'maximum', max_lease_time]) + self.cli_set(pool + ['lease-time', 'minimum', min_lease_time]) + self.cli_set(pool + ['option', 'capwap-controller', dns_1]) + self.cli_set(pool + ['option', 'name-server', dns_1]) + self.cli_set(pool + ['option', 'name-server', dns_2]) + self.cli_set(pool + ['option', 'name-server', dns_2]) + self.cli_set(pool + ['option', 'nis-domain', domain]) + self.cli_set(pool + ['option', 'nisplus-domain', domain]) + self.cli_set(pool + ['option', 'sip-server', sip_server]) + self.cli_set(pool + ['option', 'sntp-server', sntp_server]) + self.cli_set(pool + ['range', '1', 'start', range_start]) + self.cli_set(pool + ['range', '1', 'stop', range_stop]) + + for server in nis_servers: + self.cli_set(pool + ['option', 'nis-server', server]) + self.cli_set(pool + ['option', 'nisplus-server', server]) + + for search_domain in search_domains: + self.cli_set(pool + ['option', 'domain-search', search_domain]) + + client_base = 1 + for client in ['client1', 'client2', 'client3']: + duid = f'00:01:00:01:12:34:56:78:aa:bb:cc:dd:ee:{client_base:02}' + self.cli_set(pool + ['static-mapping', client, 'duid', duid]) + self.cli_set( + pool + + [ + 'static-mapping', + client, + 'ipv6-address', + inc_ip(subnet, client_base), + ] + ) + self.cli_set( + pool + + [ + 'static-mapping', + client, + 'ipv6-prefix', + inc_ip(subnet, client_base << 64) + '/64', + ] + ) + client_base += 1 + + # cannot have both mac-address and duid set + with self.assertRaises(ConfigSessionError): + self.cli_set( + pool + ['static-mapping', 'client1', 'mac', '00:50:00:00:00:11'] + ) + self.cli_commit() + self.cli_delete(pool + ['static-mapping', 'client1', 'mac']) + + # commit changes + self.cli_commit() + + config = read_file(kea6_conf) + obj = loads(config) + + self.verify_config_value( + obj, ['Dhcp6', 'shared-networks'], 'name', shared_net_name + ) + self.verify_config_value( + obj, ['Dhcp6', 'shared-networks', 0, 'subnet6'], 'subnet', subnet + ) + self.verify_config_value( + obj, ['Dhcp6', 'shared-networks', 0, 'subnet6'], 'interface', interface + ) + self.verify_config_value( + obj, ['Dhcp6', 'shared-networks', 0, 'subnet6'], 'id', 1 + ) + self.verify_config_value( + obj, + ['Dhcp6', 'shared-networks', 0, 'subnet6'], + 'valid-lifetime', + int(lease_time), + ) + self.verify_config_value( + obj, + ['Dhcp6', 'shared-networks', 0, 'subnet6'], + 'min-valid-lifetime', + int(min_lease_time), + ) + self.verify_config_value( + obj, + ['Dhcp6', 'shared-networks', 0, 'subnet6'], + 'max-valid-lifetime', + int(max_lease_time), + ) + + # Verify options + self.verify_config_object( + obj, + ['Dhcp6', 'shared-networks', 0, 'subnet6', 0, 'option-data'], + {'name': 'capwap-ac-v6', 'data': dns_1}, + ) + self.verify_config_object( + obj, + ['Dhcp6', 'shared-networks', 0, 'subnet6', 0, 'option-data'], + {'name': 'dns-servers', 'data': f'{dns_1}, {dns_2}'}, + ) + self.verify_config_object( + obj, + ['Dhcp6', 'shared-networks', 0, 'subnet6', 0, 'option-data'], + {'name': 'domain-search', 'data': ', '.join(search_domains)}, + ) + self.verify_config_object( + obj, + ['Dhcp6', 'shared-networks', 0, 'subnet6', 0, 'option-data'], + {'name': 'nis-domain-name', 'data': domain}, + ) + self.verify_config_object( + obj, + ['Dhcp6', 'shared-networks', 0, 'subnet6', 0, 'option-data'], + {'name': 'nis-servers', 'data': ', '.join(nis_servers)}, + ) + self.verify_config_object( + obj, + ['Dhcp6', 'shared-networks', 0, 'subnet6', 0, 'option-data'], + {'name': 'nisp-domain-name', 'data': domain}, + ) + self.verify_config_object( + obj, + ['Dhcp6', 'shared-networks', 0, 'subnet6', 0, 'option-data'], + {'name': 'nisp-servers', 'data': ', '.join(nis_servers)}, + ) + self.verify_config_object( + obj, + ['Dhcp6', 'shared-networks', 0, 'subnet6', 0, 'option-data'], + {'name': 'sntp-servers', 'data': sntp_server}, + ) + self.verify_config_object( + obj, + ['Dhcp6', 'shared-networks', 0, 'subnet6', 0, 'option-data'], + {'name': 'sip-server-dns', 'data': sip_server}, + ) + + # Verify pools + self.verify_config_object( + obj, + ['Dhcp6', 'shared-networks', 0, 'subnet6', 0, 'pools'], + {'pool': f'{range_start} - {range_stop}'}, + ) + + client_base = 1 + for client in ['client1', 'client2', 'client3']: + duid = f'00:01:00:01:12:34:56:78:aa:bb:cc:dd:ee:{client_base:02}' + ip = inc_ip(subnet, client_base) + prefix = inc_ip(subnet, client_base << 64) + '/64' + + self.verify_config_object( + obj, + ['Dhcp6', 'shared-networks', 0, 'subnet6', 0, 'reservations'], + { + 'hostname': client, + 'duid': duid, + 'ip-addresses': [ip], + 'prefixes': [prefix], + }, + ) + + client_base += 1 + + # Check for running process + self.verify_kea_service_running(process_name) + + # perform cleanup + self.cli_delete(['interfaces', 'dummy', interface, 'address']) + self.cli_delete(['interfaces', 'dummy', interface, 'vrf']) + self.cli_delete(base) + self.cli_commit() + + if __name__ == '__main__': unittest.main(verbosity=2) diff --git a/src/conf_mode/service_dhcp-server.py b/src/conf_mode/service_dhcp-server.py index 99c7e6a1f..ef95d5d80 100755 --- a/src/conf_mode/service_dhcp-server.py +++ b/src/conf_mode/service_dhcp-server.py @@ -16,11 +16,13 @@ import os +from sys import exit +from sys import argv + from glob import glob from ipaddress import ip_address from ipaddress import ip_network from netaddr import IPRange -from sys import exit from vyos.config import Config from vyos.pki import wrap_certificate @@ -41,16 +43,53 @@ from vyos import airbag airbag.enable() -ctrl_socket = '/run/kea/dhcp4-ctrl-socket' -config_file = '/run/kea/kea-dhcp4.conf' -config_file_d2 = '/run/kea/kea-dhcp-ddns.conf' -lease_file = '/config/dhcp/dhcp4-leases.csv' -lease_file_glob = '/config/dhcp/dhcp4-leases*' +ctrl_socket = '' +config_file = '' +config_file_d2 = '' +lease_file = '' +lease_file_glob = '' + +ca_cert_file = '' +cert_file = '' +cert_key_file = '' + user_group = '_kea' -ca_cert_file = '/run/kea/kea-failover-ca.pem' -cert_file = '/run/kea/kea-failover.pem' -cert_key_file = '/run/kea/kea-failover-key.pem' + +def _override_for_vrf(vrf_name): + """ + This function is intended to override global vars when vrf is enabled + """ + global ctrl_socket, config_file, config_file_d2, lease_file, lease_file_glob + global ca_cert_file, cert_file, cert_key_file + + ctrl_socket = f'/run/kea/dhcp4-{vrf_name}-ctrl-socket' + config_file = f'/run/kea/kea-{vrf_name}-dhcp4.conf' + config_file_d2 = f'/run/kea/kea-{vrf_name}-dhcp-ddns.conf' + lease_file = f'/config/dhcp/dhcp4-{vrf_name}-leases.csv' + lease_file_glob = f'/config/dhcp/dhcp4-{vrf_name}-leases*' + + ca_cert_file = f'/run/kea/kea-{vrf_name}-failover-ca.pem' + cert_file = f'/run/kea/kea-{vrf_name}-failover.pem' + cert_key_file = f'/run/kea/kea-{vrf_name}-failover-key.pem' + + +def _reset_vars(): + """ + This function is intended to reset global vars when vrf is not enabled + """ + global ctrl_socket, config_file, config_file_d2, lease_file, lease_file_glob + global ca_cert_file, cert_file, cert_key_file + + ctrl_socket = '/run/kea/dhcp4-ctrl-socket' + config_file = '/run/kea/kea-dhcp4.conf' + config_file_d2 = '/run/kea/kea-dhcp-ddns.conf' + lease_file = '/config/dhcp/dhcp4-leases.csv' + lease_file_glob = '/config/dhcp/dhcp4-leases*' + + ca_cert_file = '/run/kea/kea-failover-ca.pem' + cert_file = '/run/kea/kea-failover.pem' + cert_key_file = '/run/kea/kea-failover-key.pem' def dhcp_slice_range(exclude_list, range_dict): @@ -125,7 +164,19 @@ def get_config(config=None): conf = config else: conf = Config() - base = ['service', 'dhcp-server'] + + # if running in vrf, set base diffrently + if argv and len(argv) > 1: + vrf_name = argv[1] + base = ['vrf', 'name', vrf_name, 'service', 'dhcp-server'] + + # vrf is defined, override other vars aswell + _override_for_vrf(vrf_name) + else: + base = ['service', 'dhcp-server'] + + # vrf is not defined reset vars + _reset_vars() if not conf.exists(base): return None @@ -137,6 +188,10 @@ def get_config(config=None): with_recursive_defaults=True, ) + # add vrf context if present + if argv and len(argv) > 1: + dhcp['vrf_context'] = argv[1] + if 'shared_network_name' in dhcp: for network, network_config in dhcp['shared_network_name'].items(): if 'subnet' in network_config: @@ -524,7 +579,12 @@ def generate(dhcp): def apply(dhcp): - services = ['kea-dhcp4-server', 'kea-dhcp-ddns-server'] + # if running in vrf, set base diffrently + if argv and len(argv) > 1: + vrf_name = argv[1] + services = [f'kea-dhcp4-server@{vrf_name}', f'kea-dhcp-ddns-server@{vrf_name}'] + else: + services = ['kea-dhcp4-server', 'kea-dhcp-ddns-server'] if not dhcp or 'disable' in dhcp: for service in services: @@ -538,7 +598,7 @@ def apply(dhcp): for service in services: action = 'restart' - if service == 'kea-dhcp-ddns-server' and 'dynamic_dns_update' not in dhcp: + if 'kea-dhcp-ddns-server' in service and 'dynamic_dns_update' not in dhcp: action = 'stop' call(f'systemctl {action} {service}.service') diff --git a/src/conf_mode/service_dhcpv6-server.py b/src/conf_mode/service_dhcpv6-server.py index 7af88007c..01f3abfe9 100755 --- a/src/conf_mode/service_dhcpv6-server.py +++ b/src/conf_mode/service_dhcpv6-server.py @@ -16,10 +16,12 @@ import os +from sys import exit +from sys import argv + from glob import glob from ipaddress import ip_address from ipaddress import ip_network -from sys import exit from vyos.config import Config from vyos.template import render @@ -32,26 +34,71 @@ from vyos.utils.dict import dict_search from vyos.utils.network import is_subnet_connected from vyos import ConfigError from vyos import airbag + airbag.enable() -config_file = '/run/kea/kea-dhcp6.conf' -ctrl_socket = '/run/kea/dhcp6-ctrl-socket' -lease_file = '/config/dhcp/dhcp6-leases.csv' -lease_file_glob = '/config/dhcp/dhcp6-leases*' + +config_file = '' +ctrl_socket = '' +lease_file = '' +lease_file_glob = '' + user_group = '_kea' + +def _override_for_vrf(vrf_name): + """ + This function is intended to override some of the global vars + """ + global ctrl_socket, config_file, lease_file, lease_file_glob + + config_file = f'/run/kea/kea-{vrf_name}-dhcp6.conf' + ctrl_socket = f'/run/kea/dhcp6-{vrf_name}-ctrl-socket' + lease_file = f'/config/dhcp/dhcp6-{vrf_name}-leases.csv' + lease_file_glob = f'/config/dhcp/dhcp6-{vrf_name}-leases*' + + +def _reset_vars(): + """ + This function is intended to reset global vars when vrf is not enabled + """ + global ctrl_socket, config_file, lease_file, lease_file_glob + + config_file = '/run/kea/kea-dhcp6.conf' + ctrl_socket = '/run/kea/dhcp6-ctrl-socket' + lease_file = '/config/dhcp/dhcp6-leases.csv' + lease_file_glob = '/config/dhcp/dhcp6-leases*' + + def get_config(config=None): if config: conf = config else: conf = Config() - base = ['service', 'dhcpv6-server'] + + # if running in vrf, set base diffrently + if argv and len(argv) > 1: + vrf_name = argv[1] + base = ['vrf', 'name', vrf_name, 'service', 'dhcpv6-server'] + + # vrf is defined, override other vars aswell + _override_for_vrf(vrf_name) + else: + base = ['service', 'dhcpv6-server'] + + # vrf is not defined reset vars + _reset_vars() if not conf.exists(base): return None - dhcpv6 = conf.get_config_dict(base, key_mangling=('-', '_'), - get_first_key=True, - no_tag_node_value_mangle=True) + dhcpv6 = conf.get_config_dict( + base, key_mangling=('-', '_'), get_first_key=True, no_tag_node_value_mangle=True + ) + + # add vrf context if present + if argv and len(argv) > 1: + dhcpv6['vrf_context'] = argv[1] + return dhcpv6 def verify(dhcpv6): @@ -239,8 +286,14 @@ def generate(dhcpv6): return None def apply(dhcpv6): + # if running in vrf, set base diffrently + if argv and len(argv) > 1: + vrf_name = argv[1] + service_name = f'kea-dhcp6-server@{vrf_name}.service' + else: + service_name = 'kea-dhcp6-server.service' + # bail out early - looks like removal from running config - service_name = 'kea-dhcp6-server.service' if not dhcpv6 or 'disable' in dhcpv6: # DHCP server is removed in the commit call(f'systemctl stop {service_name}') diff --git a/src/etc/sudoers.d/vyos b/src/etc/sudoers.d/vyos index 198b9b9aa..2dd8850c4 100644 --- a/src/etc/sudoers.d/vyos +++ b/src/etc/sudoers.d/vyos @@ -47,6 +47,8 @@ Cmnd_Alias DIAGNOSTICS = /bin/ip vrf exec * /bin/ping *, \ /usr/libexec/vyos/op_mode/* Cmnd_Alias KEA_IP6_ROUTES = /sbin/ip -6 route replace *,\ /sbin/ip -6 route del * +Cmnd_Alias KEA_DHCP = /bin/ip vrf exec * /usr/sbin/kea-dhcp*,\ + /usr/bin/chown * /run/kea/* %operator ALL=NOPASSWD: DATE, IPTABLES, ETHTOOL, IPFLUSH, HWINFO, \ PPPOE_CMDS, PCAPTURE, /usr/sbin/wanpipemon, \ DMIDECODE, DISK, CONNTRACK, IP6TABLES, \ @@ -62,3 +64,4 @@ Cmnd_Alias KEA_IP6_ROUTES = /sbin/ip -6 route replace *,\ %sudo ALL=NOPASSWD: /usr/bin/mokutil _kea ALL=NOPASSWD: KEA_IP6_ROUTES +_kea ALL=NOPASSWD: KEA_DHCP diff --git a/src/etc/systemd/system/kea-dhcp-ddns-server@.service b/src/etc/systemd/system/kea-dhcp-ddns-server@.service new file mode 100644 index 000000000..b6360e573 --- /dev/null +++ b/src/etc/systemd/system/kea-dhcp-ddns-server@.service @@ -0,0 +1,22 @@ +[Unit] +Description=Kea DDNS Service +Documentation=man:kea-dhcp-ddns(8) +Wants=network-online.target +After=vyos-router.service + +[Service] +User=_kea +AmbientCapabilities=CAP_NET_BIND_SERVICE +Environment="KEA_LOCKFILE_DIR=/run/lock/kea" +ConfigurationDirectory=kea +RuntimeDirectory=kea lock/kea +RuntimeDirectoryPreserve=yes +LogsDirectory=kea +LogsDirectoryMode=0750 +StateDirectory=kea +ExecStart=sudo /bin/ip vrf exec %i /usr/sbin/kea-dhcp-ddns -c /run/kea/kea-%i-dhcp-ddns.conf +ExecStartPost=/bin/sh -c 'sleep 10 && sudo /usr/bin/chown _kea:_kea /run/kea/kea-%i-dhcp-ddns* && sudo /usr/bin/chown _kea:_kea /run/kea/logger_lockfile' +Restart=on-failure + +[Install] +WantedBy=multi-user.target diff --git a/src/etc/systemd/system/kea-dhcp4-server@.service b/src/etc/systemd/system/kea-dhcp4-server@.service new file mode 100644 index 000000000..f63364275 --- /dev/null +++ b/src/etc/systemd/system/kea-dhcp4-server@.service @@ -0,0 +1,22 @@ +[Unit] +Description=Kea IPv4 DHCP daemon +Documentation=man:kea-dhcp4(8) +Wants=network-online.target +After=vyos-router.service + +[Service] +User=_kea +AmbientCapabilities=CAP_NET_BIND_SERVICE CAP_NET_RAW +Environment="KEA_LOCKFILE_DIR=/run/lock/kea" +ConfigurationDirectory=kea +RuntimeDirectory=kea lock/kea +RuntimeDirectoryPreserve=yes +LogsDirectory=kea +LogsDirectoryMode=0750 +StateDirectory=kea +ExecStart=sudo /bin/ip vrf exec %i /usr/sbin/kea-dhcp4 -c /run/kea/kea-%i-dhcp4.conf +ExecStartPost=/bin/sh -c 'sleep 10 && sudo /usr/bin/chown _kea:_kea /run/kea/dhcp4-%i-ctrl* && sudo /usr/bin/chown _kea:_kea /run/kea/kea-%i-dhcp4* && sudo /usr/bin/chown _kea:_kea /run/kea/logger_lockfile' +Restart=on-failure + +[Install] +WantedBy=multi-user.target diff --git a/src/etc/systemd/system/kea-dhcp6-server@.service b/src/etc/systemd/system/kea-dhcp6-server@.service new file mode 100644 index 000000000..1d2330f74 --- /dev/null +++ b/src/etc/systemd/system/kea-dhcp6-server@.service @@ -0,0 +1,22 @@ +[Unit] +Description=Kea IPv6 DHCP daemon +Documentation=man:kea-dhcp6(8) +Wants=network-online.target +After=vyos-router.service + +[Service] +User=_kea +AmbientCapabilities=CAP_NET_BIND_SERVICE +Environment="KEA_LOCKFILE_DIR=/run/lock/kea" +ConfigurationDirectory=kea +RuntimeDirectory=kea lock/kea +RuntimeDirectoryPreserve=yes +LogsDirectory=kea +LogsDirectoryMode=0750 +StateDirectory=kea +ExecStart=sudo /bin/ip vrf exec %i /usr/sbin/kea-dhcp6 -c /run/kea/kea-%i-dhcp6.conf +ExecStartPost=/bin/sh -c 'sleep 10 && sudo /usr/bin/chown _kea:_kea /run/kea/dhcp6-%i-ctrl* && sudo /usr/bin/chown _kea:_kea /run/kea/kea-%i-dhcp6* && sudo /usr/bin/chown _kea:_kea /run/kea/logger_lockfile' +Restart=on-failure + +[Install] +WantedBy=multi-user.target diff --git a/src/op_mode/dhcp.py b/src/op_mode/dhcp.py index 725bfc75b..f4b7ac582 100755 --- a/src/op_mode/dhcp.py +++ b/src/op_mode/dhcp.py @@ -83,12 +83,12 @@ ArgOrigin = typing.Literal['local', 'remote'] def _get_raw_server_leases( - config, family='inet', pool=None, sorted=None, state=[], origin=None + config, family='inet', vrf='', pool=None, sorted=None, state=[], origin=None ) -> list: inet_suffix = '6' if family == 'inet6' else '4' pools = [pool] if pool else kea_get_dhcp_pools(config, inet_suffix) - mappings = kea_get_server_leases(config, inet_suffix, pools, state, origin) + mappings = kea_get_server_leases(config, inet_suffix, vrf, pools, state, origin) if sorted: if sorted == 'ip': @@ -166,9 +166,13 @@ def _get_formatted_server_leases(raw_data, family='inet'): return output -def _get_pool_size(pool, family='inet'): +def _get_pool_size(pool, family='inet', vrf=''): v = 'v6' if family == 'inet6' else '' - base = f'service dhcp{v}-server shared-network-name {pool}' + # if vrf is set get the correct base for config + if vrf: + base = f'vrf name {vrf} service dhcp{v}-server shared-network-name {pool}' + else: + base = f'service dhcp{v}-server shared-network-name {pool}' size = 0 subnets = config.list_nodes(f'{base} subnet') for subnet in subnets: @@ -185,14 +189,14 @@ def _get_pool_size(pool, family='inet'): return size -def _get_raw_server_pool_statistics(config, family='inet', pool=None): +def _get_raw_server_pool_statistics(config, family='inet', vrf='', pool=None): inet_suffix = '6' if family == 'inet6' else '4' pools = [pool] if pool else kea_get_dhcp_pools(config, inet_suffix) stats = [] for p in pools: - size = _get_pool_size(family=family, pool=p) - leases = len(_get_raw_server_leases(config, family=family, pool=p)) + size = _get_pool_size(family=family, vrf=vrf, pool=p) + leases = len(_get_raw_server_leases(config, family=family, vrf=vrf, pool=p)) use_percentage = round(leases / size * 100) if size != 0 else 0 pool_stats = { 'pool': p, @@ -269,11 +273,20 @@ def _verify_server(func): def _wrapper(*args, **kwargs): config = ConfigTreeQuery() family = kwargs.get('family') + vrf = kwargs.get('vrf') v = 'v6' if family == 'inet6' else '' - unconf_message = f'DHCP{v} server is not configured' + # Check if config does not exist - if not config.exists(f'service dhcp{v}-server'): - raise vyos.opmode.UnconfiguredSubsystem(unconf_message) + if vrf: + unconf_message = f'DHCP{v} server is not configured for VRF {vrf}' + if not config.exists(f'vrf name {vrf} service dhcp{v}-server'): + raise vyos.opmode.UnconfiguredSubsystem(unconf_message) + else: + unconf_message = f'DHCP{v} server is not configured' + if not config.exists(f'service dhcp{v}-server'): + raise vyos.opmode.UnconfiguredSubsystem(unconf_message) + + # return return func(*args, **kwargs) return _wrapper @@ -303,25 +316,42 @@ def _verify_client(func): @_verify_server def show_server_pool_statistics( - raw: bool, family: ArgFamily, pool: typing.Optional[str] + raw: bool, family: ArgFamily, vrf: str, pool: typing.Optional[str] ): v = 'v6' if family == 'inet6' else '' inet_suffix = '6' if family == 'inet6' else '4' - if not is_systemd_service_running(f'kea-dhcp{inet_suffix}-server.service'): + if vrf: + service = f'kea-dhcp{inet_suffix}-server@{vrf}.service' + else: + service = f'kea-dhcp{inet_suffix}-server.service' + + if not is_systemd_service_running(service): Warning(stale_warn_msg) try: - active_config = kea_get_active_config(inet_suffix) + active_config = kea_get_active_config(inet_suffix, vrf) except Exception: - raise vyos.opmode.DataUnavailable('Cannot fetch DHCP server configuration') + if vrf: + raise vyos.opmode.DataUnavailable( + f'Cannot fetch DHCP server configuration for VRF {vrf}' + ) + else: + raise vyos.opmode.DataUnavailable('Cannot fetch DHCP server configuration') active_pools = kea_get_dhcp_pools(active_config, inet_suffix) if pool and active_pools and pool not in active_pools: - raise vyos.opmode.IncorrectValue(f'DHCP{v} pool "{pool}" does not exist!') + if vrf: + raise vyos.opmode.IncorrectValue( + f'DHCP{v} pool "{pool}" does not exist for VRF {vrf}!' + ) + else: + raise vyos.opmode.IncorrectValue(f'DHCP{v} pool "{pool}" does not exist!') - pool_data = _get_raw_server_pool_statistics(active_config, family=family, pool=pool) + pool_data = _get_raw_server_pool_statistics( + active_config, family=family, vrf=vrf, pool=pool + ) if raw: return pool_data else: @@ -332,6 +362,7 @@ def show_server_pool_statistics( def show_server_leases( raw: bool, family: ArgFamily, + vrf: str, pool: typing.Optional[str], sorted: typing.Optional[str], state: typing.Optional[ArgState], @@ -340,18 +371,33 @@ def show_server_leases( v = 'v6' if family == 'inet6' else '' inet_suffix = '6' if family == 'inet6' else '4' - if not is_systemd_service_running(f'kea-dhcp{inet_suffix}-server.service'): + if vrf: + service = f'kea-dhcp{inet_suffix}-server@{vrf}.service' + else: + service = f'kea-dhcp{inet_suffix}-server.service' + + if not is_systemd_service_running(service): Warning(stale_warn_msg) try: - active_config = kea_get_active_config(inet_suffix) + active_config = kea_get_active_config(inet_suffix, vrf) except Exception: - raise vyos.opmode.DataUnavailable('Cannot fetch DHCP server configuration') + if vrf: + raise vyos.opmode.DataUnavailable( + f'Cannot fetch DHCP server configuration for VRF {vrf}' + ) + else: + raise vyos.opmode.DataUnavailable('Cannot fetch DHCP server configuration') active_pools = kea_get_dhcp_pools(active_config, inet_suffix) if pool and active_pools and pool not in active_pools: - raise vyos.opmode.IncorrectValue(f'DHCP{v} pool "{pool}" does not exist!') + if vrf: + raise vyos.opmode.IncorrectValue( + f'DHCP{v} pool "{pool}" does not exist for VRF {vrf}!' + ) + else: + raise vyos.opmode.IncorrectValue(f'DHCP{v} pool "{pool}" does not exist!') sort_valid = sort_valid_inet6 if family == 'inet6' else sort_valid_inet if sorted and sorted not in sort_valid: @@ -363,6 +409,7 @@ def show_server_leases( lease_data = _get_raw_server_leases( config=active_config, family=family, + vrf=vrf, pool=pool, sorted=sorted, state=state, @@ -378,24 +425,40 @@ def show_server_leases( def show_server_static_mappings( raw: bool, family: ArgFamily, + vrf: str, pool: typing.Optional[str], sorted: typing.Optional[str], ): v = 'v6' if family == 'inet6' else '' inet_suffix = '6' if family == 'inet6' else '4' - if not is_systemd_service_running(f'kea-dhcp{inet_suffix}-server.service'): + if vrf: + service = f'kea-dhcp{inet_suffix}-server@{vrf}.service' + else: + service = f'kea-dhcp{inet_suffix}-server.service' + + if not is_systemd_service_running(service): Warning(stale_warn_msg) try: - active_config = kea_get_active_config(inet_suffix) + active_config = kea_get_active_config(inet_suffix, vrf) except Exception: - raise vyos.opmode.DataUnavailable('Cannot fetch DHCP server configuration') + if vrf: + raise vyos.opmode.DataUnavailable( + f'Cannot fetch DHCP server configuration for VRF {vrf}' + ) + else: + raise vyos.opmode.DataUnavailable('Cannot fetch DHCP server configuration') active_pools = kea_get_dhcp_pools(active_config, inet_suffix) if pool and active_pools and pool not in active_pools: - raise vyos.opmode.IncorrectValue(f'DHCP{v} pool "{pool}" does not exist!') + if vrf: + raise vyos.opmode.IncorrectValue( + f'DHCP{v} pool "{pool}" does not exist for VRF {vrf}!' + ) + else: + raise vyos.opmode.IncorrectValue(f'DHCP{v} pool "{pool}" does not exist!') if sorted and sorted not in mapping_sort_valid: raise vyos.opmode.IncorrectValue(f'DHCP{v} sort "{sorted}" is invalid!') @@ -409,13 +472,13 @@ def show_server_static_mappings( return _get_formatted_server_static_mappings(static_mappings) -def _lease_valid(inet, address): - leases = kea_get_leases(inet) +def _lease_valid(inet, vrf, address): + leases = kea_get_leases(inet, vrf) return any(lease['ip-address'] == address for lease in leases) @_verify_server -def clear_dhcp_server_lease(family: ArgFamily, address: str): +def clear_dhcp_server_lease(family: ArgFamily, vrf: str, address: str): v = 'v6' if family == 'inet6' else '' inet = '6' if family == 'inet6' else '4' @@ -423,7 +486,7 @@ def clear_dhcp_server_lease(family: ArgFamily, address: str): print(f'Lease not found on DHCP{v} server') return None - if not kea_delete_lease(inet, address): + if not kea_delete_lease(inet, vrf, address): print(f'Failed to clear lease for "{address}"') return None diff --git a/src/system/on-dhcp-event.sh b/src/system/on-dhcp-event.sh index 47c276270..556d7dbcb 100755 --- a/src/system/on-dhcp-event.sh +++ b/src/system/on-dhcp-event.sh @@ -30,7 +30,7 @@ get_subnet_domain_name () { from vyos.kea import kea_get_active_config from vyos.utils.dict import dict_search_args -config = kea_get_active_config('4') +config = kea_get_active_config('4', '') shared_networks = dict_search_args(config, 'arguments', f'Dhcp4', 'shared-networks') found = False diff --git a/src/system/sync-dhcp-lease-to-hosts.py b/src/system/sync-dhcp-lease-to-hosts.py index 5c8b18faf..8baa6992a 100755 --- a/src/system/sync-dhcp-lease-to-hosts.py +++ b/src/system/sync-dhcp-lease-to-hosts.py @@ -33,17 +33,17 @@ logs_handler = logging.StreamHandler() logger.addHandler(logs_handler) -def _get_all_server_leases(inet_suffix='4') -> list: +def _get_all_server_leases(inet_suffix='4', vrf='') -> list: mappings = [] try: - active_config = kea_get_active_config(inet_suffix) + active_config = kea_get_active_config(inet_suffix, vrf) except Exception: raise vyos.opmode.DataUnavailable('Cannot fetch DHCP server configuration') try: pools = kea_get_dhcp_pools(active_config, inet_suffix) mappings = kea_get_server_leases( - active_config, inet_suffix, pools, state=[], origin=None + active_config, inet_suffix, vrf, pools, state=[], origin=None ) except Exception: raise vyos.opmode.DataUnavailable('Cannot fetch DHCP server leases') -- cgit v1.2.3