summaryrefslogtreecommitdiff
path: root/python
AgeCommit message (Collapse)Author
2026-11-09utils: T9590: set perms/ownership before first write in write_fileJohn Estabrook
2026-11-06Merge pull request #5631 from c-po/T9559Viacheslav Hletenko
https: T9559: fix bogus port conflict with "vrf default"
2026-11-05qos: T6393: police ingress traffic before redirecting itChristian Breunig
With an ingress limiter and "redirect" on the same interface, the redirect filter was evaluated first and took all traffic, so the limiter never applied. The limiter filters of such an interface now redirect the traffic after policing it: what exceeds the rate is handled by "exceed", conforming traffic is redirected. A "not-exceed ok" is passed on to the redirect instead of ending the actions. The interface's own redirect filter moves to the lowest priority and only catches traffic no limiter class matched; an interface commit only replaces that filter and keeps the limiter in place.
2026-11-05qos: T6393: keep redirect filter when applying an ingress policyChristian Breunig
An interface with both an ingress QoS policy and "redirect" lost its redirect filter on every QoS commit, including boot. QoS re-applied the interface redirect first and then re-created the ingress qdisc for its own policy, dropping the redirect filter again. Mirror and redirect are now re-applied after the QoS policies, and the redirect re-uses an existing ingress qdisc instead of failing to add it.
2026-11-05interfaces: T6393: install mirror and redirect filters for VLAN targetsChristian Breunig
A VLAN sub-interface used as mirror or redirect target (e.g. bond0.10) was only accepted if it already existed in the Kernel. The configuration committed at runtime, but at boot the source interface is committed before the VLAN is created - verify failed and the whole source interface was rolled back, as reported for tunnel targets. A VLAN target is now also accepted if its parent interface has the vif, vif-s or vif-c configured on the CLI. VLAN sub-interfaces learn which interfaces mirror or redirect into them and install their filters once created, as other interfaces already do. Add a config load test mirroring and redirecting into tunnel and bond VLAN targets, which are committed after the ethernet sources.
2026-11-05interfaces: T6393: accept mirror and redirect targets defined on the CLIciaens
Interface types are committed in priority order (ethernet 318, bridge 319, bonding 320, ... tunnel 380). verify_mirror_redirect() required the mirror and redirect target to exist in the Kernel, so "interfaces ethernet eth1 mirror ingress tun0" (or "redirect tun0") could never commit on the first pass at boot, or when both interfaces are created in the same commit: VYOS_TAGNODE_VALUE=eth1 .../interfaces_ethernet.py Requested mirror interface "tun0" does not exist! Sending reply: ERROR_COMMIT with output VYOS_TAGNODE_VALUE=tun0 .../interfaces_tunnel.py Sending reply: SUCCESS with output The whole ethernet node was rolled back, taking its addresses and everything on top of them down with it. The tc filter itself is installed by the target's commit since the previous commit, only verify() blocks. Also accept a target which is defined on the CLI, at its interface name position of the interfaces tree that Config.get_config_dict() attaches to its dictionaries. A target that is neither configured nor existing still fails the commit with the same error message as before. VLAN sub-interface targets are only accepted from the Kernel, as nothing would install their filter later on. VLAN sub-interfaces as sources get the interfaces tree attached to their own dictionaries in get_interface_dict(). A target placed in a network namespace is out of reach for tc(8) and is rejected with its own message, also while its device still sits in the default namespace. A target whose device is created asynchronously by a daemon (OpenVPN) now also passes verify at boot; if its device is not up yet when that interface applies, the filter is installed on the next commit of either side instead of the source interface being rolled back. src/tests/test_configverify.py was removed together with its last test case (T8859) and is re-added with tests for the target verification.
2026-11-05interfaces: T6393: install tc filters for every source of a targetciaens
When an interface is used as the mirror target of other interfaces, its commit installs the tc(8) mirror filters on their behalf, so that mirroring works even if the target did not exist yet when the sources were configured. is_mirror_intf() however only remembered the last source it found, ignored the target's own mirror configuration whenever it had sources, and did not consider VLAN sub-interfaces or "redirect" at all. Return all sources (including vif, vif-s, vif-c and redirecting interfaces), found by walking the interfaces dictionary once instead of calling list_nodes() and exists() per node, and apply the interface's own configuration plus one set of filters per source. A source whose target does not exist yet is skipped with a warning, the target installs the filter once it exists. Only sources missing a filter into the target are touched (each configured direction is checked), so a commit of the target no longer drops and re-adds the qdiscs of every source. A filter left behind by a re-created target is reported by tc as "*" and replaced. A redirecting source may carry a QoS policy: its dictionary gets the "qos" marker of get_interface_dict(), and only the mirred filters are removed instead of the qdiscs. This also drops the stale redirect filter once "redirect" is deleted from a shaped interface.
2026-11-05https: T9559: report a missing VRF instead of a free portChristian Breunig
The port check reported a port as free when the VRF to test it in did not exist, so a missing or misspelled VRF passed unnoticed. The device error is now raised like any other error. Callers that verify the VRF beforehand are not affected; the default VRF is still treated like no VRF at all.
2026-11-05https: T9559: fix bogus port conflict with "vrf default"Christian Breunig
Committing "set service https vrf default" failed with "TCP port 443 in vrf default is already used by another service" although nothing listened on the port. The port check bound its test socket to a VRF device named "default", which does not exist, and reported that failure as a port conflict. The default VRF is now treated like no VRF at all. A VRF device that does not exist no longer counts as a busy port, as nothing can listen in it; any other error is raised instead of being reported as a conflict. The same check is used by the Prometheus VPP exporter.
2026-11-03Merge pull request #5627 from c-po/T9567-serial-console-compat-migrationChristian Breunig
serial: T9567: honor booted serial console during 31 -> 32 migration
2026-11-03serial: T9567: honor booted serial console during 31 -> 32 migrationChristian Breunig
An installation that still carries a legacy 1.3.x image keeps GRUB in compat mode. The GRUB structure update then rewrites the GRUB vars on every boot, before the config migration runs. The migration relied on these vars to detect a serial boot console and silently skipped setting "system console device ttyS0 kernel" after an upgrade from 1.4. The console code then fell back to tty0, so the next boot lost all serial output. On compat GRUB installs, the migration now uses the console the kernel booted with (the last console= argument). Installs using the current GRUB layout keep reading the GRUB vars, so a one-off console choice from the GRUB boot options menu is not persisted into the config.
2026-11-03T9562: pass value instead of callable to set_levelJohn Estabrook
A typo led to passing the function itself, instead of its value.
2026-11-02Merge pull request #5602 from c-po/T9496-secure-boot-add-imageChristian Breunig
op-mode: T9496: verify secure-boot signature when using "add system image"
2026-11-01frrender: T9482: drop a blackhole route FRR would refuseChristian Breunig
The default route of a DHCP or PPPoE interface changes with an interface-only commit or a lease event, without a commit of the static routes. If it gets the same prefix and distance as a blackhole or reject route, FRR refuses the reload and every static route added with it is lost. The rendered FRR configuration is now checked for a blackhole or reject route next to any other route of the same prefix and distance, per VRF and table. Such a blackhole or reject route is not rendered, and an error naming it is logged to the journal. Prefixes are compared in their normalized form, as FRR stores them.
2026-10-31Merge pull request #5479 from c-po/T3871-ifname-storeChristian Breunig
T3871: bind interface names to hardware slots instead of hw-id
2026-10-31Merge pull request #5591 from ruben-herold/T9442-frrender-cacheChristian Breunig
frrender: T9442: cache the FRR configuration only after it was applied
2026-10-31frrender: T9442: reload FRR when the rendered configuration was not appliedChristian Breunig
A failed reload only dropped the in-memory cache. The record of the configuration FRR runs still held the previous one, so the DHCP render helper skipped a return to it while FRR kept a part of the failed configuration. After a rejected reload test, the rendered file also kept the rejected configuration. Change detection now also requires the rendered file to match the applied one, and a failed reload removes that record. The next commit then renders and reloads FRR again, even when it returns to the previous configuration. A smoketest stops FRR during a commit and verifies that committing again brings the configuration into FRR.
2026-10-31interfaces: T3871: keep the address policy the distribution shipsChristian Breunig
Only the first matching link file is applied, and ours sets just the name, so the address policy shipped with the system never ran on any interface. Hardware with a permanent address was unaffected - there was nothing to apply - but a modem, which has none, was left on whatever random address its driver had picked that boot, a different one every time. Spell the policy out again. A permanent address is still kept where there is one, and a device without one is given an address derived from the machine and the device, which is the same on every boot of that machine. An address set through the CLI is applied later and is unaffected.
2026-10-31wwan: T3871: stop reporting a modem as replaced hardware every bootChristian Breunig
A modem that reports no permanent address is given a random one by its driver at every probe. That address was read as if it identified the hardware, so it never matched what was recorded and the modem was taken for a different card in the same socket on each boot, warning the operator to check a port nobody had touched. The map also kept being rewritten with the address of the boot before, so it could never settle. Keep no address for a modem, and compare one only where there is one. An address recorded by an earlier version is dropped on the next pass, so a machine already carrying one needs nothing done to it. A card whose address really did change is still reported.
2026-10-31interfaces: T3871: give a re-created Hyper-V NIC the name of the NIC it replacedAlex Kudentsov
A Hyper-V NIC is known by its MAC alone. One deleted and created again on the same VM - an Azure NIC re-created, or a Hyper-V adapter removed and added - comes back with a new MAC, so nothing on it matched the store: its name stayed reserved, the new NIC got a new name, and its configuration was left on a name with no NIC. cloud-init does not run again on the same instance, so nothing else repairs it. At boot, a vacant name now goes to a new NIC only when the pairing is not in doubt: - exactly one recorded name has no NIC, and exactly one new Hyper-V NIC appeared. With more of either, the order the NICs come up in does not say which replaced which, so nothing is handed over and the names stay reserved, as before; - the name went missing at this pass. The store records which names were missing at the last pass, so a NIC removed for good does not hand its name to a NIC added at a later boot; - the name's own NIC was a Hyper-V one. The store records which names sat on a Hyper-V NIC; a MAC-keyed name can belong to other hardware, and a store written before this was recorded hands nothing over (the boot pass logs that when it holds a name back); - only at boot. On a running system the configuration under a name is not applied to the NIC that takes it, so the hotplug unit passes --hotplug, which names the new NIC like any other and records the vacant name as missing, so the next boot does not hand it over either. An adoption is logged as a warning, reported under 'adopted' in the status file (kept there across hotplug passes while it holds), and repeated by vyos-router, as a slot match is: verify the port before relying on its configuration.
2026-10-31interfaces: T3871: keep an accelerated-networking VF off its NIC's .link fileAlex Kudentsov
On Azure every Hyper-V NIC shares one ID_PATH and has no slot, so it is keyed on its MAC. Its accelerated-networking VF carries the same MAC and matched the NIC's .link file, so udev tried to give the VF the NIC's name. The .link file of a Hyper-V NIC now also matches Driver=hv_netvsc, so the VF cannot match it. This holds for a lone NIC keyed on the VMBus path too. A NIC absent at a pass cannot say what it is, so its file keeps the pin it already carries. NICs that are not Hyper-V ones get no Driver line, and their files do not change. The 34-to-35 migration passes the hardware it found, so the pin is written on the first boot of an upgrade too.
2026-10-31interfaces: T3871: keep the hypervisor's adapter order on ESXiChristian Breunig
ESXi does not lay its adapters out in PCI address order. With four or more it puts the fourth on a root port sorting ahead of the first three, so naming by address made Network adapter 4 eth0 and shifted the rest. On the vmware-vsphere OVA that moved the WAN, because cloud-init takes eth0 from the OVF properties. The firmware port label carries the adapter order, and is what the VMware udev rule this series removed matched on. Order by it, ahead of the address, for hardware the hypervisor presented - recognised by its PCI vendor, or by DMI for a model whose IDs are not known here. A physical server labels its ports too and must not be reordered. The label orders, it never identifies: a relabelled adapter is still the same card.
2026-10-31ethernet: T3871: restore the address the card came with, not the one on itChristian Breunig
Deleting an ethernet configuration puts the hardware address back. It was read from the driver, which reports the current address when it cannot report a permanent one separately - and at that point the current address is still the custom one being removed, so it was reapplied rather than undone and the card kept an address the configuration no longer mentioned. Ask what naming recorded for the interface first, as the reset path already does. That was taken before any custom address was applied, and the driver stays the fallback for an interface no pass has seen.
2026-10-31interfaces: T3871: make the interface map survive a crash, not just a renameChristian Breunig
Replacing the map was atomic but not durable: neither its contents nor the rename were forced to the disk, so a machine losing power shortly after a boot could come back to an empty or truncated file. Names are then derived from the hardware again, which only gives the same answer where they happened to follow slot order - anywhere else an address moves to another cable. Force the contents out before the file is put in place, and the directory entry after, so what comes back is either the names it had before or the ones just written.
2026-10-31interfaces: T3871: only give a name to a device of its own kindChristian Breunig
A recorded slot was enough to claim a name, whatever turned up in it. Pull a modem and put an ordinary USB NIC in the same port and the NIC was handed wwan0 - a name 'interfaces wwan' reads, so a modem's configuration would be applied to a card which can not carry it. The reverse was already handled. Require the device to belong to the namespace the name is read under. If it does not, the name stays reserved for the hardware that earned it and the newcomer is named as what it is.
2026-10-31interfaces: T3871: report a name which changed hands between known cardsChristian Breunig
Cards rearranged among themselves, or a map edited by hand, leave every name matched to a card the store knows - just not the one it had. That was filed as an ordinary match, indistinguishable from a machine where nothing moved, while the addresses configured under those names had quietly changed cable. Report it separately. Which name goes to which card is unchanged, the slot still decides; only the account of what happened is.
2026-10-31interfaces: T3871: keep bridge and bond members discoverableChristian Breunig
An interface was passed over as soon as it had a master, which covers a VF datapath but also every bridge, bond and VRF member. Those are still their own card in their own slot, so the naming pass reported them as hardware which had not appeared, on any run made while they were in use. Skip only when the master is a device itself. That is what tells the accelerated path, which belongs to the interface it is enslaved to, apart from a member, which does not.
2026-10-31wwan: T3871: name a modem in the namespace the CLI readsChristian Breunig
Anything that was not wireless was named ethN, so an LTE module came up as an ethernet port: bound, working and invisible, because 'interfaces wwan' looks at wwanN and nothing else. Give it its own namespace, keyed on DEVTYPE, and drop what an earlier version filed under an ethernet name - that entry still matches the modem by path and would capture it again.
2026-10-31interfaces: T3871: leave wireless names to the configurationChristian Breunig
Every interface created on a radio carries that phy's address, so they are indistinguishable here. A name recorded against one of them was applied to whichever appeared next: configuring a second interface on a phy renamed it on top of the first, and the smoketests lost the interface they had just asked for. Nothing anchors a radio, and nothing needs to - wireless names come from 'physical-device'. Stop discovering them, stop writing a .link for them, and drop what an earlier version recorded so the entry and its file go on upgrade.
2026-10-31ethernet: T3871: leave a bond member's MTU alone while it is still enslavedChristian Breunig
Deleting the ethernet configuration of a member of a jumbo bond dropped that member to the default MTU while the bond went on using it at 9000. It stayed the active slave, so jumbo frames were discarded in both directions, small ones passed, and nothing was logged. A bond owns its members' MTU just as it owns their address - the ethernet path already refuses to let a member set either, and says so. The reset now waits, like the address, until the bond has released the port. The bonding smoketest covers both halves on a running system: while the member is enslaved it must keep the bond's address and MTU, and once the bond releases it, it must get its own address and the default MTU back.
2026-10-31interfaces: T3871: name a card by the card, not only by the slot it sits inChristian Breunig
The map now records which card each name sat on. A card moved to another slot keeps its name rather than leaving it behind for whatever turns up next, and the slot it vacated does not lend that name out. Where the map and the hardware disagree, the map wins: a card the store already knows, found in a name's slot, takes that name. Only a card nothing knows about, sitting in a slot on record, is treated as a replacement - the one case which can quietly move a configured address onto another cable.
2026-10-31interfaces: T3871: persist interface names on the first boot of a pre-built ↵Christian Breunig
image The check guarding that write looked for a marker which an activation script creates only after interface naming has already run. On a deployed qcow2 the marker is absent on the first boot, so nothing was recorded and the next boot named the hardware from scratch. Removing a card then moved every name below it onto the neighbouring port, taking that interface's address with it. Only an encrypted configuration has a volume which may still be locked, so ask about that instead - everywhere else the directory is already the persistent one.
2026-10-31ethernet: T3871: an ethernet interface belongs to the Kernel and can not be ↵Christian Breunig
deleted Every NIC used to carry a hw-id, which was enough to make its node exist. Without it a bare node is empty and never reaches the running configuration, so releasing a bond member looked exactly like a deletion: the port was torn down and left admin-down, with nothing left to bring it back. An ethernet interface is owned by the Kernel and - like 'lo' - outlives its configuration. Removing it now resets the port to the Kernel defaults and leaves the link up.
2026-10-31interfaces: T3871: remove the hw-id node and migrate its bindingsChristian Breunig
The node decides nothing now that the mapping store owns naming, and keeping it would leave two sources of truth free to disagree. Existing bindings are carried into the store by matching each hw-id against the permanent address of the hardware present, so a box named by an older release keeps exactly the names it had. Entries whose hardware is absent are skipped - the configuration may well originate from another machine. The hardware address of an interface is now read off the device rather than from the configuration.
2026-10-31interfaces: T3871: name interfaces from a slot-anchored mapping storeChristian Breunig
Names used to be derived from 'hw-id' in config.boot. A node carrying an address but no hw-id had to be matched to some NIC, and nothing available at boot could say which one - every heuristic could bind a configured address to the wrong physical wire. Naming authority moves to a mapping store binding a name to the slot the hardware occupies. The slot is the identity, so a replacement card in that slot is that interface again. The store renders systemd .link files, leaving udev to apply names as devices appear.
2026-10-30firewall: T9544: Fix fqdn match in prerouting raw rulesNataliia Solomko
A prerouting raw rule with a source or destination fqdn failed to commit: the rule referenced an FQDN set that was never declared, and the domain resolver never added addresses to it. Prerouting is now handled like the other hooks for both IPv4 and IPv6, so the set is created and filled with the resolved addresses. Added a smoketest covering both address families.
2026-10-29op-mode: T9496: verify secure-boot signature when using "add system image"Christian Breunig
On a system running with Secure Boot enabled, "add system image" installed the Linux Kernel of the new image without checking its signature. A Kernel not signed by an enrolled Machine Owner Key is rejected by shim, so the new image failed to boot. The Kernel of the new image is now verified against the enrolled MOK keys before anything is copied. If verification fails, the installation is aborted. The existing --force option overrides the check.
2026-10-29op-mode: T9538: fix interface check in reset wireguardChristian Breunig
The CLI existence check always looked up the interface under the argument name intf_name, but reset wireguard passes it as interface. The check therefore only tested whether any WireGuard interface existed: an unconfigured name slipped through and crashed with a KeyError, or the error message reported the interface as "None". The decorator now accepts the name of the argument carrying the interface, defaulting to intf_name, so existing callers are unchanged and reset wireguard reports the unconfigured interface by name.
2026-10-28T9529: wrapper should check result and raise error on nullJohn Estabrook
2026-10-27frrender: T9442: cache the FRR configuration only after it was appliedRuben Herold
The configuration was stored as the cached one before FRR had reloaded it. If the reload failed, or FRR was down, the next commit found the configuration unchanged, skipped the reload and reported success while FRR kept running the old configuration. Keep the rendered configuration aside and make it the cached one only after the reload succeeded. A render which does not reach the reload is not cached either. If the reload fails, FRR may run a part of the new configuration. The cache is dropped then, so even a return to the previous configuration reloads FRR. A reload that succeeds on the last try no longer raises an error.
2026-10-22Merge pull request #5583 from alexk37/T9484-vpp-netlink-rmem-maxViacheslav Hletenko
vpp: T9484: keep net.core.rmem_max at VPP's netlink buffer size
2026-10-22Merge pull request #5528 from alexandr-san4ez/T9336-rollingDaniil Baturin
syslog: T9336: Resolve remote FQDN targets within their configured VRF
2026-10-21vpp: T9484: keep net.core.rmem_max at VPP's netlink buffer sizeAlex Kudentsov
VPP requests a 256 MiB netlink receive buffer (nl-rx-buffer-size), but the kernel caps it at net.core.rmem_max, which VyOS sets to 2 MiB, so VPP gets 4 MiB. A large routing table over VPP interfaces can overflow it, and linux-cp then falls back to a full resync. Setting the sysctl from the CLI does not help at boot: system sysctl runs after vpp, so VPP has already opened its socket. - vpp.py raises net.core.rmem_max to the requested size before VPP is (re)started; a higher value is kept. - VPP re-opens its netlink socket on every resync and sizes it again, so system sysctl no longer applies a lower value while VPP is configured; it uses the required size and prints a warning. - When VPP is removed, vpp.py sets net.core.rmem_max back to the value from system sysctl, or to the default from sysctl.d, read with the new vyos.utils.system.sysctl_read_default(). - startup.conf.j2 takes nl-rx-buffer-size from the same value (default_resource_map) instead of its own constant.
2026-10-19Merge pull request #5573 from c-po/firewall-fixesChristian Breunig
firewall: T9474: multiple issues in rule processing (time based rules, fragment matching and failing commits)
2026-10-19Merge pull request #5578 from alexk37/bgp-t9450-resent-linesChristian Breunig
bgp: T9450: stop re-sending unchanged BGP lines to FRR on every commit
2026-10-19Merge pull request #5571 from c-po/wlb-fixesChristian Breunig
wlb: T9472: silent daemon failures, ignored options and connections broken by commits
2026-10-19Merge pull request #5574 from c-po/nat-fixesChristian Breunig
nat: T9475: commit failures and weight issue in load-balancing, translation issues for port-ranges
2026-10-19syslog: T9336: Resolve remote FQDN targets within their configured VRFOleksandr Kuchmystyi
Rsyslog resolves remote targets via the process's default routing context regardless of a per-remote 'vrf' setting, so a remote given as an FQDN fails to resolve when the only reachable DNS server lives in a non-default VRF. Changes: - `system_syslog.py` pre-resolves FQDN using VRF remotes at commit time and renders the resolved address instead of the raw FQDN. - `vyos-domain-resolver` collects VRF-bound FQDN targets from syslog and handles a resolved-address change for a syslog remote.
2026-10-19bgp: T9450: do not re-render the default conditional-advertisement timerAlex Kudentsov
The CLI's XML default for "bgp conditional-advertisement timer" (60) is always present in the config dict, so the line was rendered on every commit. FRR's own default is the same value (DEFAULT_CONDITIONAL_ROUTES_POLL_TIME, bgpd/bgp_conditional_adv.h) and bgp_config_write() never prints it back when the value equals the default, so frr-reload saw the line missing on every reload and sent it again, both in the default instance and in every VRF instance. Templates cannot query the XML definition while rendering, so frrender takes the value from the config defaults of "parameters conditional-advertisement" (conf.get_config_defaults) and adds it to the BGP dict as the key xml_default_conditional_advertisement_timer, for the global instance and for every VRF instance, the same pattern used for "bgp default local-preference" (T9404). bgpd.frr.j2 renders the line only when the configured value differs from xml_default_conditional_advertisement_timer, comparing both as integers so a timer entered as "060" is still treated as 60.
2026-10-18wwan: T9388: request an IPv6 bearer for autoconf without an address nodeAdam Smith
"ipv6 address autoconf" lives below "ipv6", so an interface which only gets its address by SLAAC has no "address" node at all. connect_options() only worked out the IP type when that node existed and fell back to ipv4 otherwise, which dialled an IPv4-only bearer and left the interface without any IPv6. Read the address list with a default instead. All other combinations of dhcp, dhcpv6 and autoconf give the same IP type as before.