summaryrefslogtreecommitdiff
path: root/python/vyos
AgeCommit message (Collapse)Author
2020-05-19configdict: T2372: add new interface_default_data dictChristian Poessinger
Dictionary is used to remove the amount of duplicated code by e.g. ethernet or bridge interface.
2020-05-18flake8: T2475: fix a number of issue reported by flake8Thomas Mangin
2020-05-17config: T2409: effective config should be empty at boot initializationJohn Estabrook
2020-05-17config: return empty dict if configuration under path is emptyJohn Estabrook
2020-05-17pppoe: dhcpv6-pd: T421: initial supportChristian Poessinger
The following configuration will assign a /64 prefix out of a /56 delegation to eth0. The IPv6 address assigned to eth0 will be <prefix>::ffff/64. If you do not know the prefix size delegated to you, start with sla-len 0. pppoe pppoe0 { authentication { password vyos user vyos } description sadfas dhcpv6-options { delegate eth0 { interface-id 65535 sla-id 0 sla-len 8 } } ipv6 { address { autoconf } enable } source-interface eth1 } vyos@vyos:~$ show interfaces Codes: S - State, L - Link, u - Up, D - Down, A - Admin Down Interface IP Address S/L Description --------- ---------- --- ----------- eth0 2001:db8:8003:400::ffff/64 u/u
2020-05-17dhcpv6-pd: T421: migrate from ISC dhclient to wide-dhcpv6-clientChristian Poessinger
ISC does not support running the client on PPP(oE) interfaces which makes it unusable for DHCPv6 Prefix Delegation tasks. Internet Systems Consortium DHCP Client 4.4.1 Copyright 2004-2018 Internet Systems Consortium. All rights reserved. For info, please visit https://www.isc.org/software/dhcp/ Unsupported device type 512 for "pppoe0"
2020-05-11ifconfig/dhcp: T2449: remove accept_ra logic as it was wrongJernej Jakob
Currently accept_ra was set to 0 if 'address dhcpv6' was set on an interface. This is wrong, as without RA, the system will get no routes to the DHCPv6-obtained prefix. Since the logic for accept_ra was moved to the interface scripts, it can be removed from the dhclient code.
2020-05-11vlan: T2449: set accept_ra on vlan interfacesJernej Jakob
2020-05-11configdict: T2449: set accept_ra=2 if ipv6 address autoconf or dhcpv6 is setJernej Jakob
To make SLAAC and DHCPv6 work when forwarding=1, accept_ra must be 2 (default for accept_ra is 1).
2020-05-11interface: T2449: add ability to set accept_raJernej Jakob
2020-05-08Merge pull request #395 from thomas-mangin/T2417Christian Poessinger
validator: T2417: try to make the code clearer
2020-05-08Merge branch 'current' of github.com:thomas-mangin/vyos-1x into T2417Thomas Mangin
2020-05-08vlan: T2435: fix missing dict key in print variableJernej Jakob
2020-05-07debug: T1230: add time information to saved debug logsThomas Mangin
2020-05-06debug: T1230: add time information to saved debug logsThomas Mangin
2020-05-06validator: T2417: try to make the code clearerThomas Mangin
2020-05-06debug: T2426: remove invisible characters when printingThomas Mangin
2020-05-05configdict: T2427: clarify code commentsJernej Jakob
2020-05-05vlan: T2427: move code that applies VLANs to interface to common functionJernej Jakob
2020-05-05vlan: T2427: convert vlan config variables from lists to dictsJernej Jakob
Previously all vlan configs, which are dicts, were appended to a simple list, with the distinguishing 'id' stored inside the dicts themselves. This worked, but wasn't ideal. This commit converts them to dicts, where the key is the VLAN ID and value the config dict of that VLAN. This makes it posible to access single VLANs by their ID (key) and we can for-loop and get both the ID and config with: 'for vif_id, vif in conf["vif"].items():'
2020-05-05configdict: T2427: do not remove all addresses when disabling interfaceJernej Jakob
Commit 3fdf0093a introduced code that removed all addresses from an interface when that interface is disabled. This is wrong, as other configured services may be listening on these addresses and may fail to start if their configured address isn't present. It also caused a commit error when applying dhcp-server configuration: DHCP server configuration error! None of configured DHCP subnets does not have appropriate primary IP address on any broadcast interface. This commit reverts it to prior behavior, which was to just put the interface admin down and leave all addresses configured, other than the IPv6 'fe80::EUI-64/64' link-local, which it deletes, as the interface may not have a MAC if it's put down.
2020-05-05config: T2427: always return copies of listsJernej Jakob
Since lists in python are assigned by reference, taking the return value from these functions and modifying it will modify all other return values of functions that called the function before and did not explicitly copy it. To be safe, always make a copy of lists before returning them.
2020-05-04ifconfig: section: T2241: add get_config_path functionJernej Jakob
Add a function that converts an interface name to its config path. For example: 'eth0.1.2' -> 'ethernet eth0 vif-s 1 vif-c 2'
2020-05-04ifconfig: T2241: fix section _basename vlan strippingJernej Jakob
Previously the function returned the correct basename only for vif interfaces as it stopped at the 2nd dot. If we had a vif-s vif-c interface 'eth0.1.2' it would return 'eth0.'. It is now fixed to strip both vif-s and vif-c if 'vlan=True' (default).
2020-05-04validate: T2241: add func that checks if an interface has a configured addressJernej Jakob
2020-05-04vlan: T2241: make address and bridge membership mutually exclusiveJernej Jakob
Bridge members should not have addresses assigned.
2020-05-04configdict: T2241: don't add default IPv6 EUI64 if member of a bridgeJernej Jakob
Bridge members should not have addresses assigned.
2020-05-04vlan: T2241: fix falling out of bridge when changing settingsJernej Jakob
Previously, set_vrf was always called, which uses the same master and nomaster commands as bridge, so it removed the interface from the bridge. - add checks to make VRF and bridge membership mutually exclusive - always re-add the interface back to any bridge it is part of in case it is deleted and recreated (e.g. changing egress/ingress-qos)
2020-05-04interface: T2241: add function to add self to bridgeJernej Jakob
Will be called by all interface scripts to re-add themselves to a bridge after deleting and recreating themselves.
2020-05-04util: T2241: add get_bridge_member_config functionJernej Jakob
Function that parses the config of a bridge member into a dict that is needed to apply all port config when adding a port to a bridge. Needed because other interfaces will be adding themselves to the bridge outside of the bridge conf_mode script and they need a common place to get their config. Can't be put as method of BridgeIf as we can't invoke it without it creating the bridge (create=False raises an exception), we need to get the configuration before we create the interface.
2020-05-04vlan: T2241: add checks for bridge membershipJernej Jakob
2020-05-04intf_from_dict: T2241: move getting mac code so it's sorted alphabeticallyJernej Jakob
2020-05-04validate: T2241: rewrite is_bridge_member to generic is_memberJernej Jakob
- rewrite the function to support both bridge and bonding interface types, if the type is passed it searches only that type, otherwise it searches both - move is_member check out of the deleted condition - move is_member check to intf_from_dict for interfaces that use it
2020-05-04configdict: T2241: get interface name in intf/vlan_from_dictJernej Jakob
This is needed as later functions depend on it
2020-05-04util: T2241: add func that gets interface name from current config levelJernej Jakob
2020-05-04vlan: T2241: cleanup vlan_to_dict functionJernej Jakob
Remove one unnecessary call to conf.get_level()
2020-05-03interface: T2367: optimize flow and detriplicate add/del_addr functionsJernej Jakob
- detriplicate list appending - detriplicate returns - use if-elif-else - move check if address is already added to beginning - move caching in variable to after address assignment so a failed assignment won't cache the address
2020-05-02interface: T2367: use self.ifname instead of self.configThomas Mangin
2020-05-02interface: T2367: de-imbricate the ifsThomas Mangin
2020-05-02Merge pull request #388 from jjakob/flush-addrs-T2367Christian Poessinger
T2367: flush addresses when adding bond/bridge members
2020-05-02interface: T2367: add flush_addrs functionJernej Jakob
Add function that flushes all addresses from an interface.
2020-05-02interface: T2367: fix add_addr and del_addr address tracking in cacheJernej Jakob
Correctly track addresses in cache _addr variable
2020-05-02dictconfig: T2372: fix interfaces disable bugThomas Mangin
off-by one line where the IP were added to the add list and not the remove list
2020-05-02Merge pull request #383 from thomas-mangin/T2372Christian Poessinger
disable :T2372: disable sub-interface if parent is
2020-05-02configdict: T2372: correct disable support in vlan_to_dictThomas Mangin
implement disable_state which looks if the current node, or some designated parent node are set are 'disable' and thefore should be ignored. break down the function vlan_to_dict in it multiple components add_to_dict which can parse vif, vif-s, or vif-c and add them to the configuration dictionary intf_to_dict which setup a base configuration dictionary from the interface Config() with addresses, arp, disable, ... it is used by vlan_to_dict but can and will be used by other interfaces
2020-04-29dhclient: T2393: switch to old configuration path to keep existing op-mode ↵Christian Poessinger
tolls intact
2020-04-28dhclient: T2393: remove intermediate _DHCP helper classChristian Poessinger
The intermedite class only held the path to the configuration files - thus its existence was doubtworthy. For better readability and a clean inheritance graph that class has been dropped.
2020-04-28dhclient6: T2393: T2394: migrate from SysVinit to systemdChristian Poessinger
2020-04-28dhclient: T2393: migrate from SysVinit to systemdChristian Poessinger
2020-04-28vlan: T2372: de-indent add_vlanThomas Mangin