Age | Commit message (Collapse) | Author |
|
|
|
|
|
The current VyOS CLI parser code written in Python contains a ton of duplicates
which I can also hold myself accountable for - or maybe mainly me - depends on
the angle of judge.
|
|
|
|
|
|
|
|
|
|
- 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
|
|
|
|
|
|
The IPv6 address can be expressed in different ways:
(for example all these are valid loopback ::1, 0::1, 0:0::0:001)
The IPv6 need to be normalised when tested, and the best way to
do this is to test it on-wire representation, the same can be done
for IPv4.
Also The interface name which returned by netifaces.ifaddresses can
have a % in the 'addr' field, for example '::1%eth0', which would
also break the test in is_intf_addr_assigned.
|
|
This reverts commit e2f80e57d9895d207edf0ad92c299dc7862087d6.
Due to failing smoketests this commit is reverted.
|
|
Adding an already existing IP address on an interface would cause
the 'ip addr add' command to fail. To prevent this, the code checks
if the IP already exists on the interface.
The code was not normalising the different ways of
representing the IPv6 address (trailing 0, ::, etc.).
|
|
|
|
Fixes error when creating bridge interfaces:
ValueError: <module 'time' (built-in)> must be a number
|
|
this patch allows to get or change many interface options (mtu, arp settings, ...)
using get_interface / set_interface functions
|
|
|
|
Commit 17dd50751d ("bfd: T1949: fix verification logic for IPv6 BFD peers")
added a mechanism to probe if an IPv6 address is link-local or not. Sometimes
an interface suffix is appended by %interface to a link-local address, as we
need to know an interface for which this address is (hence the name) link-local.
Remove any interface identifier before checking if the address is local or not.
|
|
IPv6 BFD peers only require a source address unless link-local addresses are used.
|
|
- management-address is not a <multi/> node
- added new vyos.validate.is_loopback_addr() function - returns true is address
passed is a looback address
|
|
|
|
|
|
Verify if the given IPv4/IPv6 address is assigned to specific interface. It can
check both a single IP address (e.g. 192.0.2.1 or a assigned CIDR address
192.0.2.1/24.
Used testbench:
===============
20: br0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
inet 192.0.2.1/24 brd 192.0.2.255 scope global br0
inet 192.0.3.1/24 brd 192.0.3.255 scope global br0
inet6 2001:db8:2::ffff/64 scope global tentative
inet6 2001:db8:1::ffff/64 scope global tentative
is_intf_addr_assigned('br0', '192.0.2.1/24') -> True
is_intf_addr_assigned('br0', '192.0.2.1') -> True
is_intf_addr_assigned('br0', '2001:db8:2::ffff/64') -> True
is_intf_addr_assigned('br0', '2001:db8:2::ffff') -> True
is_intf_addr_assigned('br0', '192.0.100.1/24') -> False
is_intf_addr_assigned('br0', '192.0.100.1') -> False
is_intf_addr_assigned('br0', '2001:db8:100::ffff/64') -> False
is_intf_addr_assigned('br0', '2001:db8:100::ffff') -> False
|
|
interface
|
|
Previosly the check failed when a network statement was passed which contained
host bits set e.g. 192.0.2.1/24. This no longer is an issue b/c this is
a valid v4 address. Address is now split on / and validated.
|
|
The problem is that some IPv6 addresses reported by the system (mainly
link-local addresses) contain an interface suffix like %eth0, this was
not properly handeled in the validator script.
Remove any given interface attribute on passed IPv6 addresses. If no
interface suffix is added - there is no problem.
|
|
|
|
Verify given IPv4/IPv6 subnet is connected to any interface on this
system. Required by e.g. DHCP server that we have for IPv4 and IPv6.
|
|
* is_addr_assigned(addr) - Test if address is assigned to ANY interface
on the system
* is_ipv4(addr) - Test if it is an IPv4 address, both network and host
* is_ipv6(addr) - Test if it is an IPv6 address, both network and host
|