summaryrefslogtreecommitdiff
path: root/python/vyos
AgeCommit message (Collapse)Author
2022-02-17vyos.configverify: T4255: fix unexpected print of dictionary instead of keyChristian Poessinger
(cherry picked from commit 9e626ce7bad2bd846826822a3622fedf2d937e09)
2022-02-17wireless: T4240: bugfix interface bridgingChristian Poessinger
VLAN isolation can not be "set" when interface is of type wifi. (cherry picked from commit 1ceaed55a629c92cf42baccdef4106e8d0e4914e)
2022-02-13vyos.util: T4191: add new sysctl() helper functionChristian Poessinger
(cherry picked from commit b40315b3c5051888f499961e63410e14c5d1bad7)
2022-02-13ethernet: T4242: speed/duplex can never be switched back to auto/autoChristian Poessinger
(cherry picked from commit 812d9770619b968b04961aebf3944fde13df491b)
2022-02-06config: T4228: is_member() must return all instances not only the last oneChristian Poessinger
(cherry picked from commit 5e7e96380b314587bbd8bd584848d39caef86f3f)
2022-01-11remote: T3950: Gracefully handle chained exceptionserkin
2022-01-06op-mode: T4142: Fix for show input ifbX interfacesViacheslav
Ability to see interface type "input" ifbX from op-mode (cherry picked from commit 5fdf4e5988344f7a890fe351183b58b8e21699c2)
2021-12-16T3356: Backport remote moduleerkin
2021-12-15pppoe-server: T3006: Add range to regex generatorDmitriyEshenko
2021-12-14http-api: T4071: allow API to bind to unix domain socketJohn Estabrook
(cherry picked from commit 0e3c35e6517f5cfebb4206c735a2ea976a7fd383)
2021-12-10ConfigError: T4068: automatically wrap message at 72 charactersChristian Poessinger
(cherry picked from commit 4948380a588dea59a01e6e33b9b8e1524ba6a4ed)
2021-12-09vyos.configdict: T4064: bugfix for IP addresses not removed from KernelChristian Poessinger
Commit e8c6595fc47 ("vyos.ifconfig: T2738: do not remove OS assigned IP addresses from interface") addressed an issue with IP addresses added to interfaces by daemons and not by the CLI. The solution in this commit for IP address removal unfortunately did not cover VLAN (802.1q and 802.1ad) IP address removal in the same way as it is done for non VLAN interfaces. The code was missing.
2021-12-09configquery: T4060: allow use before boot configuration is completeJohn Estabrook
(cherry picked from commit e51b9444a6a6a4640445c22a7f71ba1e035876da)
2021-12-09vyos.util: T4061: add function to check for completion of boot configJohn Estabrook
2021-12-04T4035: correct the interface basename extraction logicDaniil Baturin
to avoid confusing 'v' in GENEVE interface prefix ('gnv') with a "vXXX" part of a VRRP interface
2021-12-03configquery: T3402: use vyatta-op-cmd-wrapper to provide environmentJohn Estabrook
(cherry picked from commit ae16a51506cdc4de8e18f4678b8f55654d4abbba)
2021-11-19ethernet: T4011: deleting interface should place interface in admin down stateChristian Poessinger
Interface will still be visible to the operating system. (cherry picked from commit a14f93adfa633eabff90524e1f83d56092ec0c3c)
2021-11-19wwan: T3620: fix commend in remove()Christian Poessinger
Improve commend in WWANIf.remove() - remove() was implemented in commit 61e4d75a ("wwan: T3620: place interface in A/D state when removed"). (cherry picked from commit d9a19b77a56031fa3fbfa43a85c8be7ee83ae3d7)
2021-11-18wwan: T3620: place interface in A/D state when removedChristian Poessinger
2021-11-18wwan: T3795: make connect and disconnect op-mode commands aware to WWAN ↵Christian Poessinger
interfaces
2021-11-07http-api: T2768: example using GraphQL for high-level config operationsJohn Estabrook
(cherry picked from commit b168b4cc7da456f14714d917cdc7a1c6b8df9af5)
2021-11-07vyos.template: T2720: allow setting template directoryJohn Estabrook
(cherry picked from commit d3d4e3bedcc0b43e16554b1832b43da9d41e651f)
2021-11-05vyos.configdict: T3972: bugfix QinQ vif-c removal triggered KeyErrorChristian Poessinger
Generic get_removed_vlans() function replaced the entire config dict when any QinQ vif-c subinterface was deleted. (cherry picked from commit b3be36586c85005538d5cc994c7c9694b9907d81)
2021-11-03sstp: T2566: use XML defaultValue over Jinja2 hardcoded valueChristian Poessinger
2021-10-24vyos.ethtool: T3935: relax __init__() when driver name is not detectedChristian Poessinger
In addition to commit 0b414bcd ("vyos.ethtool: T3874: do not throw exception if adapter has issues with autoneg") we should also not care too strict when locating the driver name. This might cause false positives. (cherry picked from commit 8cf5a4f023c5459cad4c84e93f73a9ddd69be81a)
2021-10-21tunnel: T3925: dhcp-interface was of no use - use source-interface insteadChristian Poessinger
2021-10-09tunnel: T3894: fix design when building synthetic MAC addressesChristian Poessinger
It seems not all systems have eth0 - get a list of all available Ethernet interfaces on the system (without VLAN subinterfaces) and then take the first one. (cherry picked from commit f19c92f255011149eeb7626a2e158456abe4c9b8)
2021-10-02vyos.ifconfig: T3883: bugfix VRF deletionChristian Poessinger
We can not pass None as VRF name, this raises an exception. OSError: [Errno 255] failed to run command: ip link set dev eth2 master None
2021-09-30vyos.ethtool: T3874: do not throw exception if adapter has issues with autonegChristian Poessinger
Instead of throwing an exception when an adapters autoneg capabilities can not be detected, just pretend it does not support autoneg. (cherry picked from commit 0b414bcd2930a1469df0a747962f4650d0fb964b)
2021-09-26vyos.ifconfig: T3860: bugfix in get_mac_synthetic()Christian Poessinger
Commit 081e23996f (vyos.ifconfig: get_mac_synthetic() must generate a stable "MAC") calculated a "stable" synthetic MAC address per the interface based on UUID and the interface name. The problem is that this calculation is too stable when run on multiple instances of VyOS on different hosts/hypervisors. Having R1 and R2 setup a connection both via "tun10" interface will become the same "synthetic" MAC address manifesting in the same link-local IPv6 address. This e.g. breaks OSPFv3 badly as both neighbors communicate using the same link-local address. As workaround one can: set interfaces tunnel tun1337 address 'fe80::1:1337/64' set interfaces tunnel tun1337 ipv6 address no-default-link-local This commit changes the way in how the synthetic MAC address is generated. It's based on the first 48 bits of a sha256 sum build from a CPU ID retrieved via DMI, the MAC address of eth0 and the interface name as used before. This should add enough entropy to get a stable pseudo MAC address. (cherry picked from commit 8d6861290f39298701b0a89bd358545763cee14b)
2021-09-25vyos.ifconfig: dhcpv6: re-use systemd_service definition variableChristian Poessinger
(cherry picked from commit d1c58addd881e06b389799a9c14d8ebf5d03c567)
2021-09-25vyos.ifconfig: dhcp: T3300: always re-start dhcp client instead of startChristian Poessinger
Commit dd2eb5e5686655 ("dhcp: T3300: add DHCP default route distance") changed the logic on how the DHCP process is going to be started. The systemd unit was always "started" even if it was already running. It should rather be re-started to track changes in e.g. the DHCP hostname setting. (cherry picked from commit 8ba8f0e097527e3aaaf8b395bfc07cce47e2c788)
2021-09-21vrrp: keepalived: T616: drop /etc/default/keepalivedChristian Poessinger
This is a follow-up commit to 65398e5c8 ("vrrp: keepalived: T616: move configuration to volatile /run directory") as it makes no sense to store a static /etc/default/keepalived file marked as "Autogenerated by VyOS" that only enabled the SNMP option to keepalived. Better pass the --snmp switch via the systemd override file and drop all other references/files.
2021-09-21vrrp: keepalived: T616: move configuration to volatile /run directoryChristian Poessinger
Move keepalived configuration from /etc/keepalived to /run/keepalived. (cherry picked from commit b243795eba1b36cadd81c3149e833bdf5c5bea70)
2021-09-20ifconfig: T2104: cleanup IPv6 EUI-64 handling in update()Christian Poessinger
(cherry picked from commit 3f6ae12908f54222f2f79a87bed51f71e2fbac87)
2021-09-20vyos.ifconfig: get_mac_synthetic() must generate a stable "MAC"Christian Poessinger
Commit b7d30137b1 ("vyos.ifconfig: provide generic get_mac_synthetic() method") provided a common helper to generate MAC addresses used by EUI64 addresses for interfaces not having a layer2 interface (WireGuard or ip tunnel). The problem is that every call to the helper always yielded a new MAC address. This becomes problematic when IPv6 link-local addresses are generated and modified on the interface as multiple link-local (fe80::/64) addresses can easily be added to the interface leaving ... a mess. This commit changes the way how the "synthetic" MAC is generated, we generate a UUID which is stable as it is based on the interface name. We take out the last 48 bits of the UUID and form the "MAC" address. (cherry picked from commit 081e23996feb60ad903caf8b0a4587f5dacc69bf)
2021-09-20vyos.util: add is_systemd_service_active() helper functionChristian Poessinger
Required by the vyos.ifconfig library - backported from 1.4 (current)
2021-09-20vyos.ifconfig: T2738: can only read from a file when it existsChristian Poessinger
When IPv6 is disbaled on an interface also the sysfs files related to IPv6 for this interface vanish. We need to check if the file exists before we read it. (cherry picked from commit 672a70613aa6c987bca417f93b587eddccbfd53a)
2021-09-19vyos.ifconfig: T2738: do not remove OS assigned IP addresses from interfaceChristian Poessinger
When using VRRP on any given interface and performing an action against that interface - be it even only changing the alias - will trigger a removal of the VRRP IP address. The issue is caused by: # determine IP addresses which are assigned to the interface and build a # list of addresses which are no longer in the dict so they can be removed cur_addr = self.get_addr() for addr in list_diff(cur_addr, new_addr): When the script calls into the library - we will drop all IP addresses set on the adapter but not available in the config dict. We should only remove the IP addresses marked by the CLI to be deleted! (cherry picked from commit e80d0aebd691f1a707ab534b4d1340fa0b793e01)
2021-09-19vyos.configdict: bugfix: leaf_node_changed() must return empty dict when ↵Christian Poessinger
node is added Commit f476e456 ("vyos.configdict: leaf_node_changed() must return empty dict when node is added") returned [''] as "empty" dict - but this is not empty. >>> if ['']: ... print('foo') ... foo It should rather be: [] (cherry picked from commit e28a80a2b742ea3d9d4bcb8ae66c7a0d51aaaff6)
2021-09-19vyos.ifconfig: T2738: add delta check when changing interface parametersChristian Poessinger
There is no need to alter interface parameters if they have not changed at all. (cherry picked from commit b4c58c5aefaca4fce817b58327b9c7c3e8145d6d)
2021-09-11Fix inconsistent capitalization in the show version outputDaniil Baturin
2021-09-10ethtool: T3802: extend check_speed_duplex() implementation to support 'auto'Christian Poessinger
2021-09-10ethernet: T3802: not all NICs support reading speed/duplex settings in all ↵Christian Poessinger
states Turns out an AX88179 USB 3.0 NIC does not support reading back the speed and duplex settings in every operating state. While the NIC is beeing initialized, reading the speed setting will return: $ cat /sys/class/net/eth6/speed cat: /sys/class/net/eth6/speed: Invalid argument Thus if this happens, we simply tell the system that the current NIC speed matches the requested speed and nothing is changed at this point in time.
2021-09-10ethernet: T3802: use only one implementation for get_driver_name()Christian Poessinger
Move the two implementations to get the driver name of a NIC from ethernet.py and ethtool.py to only ethtool.py.
2021-09-10ethernet: T3802: check if driver supports changing flow-control settingsChristian Poessinger
2021-09-09vyos.configdict: T3814: use no_tag_node_value_mangle in get_interface_dict()Christian Poessinger
This change is required and currently only impacts WireGuards peer configuration, so that the peers name is not mangled. (cherry picked from commit 4d2201eed00ac4780d0196abf53dd9b7cb943a09)
2021-09-06ifconfig: T3806: "ipv6 address no_default_link_local" required for MTU < 1280Christian Poessinger
This commit also extends the smoketest to verify that the exception for this error is raised. (cherry picked from commit 84a429b41175b95634ec9492e0cf3a564a47abdd)
2021-09-06vyos.util: T2755: rename dict_search() function args to match other ↵Christian Poessinger
implementations (cherry picked from commit 9d0c37fbbc91acc9f2c0f2abaab360479e451f0f)
2021-08-31vyos.ethtool: T3163: ring-buffer values should be stored as stringChristian Poessinger
Commit 29082959 ("ethernet: T3163: only change ring-buffer settings if required") added a delta-check code for the ring buffer values, unfortunately this was never properly evaluated as str() and int() got compared resulting always in an unequal result. (cherry picked from commit 6c280b1ca52c8f2a80bbaea52aa3e09060af04b3)