summaryrefslogtreecommitdiff
path: root/python/vyos/ifconfig
AgeCommit message (Collapse)Author
2025-04-22Merge pull request #4392 from symysak/T4627Daniil Baturin
interface: T4627: support setting of IPv6 Interface Identifier(Token)
2025-04-18interface: T4627: support IPv6 Interface Identifier (token) for SLAACYoshiaki Suyama
Add common IPv6 CLI option (use ethernet as example): set interfaces ethernet eth0 ipv6 address interface-identifier Co-authored-by: Christian Breunig <christian@breunig.cc>
2025-04-10bridge:T7322: Fix bridge allowed-vlan handlingl0crian1
Allowed VLAN ranges are unnecessarily deconstructed into individual vlans, and then added one by one to the bridge. This can take a long time if a large range like 1-4084 is used. - python/vyos/configdict.py - Added get_vlans_ids_and_range function to return configured ranges - python/vyos/ifconfig/bridge.py - Modified add and delete vlan section to not loop unnecessarily
2025-03-01Revert "wireguard: T4930: remove pylint W0611: unused import"James Roberts
This reverts commit bb70ea569f4548b103c54bbb7c393221a6da0a23.
2025-02-25T7171: Add dstport option to GENEVE tunnelsNataliia Solomko
2025-02-19Revert "wireguard: T4930: drop unused ↵Christian Breunig
WireGuardOperational().show_interface() method" This reverts commit 98414a69f0018915ac999f51975618dd5fbe817d.
2025-02-08vyos.ifconfig: T5103: always stop the DHCP client process bevore changing VRFChristian Breunig
Always stop the DHCP client process to clean up routes within the VRF where the process was originally started. There is no need to add a condition to only call the method if "address dhcp" was defined, as this is handled inside set_dhcp(v6) by only stopping if the daemon is running. DHCP client process restart will be handled later on once the interface is moved to the new VRF.
2025-02-06Merge pull request #4335 from c-po/T5103Christian Breunig
vyos.ifconfig: T5103: force dhclient restart on VRF change
2025-02-05vyos.ifconfig: T5103: revert change to del_addr() signatureChristian Breunig
An optional argument vrf_changed was added to the function signature but it was not put to use. We only need to restart DHCP client on add_addr().
2025-02-05vyos.ifconfig: T7135: only restart DHCPv6 client if neededChristian Breunig
Previously the DHCPv6 client was restarted on any change to the interface, including changes only to the interface description. Re-use pattern from IPv4 DHCP to only restart the DHCP client if necessary.
2025-02-05wireguard: T4930: remove pylint W0611: unused importChristian Breunig
2025-02-05vyos.ifconfig: T5103: force dhclient restart on VRF changeChristian Breunig
Moving an interface in, out or between VRFs will not re-install the received default route. This is because the dhclient binary is not restarted in the new VRF. Dhclient itself will report an error like: "receive_packet failed on eth0.10: Network is down". Take the return value of vyos.ifconfig.Interface().set_vrf() into account to forcefully restart the DHCP client process and optain a proper lease.
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: allow peers via FQDNsskaje
* set interfaces wireguard wgXX peer YY hostname <fqdn>
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-06T7016: Simplify logic for force deleting dynamic IPv4 address from interfaceIndrajit Raychaudhuri
2025-01-05T7016: force delete only dynamic IPv4 address from interfaceAdam Smith
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-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-02T6917: fix RPS ethernet settings for CPUs with more than 32 coresViacheslav Hletenko
The maximun value theat could be written for the 'rpc_cpu' is 4294967295 or 0xffffffff in the chunk splitted by commas
2024-11-21T6796: QoS: match filter by interface(iif) (#4188)Roman Khramshin
2024-11-19T6490: Allow creation of wireguard interfaces without requiring peers (#4194)sskaje
* T6490: Allow creation of wireguard interfaces without requiring peers
2024-10-17T4583: Rewrite VRRP op-mode to vyos.opmode formatkhramshinr
reformat file by linter rules
2024-10-17T4583: Rewrite VRRP op-mode to vyos.opmode formatkhramshinr
2024-09-20op-mode: T4833: Include wireguard peer name in interface summary reportNataliia Solomko
2024-09-19wireless: T6709: fix missing wpa_supplicant configurationChristian Breunig
Commit 0ee8d5e35 ("ethernet: T6709: move EAPoL support to common framework") added support to also have EAPoL on other interface types then ethernet. This introduced a regression where the wireless interface wpa_supplicant configuration would get deleted.
2024-09-14ethernet: T6709: move EAPoL support to common frameworkChristian Breunig
Instead of having EAPoL (Extensible Authentication Protocol over Local Area Network) support only available for ethernet interfaces, move this to common ground at vyos.ifconfig.interface making it available for all sorts of interfaces by simply including the XML portion #include <include/interface/eapol.xml.i>
2024-08-01Merge pull request #3221 from lucasec/t5873Christian Breunig
T5873: ipsec remote access VPN: support VTI interfaces.
2024-07-26T5873: vpn ipsec: re-write of ipsec updown hookLucas Christian
2024-07-23interface: T6592: remove interface from conntrack ct_iface_map on deletionChristian Breunig
We always have had stale interface entries in the ct_iface_map of nftables/ conntrack for any interface that once belonged to a VRF. This commit will always clean the nftables interface map when the interface is deleted from the system.
2024-07-20interfaces: T6592: moving an interface between VRF instances failedChristian Breunig
To reproduce: set vrf name mgmt table '150' set vrf name no-mgmt table '151' set interfaces ethernet eth2 vrf 'mgmt' commit set interfaces ethernet eth2 vrf no-mgmt commit This resulted in an error while interacting with nftables: [Errno 1] failed to run command: nft add element inet vrf_zones ct_iface_map { "eth2" : 151 } The reason is that the old mapping entry still exists and was not removed. This commit adds a new utility function get_vrf_tableid() and compares the current and new VRF table IDs assigned to an interface. If the IDs do not match, the nftables ct_iface_map entry is removed before the new entry is added.
2024-07-08vxlan: T6505: Support VXLAN VLAN-VNI range mapping in CLI (#3756)Nataliia S
2024-06-19macsec: T5447: fix error message syntax - there is no tx and rx key, only keyChristian Breunig
2024-06-01vxlan: T6401: Avoid calling get_vxlan_vni_filter() unless we need itAndrew Topp
`bridge vni show dev vxlanX` will exit with an error if no VNI filters are installed, but the getter is used even when we haven't installed any. This fix avoids fetching a list of VNI filters unless we know we've created some.
2024-05-30vyos.ifconfig: T6421: verify /etc/hostname exists before readingChristian Breunig
Inspired-By: Brandon Zhi <Huiyuze_Zhi@protonmail.com>
2024-05-10bond: T6303: must reset system-mac to 00:00:00:00:00:00 on deletionChristian Breunig
2024-05-10bond: T6303: system-mac is not allowed to be a multicast MAC addressChristian Breunig
2024-05-10bond: T6303: add system mac address on bondfett0
2024-04-25T6258: Add sysctl base-reachable-time for IPv6Viacheslav Hletenko
Add abiilty to change `base_reachable_time_ms` option /proc/sys/net/ipv6/neigh/{ifname}/base_reachable_time_ms
2024-04-11T6222: VRRP show prefix for long rfc3768-compatibility interfacesViacheslav Hletenko
If we use rfc3768-compatibility with long interface names like eth1.100.200 it converts the VRRP interface name name to `<interface>v<VRID><IP version>` For example `eth2.100.200v10v4` The limit for interface name is 15 symbols and it causes that interface name is ignoring by keepalived VMAC interface name 'eth2.100.200v10v4' too long or invalid characters - ignoring And it uses the default prefix `vrrp` for such cases. It works fine, but such interfaces are not displayed in the op-mode Allow prefix `vrrp` for the op-mode for `show interfaces`
2024-04-03T6199: drop unused Python importsChristian Breunig
found using "git ls-files *.py | xargs pylint | grep W0611"
2024-04-03T6199: replace netifaces.interfaces() with common custom helpersChristian Breunig
* Use interface_exists() outside of verify() * Use verify_interface_exists() in verify() to drop common error message
2024-04-01vrf: T3655: always use full nft command name (e.g. --check over -c)Christian Breunig
2024-04-01dhcpv6-client: T2590: fix vyos-hostsd update for nameserver and search domainsChristian Breunig
After migrating from ISC DHCLIENT for IPv6 to wide-dhcp-client the logic which was present to update /etc/resolv.conf with the DHCP specified nameservers and also the search domain list was no longer present. This commit adds a per interface rendered script to inform vyos-hostsd about the received IPv6 nameservers and search domains.