Returns True if there is at most one occurence of the ip_interface (an IPv4/IPv6 prefix+len) in the entire config. That said, we need the 'iface_addresses' because VPP is a bit fickle in this regard. IP addresses from the same prefix/len can be added to a given interface (ie 192.0.2.1/24 and 192.0.2.2/24), but other than that, any prefix can not occur as a more-specific or less-specific of any other interface. So, we will allow: - any ip_interface that is of equal network/len of existing one(s) _on the same interface_ And, we will reject - any ip_interface that is a more specific of any existing one - any ip_interface that is a less specific of any existing one Update unit tests to ensure ip_interfaces are allowed in all cases.
33 lines
808 B
YAML
33 lines
808 B
YAML
test:
|
|
description: "A bunch of IP addresses that are wellformed"
|
|
errors:
|
|
count: 0
|
|
---
|
|
interfaces:
|
|
GigabitEthernet1/0/0:
|
|
lcp: e0-0
|
|
addresses: [ 192.0.2.1/29, 2001:db8:1::1/64 ]
|
|
sub-interfaces:
|
|
100:
|
|
description: "Overlapping IP addresses are fine, if in the same prefix"
|
|
addresses: [ 192.0.2.9/29, 192.0.2.10/29 ]
|
|
101:
|
|
description: ".. and for IPv6 also, provided the same prefix is used"
|
|
addresses: [ 2001:db8:2::1/64, 2001:db8:2::2/64 ]
|
|
|
|
GigabitEthernet3/0/0:
|
|
mtu: 2000
|
|
|
|
loopbacks:
|
|
loop0:
|
|
lcp: "loop0"
|
|
addresses: [ 10.0.0.1/32, 2001:db8::1/128 ]
|
|
|
|
bridgedomains:
|
|
bd10:
|
|
description: "Bridge Domain 10"
|
|
mtu: 2000
|
|
lcp: "bvi10"
|
|
addresses: [ 10.0.0.2/32, 2001:db8::2/128 ]
|
|
interfaces: [ GigabitEthernet3/0/0 ]
|