summaryrefslogtreecommitdiff
path: root/python
AgeCommit message (Collapse)Author
2025-01-27opmode: T7084: reorganize the op mode cache format for ease of search (#4313)Daniil Baturin
* opmode: T7084: reorganize the op mode cache format for ease of search * opmode: T7084: normalize formatting
2025-01-27Merge pull request #4320 from indrajitr/vyos-t7052-2Daniil Baturin
dhcp: T7052: Fix remaining time evaluation and formatting errors
2025-01-26dhcp: T7052: Fix remaining time evaluation and formatting errorsIndrajit Raychaudhuri
The remaining time for a lease was not being correctly evaluated and formatted. As a result, expired leases show up with `show dhcp server leases`. Also, the empty hostname should be replaced by '-'.
2025-01-26T6998: Remove vestigial helper and reformatIndrajit Raychaudhuri
2025-01-26T6998: dhcpy.py - fix datetime to be timezone awaremetron2
2025-01-24Merge pull request #4200 from sskaje/T4930-1Daniil Baturin
T4930: Allow WireGuard peers via DNS hostname
2025-01-24Merge pull request #4216 from HollyGurza/T6641Daniil Baturin
T6641: Add vyos-network-event-logger Service
2025-01-21T6641: Add vyos-network-event-logger Servicekhramshinr
The service parses and logs network events for improved monitoring and diagnostics. Supported event types include: - `RTM_NEWROUTE`, `RTM_DELROUTE` - `RTM_NEWLINK`, `RTM_DELLINK` - `RTM_NEWADDR`, `RTM_DELADDR` - `RTM_NEWNEIGH`, `RTM_DELNEIGH`, `RTM_GETNEIGH` - `RTM_NEWRULE`, `RTM_DELRULE` Added operational mode commands for filtered log retrieval: - `show log network-event <event-type> <interface>`: Retrieve logs filtered by event type and interface. - `show interfaces <type> <name> event-log <event-type>`: Display interface-specific logs filtered by event type.
2025-01-21Merge pull request #4306 from jestabro/modular-reference-treeDaniil Baturin
T7046: add wrappers for reference tree utilities
2025-01-20Merge pull request #4307 from indrajitr/kea-refactorChristian Breunig
dhcp: T7052: Refactor kea dhcp op-mode functions to vyos.kea
2025-01-20Merge pull request #4302 from HollyGurza/T681Daniil Baturin
T681: Fix QoS DSCP filter
2025-01-19wireguard: T4930: drop unused WireGuardOperational().show_interface() methodChristian Breunig
Method is not referenced in the code base, remove dead code.
2025-01-19wireguard: T4930: use get_config_dict() rather then individual config queriesChristian Breunig
Extend ConfigTreeQuery().get_config_dict() with arguments to read in default CLI values, too. This removes the need for hardcoded default values at multiple places like: if max_dns_retry is None: max_dns_retry = 3 in this case.
2025-01-19wireguard: T4930: add mnemonic for WIREGUARD_REKEY_AFTER_TIMEChristian Breunig
WireGuard performs a handshake every WIREGUARD_REKEY_AFTER_TIME if data is being transmitted between the peers. If no data is transmitted, the handshake will not be initiated unless new data begins to flow. Each handshake generates a new session key, and the key is rotated at least every 120 seconds or upon data transmission after a prolonged silence.
2025-01-19wireguard: T4930: allow peers via FQDNsskaje
* set interfaces wireguard wgXX peer YY hostname <fqdn>
2025-01-16ruff: T6583: Reformat to comply with code styleIndrajit Raychaudhuri
2025-01-16dhcp: T7052: Refactor kea dhcp op-mode functions to vyos.keaIndrajit Raychaudhuri
Relocate the kea dhcp op-mode functions to kea helper functions in vyos.kea. This allows the functions to be reused by other scripts, not just op-mode wrappers. This moves the source of truth for the op-mode commands to the actual running kea instance, rather than VyOS config path. Also, apply some minor code cleanup and make some of the mappings consistent across the functions.
2025-01-15T7046: add wrappers for reference tree cache utilsJohn Estabrook
2025-01-15T7046: normalize formattingJohn Estabrook
2025-01-15remote: T7048: merge git environment with the os environmentRobert Gingras
allows utilizing ssh-agent and other environment-variable-based behavior customizations
2025-01-13T681: Fix QoS DSCP filterkhramshinr
The left shift operation aligns the DSCP/TOS value with its bit position in the IP header. TC expects a DSCP value with this shift
2025-01-09nhrp: T2326: NHRP migration to FRRaapostoliuk
NHRP migration to FRR
2025-01-08Merge pull request #4284 from indrajitr/simplify-T7016Daniil Baturin
T7016: Simplify logic for force deleting dynamic IPv4 address from interface
2025-01-07vyos.ifconfig: T7018: drop 'iftype' class attribute (#4280)Christian Breunig
Under very rare cases we can run into a race condition where interfaces are still in creation phase but are already referenced.. This can trigger: File "/usr/libexec/vyos/conf_mode/system_conntrack.py", line 270, in <module> apply(c) File "/usr/libexec/vyos/conf_mode/system_conntrack.py", line 249, in apply call_dependents() File "/usr/lib/python3/dist-packages/vyos/configdep.py", line 147, in call_dependents f() File "/usr/lib/python3/dist-packages/vyos/configdep.py", line 118, in func_impl run_config_mode_script(script, config) File "/usr/lib/python3/dist-packages/vyos/configdep.py", line 106, in run_config_mode_script mod.verify(c) File "/usr/libexec/vyos//conf_mode/service_conntrack-sync.py", line 72, in verify if len(get_ipv4(interface)) < 1: ^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/vyos/template.py", line 458, in get_ipv4 return Interface(interface).get_addr_v4() ^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/vyos/ifconfig/interface.py", line 334, in __init__ if not self.iftype: ^^^^^^^^^^^ AttributeError: 'Interface' object has no attribute 'iftype' This commit removes the code path in question and the class attribute check. The reason for the iftype attribute in the past was a common _create() method serving for all interface types. As we already have a lot of derived implementations and not all honor the classes iftype/type member - or even worse honor it only in 50% of the occurrences it's time to drop it.
2025-01-07Merge pull request #4253 from natali-rs1985/T6975Daniil Baturin
utils: T6975: Add 'vrf' and 'netns' arguments to functions in 'vyos.utils.process'
2025-01-06T7016: Simplify logic for force deleting dynamic IPv4 address from interfaceIndrajit Raychaudhuri
2025-01-06utils: T6975: Add 'vrf' and 'netns' arguments to functions in ↵Nataliia Solomko
'vyos.utils.process'
2025-01-06T6841: firewall: improve config parsing for ZBF when using VRFs and ↵Nicolas Fort
interfaces attached to VRFs
2025-01-05T7016: force delete only dynamic IPv4 address from interfaceAdam Smith
2024-12-31frrender: T6991: do not loose DHCP default route when no static route is definedChristian Breunig
The reason is that DHCP routes are not re-generated during FRRrender as long as there is no protocols static entry in the configuration at all. Move out the DHCP configuration read-in from the static section.
2024-12-30frr: T6746: additional improvements after 10.2 upgrade (#4259)Christian Breunig
* smoketest: T6746: add substring search in getFRRconfig() Some daemons (e.g. bgpd) have several nested substrings/sections like router bgp 100 address-family ipv4 unicast .. exit-address-family exit We can now use getFRRconfig() with the substring option to extract only address-family ipv4 unicast .. exit-address-family Making config validation more granular * frrender: T6746: only re-render FRR config if config_dict did change * frrender: T6746: fix naming glitch isis/eigrp * frrender: T6746: add --stdout option when running with debug flags * smoketest: T6746: remove unneeded commit_guard time It was an invalid workarround as the underlaying issue seems to be a race condition in CStore. The commit process is not finished until all pending files from VYATTA_CHANGES_ONLY_DIR are copied to VYATTA_ACTIVE_CONFIGURATION_DIR. This is done inside libvyatta-cfg1 and the FUSE UnionFS part. On large non-interactive commits FUSE UnionFS might not replicate the real state in time, leading to errors when querying the working and effective configuration. TO BE DELETED AFTER SWITCH TO IN MEMORY CONFIG
2024-12-24T6944: fix unrelated formattingNicolas Vollmar
2024-12-24T6944: adds option to enable switchdev mode on ethernet interfaceNicolas Vollmar
2024-12-22ifconfig: T6972: smoketests fail as IP address is not removed in timeChristian Breunig
From time to time integration tests fail as the DHCP assigned IP address is not removed in time then dhclient stops. Add an explicit code path cleaning dynamic assigned addresses from interface when disabling DHCP - if such a dynamic address is remaining. ====================================================================== FAIL: test_dhcp_vrf (__main__.EthernetInterfaceTest.test_dhcp_vrf) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/libexec/vyos/tests/smoke/cli/test_interfaces_ethernet.py", line 72, in tearDown self.assertNotIn(AF_INET, ifaddresses(interface)) AssertionError: 2 unexpectedly found in {17: [{'addr': '52:54:00:00:00:00', 'broadcast': 'ff:ff:ff:ff:ff:ff'}], 2: [{'addr': '192.0.2.103', 'netmask': '255.255.255.0', 'broadcast': '192.0.2.255'}], 10: [{'addr': 'fe80::5054:ff:fe00:0%eth0', 'netmask': 'ffff:ffff:ffff:ffff::/64'}]}
2024-12-20Merge pull request #4246 from natali-rs1985/T6930Christian Breunig
pppoe: T6930: Remove unnecessary code
2024-12-20pppoe: T6930: Remove unnecessary codeNataliia Solomko
In case of changes in config that require reconnect PPPoEIF.remove() function is called and old default routes are removed. So we do not need to do it once again.
2024-12-19Merge pull request #4243 from c-po/frr-10Christian Breunig
frrender: T6746: runtime improvements
2024-12-18ifconfig: fix AttributeError caused by internal race conditionChristian Breunig
File "/usr/lib/python3/dist-packages/vyos/ifconfig/interface.py", line 342 if not self.iftype: ^^^^^^^^^^^ AttributeError: 'Interface' object has no attribute 'iftype'
2024-12-18frrender: T6746: move get_frrender_dict from vyos.configdict to this moduleChristian Breunig
Keep all FRRender stuff in one place.
2024-12-18Merge pull request #4225 from natali-rs1985/T6767Christian Breunig
op_mode: T6767: Check latest image version in VRF context for "add system image latest vrf <name>"
2024-12-18Merge pull request #4223 from HollyGurza/T6874Christian Breunig
T6874: [QoS] Add class filter by ether
2024-12-18vyos-configd: T6746: render resulting FRR configuration only onceChristian Breunig
Previously the FRR configuration was rendered via Jinja2 on every call to get_frrendet_dict() - but it was used/applied only once. We save the CPU cycles and render the FRR configuration only once prior to applying it in FRR.
2024-12-18frrender: T6746: rename config -> config_dictChristian Breunig
2024-12-18frrender: T6746: support dynamic enable/disable of debug outputChristian Breunig
Always evaluate if the debug file exsits and not once during module init. Thus we can always eanble/disable FRR command debugging during runtime even under vyos-configd.
2024-12-18Merge branch 'frr-10' into currentChristian Breunig
* frr-10: op-mode: T6746: add "show log frr" and "monitor log frr" commands frrender: T6746: do not render candidate FRR config to running FRR config file path frrender: T6746: ensure there are no empty lines in the rendered FRR configuration bgp: T6746: remove debug code
2024-12-18T6874: [QoS] Add class filter by etherkhramshinr
Implement a command to configure QoS policy filters by ether properties. The supported match types include: - Destination: Specify the Ethernet destination address. - Protocol: Define the Ethernet protocol. - Source: Set the Ethernet source address. `set qos policy <type> <name> class <id> match <match-id> ether <destination|protocol|source> <val>`
2024-12-17frrender: T6746: do not render candidate FRR config to running FRR config ↵Christian Breunig
file path
2024-12-17frrender: T6746: ensure there are no empty lines in the rendered FRR ↵Christian Breunig
configuration
2024-12-17Merge pull request #4175 from HollyGurza/T6800Christian Breunig
T6799: QoS: Improve Priority-Queue Policy
2024-12-16frr: T6746: reference common daemon definition in vyos.frrenderChristian Breunig
Do not use custom daemon definitions like bgpd - re-use them from e.g. vyos.frrender.bgp_daemon