Closed sdargoeuves closed 1 week ago
The solution is hiding somewhere in here (
netlab/netsim/ansible/templates/initial/iosxr.j2
between line 8 and 16)
That's absolutely correct and it's relatively easy to fix (we just have to check whether the address is a string, not whether it's defined), but I'd love to know how we got there. Could you please post a topology that triggers this error (as cleaned up as possible ;)
{% for af in ['ipv4','ipv6'] %} {% for k,v in hostvars.items() if k != inventory_hostname and v.af[af]|default(False) %} {% if v.loopback[af] is defined %} domain {{ af }} host {{ k }} {{ v.loopback[af]|ipaddr('address') }} {% elif v.interfaces|default([]) and v.interfaces[0][af] is defined %}
This should be fixed (changing is defined
into |default(False) is string
), but as the device in question is probably a switch, it should have a loopback :(
I've updated the topology, in the original message. I am now looking at the output of v.interfaces
and indeed, the ipv6 is a bool
and not the value:
[
{
"clab": {
"name": "et1"
},
"ifindex": 1,
"ifname": "Ethernet1",
"ipv4": "10.1.0.1/30",
"ipv6": true,
"linkindex": 1,
"name": "gw2 -> gw3",
"neighbors": [
{
"ifname": "Ethernet1",
"ipv4": "10.1.0.2/30",
"ipv6": true,
"node": "gw3"
}
],
"ospf": {
"area": "0.0.0.0",
"network_type": "point-to-point",
"passive": false
},
"type": "p2p"
},
{
"clab": {
"name": "et2"
},
"ifindex": 2,
"ifname": "Ethernet2",
"ipv4": "10.1.0.6/30",
"linkindex": 2,
"name": "gw2 -> gw1",
"neighbors": [
{
"ifname": "GigabitEthernet0/0/0/0",
"ipv4": "10.1.0.5/30",
"node": "gw1"
}
],
"ospf": {
"area": "0.0.0.0",
"network_type": "point-to-point",
"passive": false
},
"type": "p2p"
}
]
Ah, you set 'ipv6' to True without having IPv6 on the loopback. Fixing...
Ah, you set 'ipv6' to True without having IPv6 on the loopback. Fixing...
thank you!! And it's a good point, I didn't think about this... I reused a topology where we had some ipv6, and indeed no loopback are set to ipv6.
Describe the bug
I have an issue with the initialisation of my IOSXR devices, due to some
ipv6
when configuring thedomain ipv6 host <host> False
The j2 fails to find the ipv6 address of theTo Reproduce
You will need to have ipv6 configured on some devices in your lab, and one iosxr device
Expected behavior
The
initial
configuration should completeLab topology
Output
Version
Additional context
Output of the
netlab initial -l <iosxr-device> -vvvv
The solution is hiding somewhere in here (
netlab/netsim/ansible/templates/initial/iosxr.j2
between line 8 and 16)