-
Notifications
You must be signed in to change notification settings - Fork 108
Add Arrcus ArcOS as a containerlab device (best-effort) #3681
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -56,6 +56,19 @@ nodes: | |
| * Arista EOS virtual machines and containers use [proprietary control-plane messages to indicate the loss of Ethernet line protocol](https://blog.ipspace.net/2025/03/arista-spooky-action-distance/). Set the **netlab_phy_control** node variable to *False* to disable this functionality. | ||
| * Device configurations that contain `no lldp transmit` or `no lldp receive` configuration command trigger configuration reload failures due to an Arista EOS bug ([more details](https://github.com/ipspace/netlab/issues/2577)). These commands are thus automatically removed from collected device configurations. | ||
|
|
||
| (caveats-arcos)= | ||
| ## Arrcus ArcOS | ||
|
|
||
| * ArcOS ships a commercial NOS image; there is no public Vagrant/Containerlab box. ArcOS runs as a **native** containerlab node (`kind: arrcus_arcos`) -- no vrnetlab packaging. Provide your own container image and tag it as in `netsim/devices/arcos.yml` (`clab.image`), or override `clab.image` in your topology. | ||
| * The tested container image boots with **SSH, NETCONF, and gNMI all disabled** (its baked-in startup config fails to load a built-in prefix-set). *netlab* bootstraps the node with the native `netlab_start_exec` group_var (containerlab's post-start `exec:`), which enables `ssh-server`, changes the factory-default admin-user password (ArcOS refuses to enable interfaces until this is done), and creates an AAA user. No custom deploy code and no SSH is used to run it. | ||
| * Configuration is deployed with netlab's native containerlab **"sh" config mode**: each module is rendered into `/config/netlab/NN-<module>.sh` and executed via `docker exec`, loading config through `confd_cli` (`load merge` / `commit`) via the mapped wrapper `netsim/templates/provider/clab/arcos/netlab-config.j2` -- the same mapped-script pattern Juniper cRPD uses, with no Ansible in the deploy path. Validation/collect use `ansible_connection: docker` (`docker exec` running `confd_cli`). ArcOS ships the official `arrcus.arcos` `network_cli` collection (the project-recommended model), but every published version (2.0.13-2.0.18) hangs against this image: its cliconf/terminal plugins issue a `config terminal` / `arcos_cli` mode-switch that this build's `confd_cli` rejects, so it is not used. | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I try to keep caveats short. They should explain how things work or what doesn't, but don't have to go into all the underlying details. For example, would keep this one short saying "configuration is deployed with bash script executed within the ArcOS container" or some such, maybe adding "there is no dependency on Ansible, as the arrcus.arcos network_cli plugin does not work with the ArcOS release xxx" as a separate bullet. However, hese detailed implementation/testing notes are really valuable, so it would be a shame to just shorten/remove them. Move them to a new section at the end of "labs/arcos.md", maybe "Implementation and Testing Notes". |
||
| * `netlab validate` reads ArcOS state over the **same** docker-exec path, running `show <path> | display json | confd_cli` and parsing the OpenConfig JSON (`netsim/validate/**/arcos.py`). This uses netlab's standard device-side show-command validation -- **no** `ansible` validation action, and no SSH/NETCONF/gNMI. | ||
| * **MTU:** the `interface <if> mtu <n>` leaf is not a pass-through -- ArcOS programs the real kernel netdev MTU (and the value it advertises in OSPF DBD packets) to `<n> - 26` on every commit. `netsim/ansible/templates/initial/arcos.j2` therefore sets the leaf to `l.mtu + 26` so ArcOS lands on netlab's intended MTU; this alone makes an ArcOS<->FRR OSPF adjacency converge, with no containerlab/core change. | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would just say that initial device configuration sets ArcOS to lab topology layer-3 MTU (interface.mtu) + 26. |
||
| * **Static routing validation** reads the committed route from the running-config JSON rather than an operational RIB: this virtual image does not populate an OpenConfig STATIC operational-state/RIB tree. A present, complete static-route entry proves netlab rendered it and the device accepted and committed it; kernel FIB install and forwarding were verified separately. | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wouldn't go into so many details. I would just say something along the lines of "netlab configures static routes and they are used for traffic forwarding, but the tested ArcOS image does not report them in OpenConfig RIB tree" |
||
| * Several modules **render and commit** but their datapath is **not exercised** by the container image: SR-MPLS, MPLS/LDP, and SRv6 bring up the control plane only (the native container has no kernel MPLS platform-labels); DHCP relay renders but its relay datapath needs a real DHCP-server probe, so ArcOS is intentionally omitted from the [DHCP support table](platform-services-support). | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just say "while netlab configures SR-MPLS, MPLS/LDP, and SRv6, the dataplane does not work in the container image" or some such. You could also disable these features and describe how to enable them in |
||
| * **Genuinely unsupported**, not merely untested (and therefore not declared in `features`): EVPN symmetric IRB / L3VNI (a route-type-5 IP-prefix route is never originated -- only the L2VNI / distributed-anycast-gateway form is declared); VRF route-target import/export leaking (no rd/RT/L3VPN model on this image); OSPFv2 area-interface authentication; routing-policy large/extended-community set-actions (ArcOS has only an inline standard-community set action); redistribution sources other than static; and the `bgp.session` and other dotted plugins. | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would skip this. Things don't work (for whatever reason), they are not implemented, they are not enabled in features, so you can't use them. Let's move on. This is nothing special; many devices are like this. |
||
| * VLANs use the native switched-VLAN model (`vlan <id>` + `interface … ethernet switched-vlan`), with SVIs named `vlan<id>`. Per-VRF routing-protocol instances are tagged with the VRF name because a protocol instance tag is a global namespace across every network-instance on this build. | ||
|
|
||
| (caveats-aruba)= | ||
| ## Aruba AOS-CX | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| # Installing Arrcus ArcOS | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file should be in docs/labs. The "docs/install" directory is for netlab installation, the "docs/labs" directory is for providers and devices.
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, add "(build-arcos)=" or "(labs-arcos)=" anchor so you don't have to hyperlink to a file name. |
||
|
|
||
| netlab runs **Arrcus ArcOS** as a [containerlab](clab.md)-provisioned device. ArcOS is a | ||
| **native** containerlab kind (`arrcus_arcos`) -- no vrnetlab packaging -- and only the **clab** | ||
| provider is supported (no Vagrant box). | ||
|
|
||
| ## Container image | ||
|
|
||
| ArcOS is a commercial NOS; there is no public image. Obtain an ArcOS container image and tag it as | ||
| the device expects (or point `clab.image` at your own tag): | ||
|
|
||
| ``` | ||
| defaults.devices.arcos.clab.image: arcos:8.2.1A.P2 | ||
| ``` | ||
|
|
||
| The device sets clab `kind: arrcus_arcos`. Verified against the **8.2.1A.P2** container image. | ||
|
|
||
| ## First-boot bootstrap | ||
|
|
||
| The tested image boots with SSH, NETCONF, and gNMI disabled, and ArcOS refuses to enable | ||
| interfaces until the factory-default admin-user password is changed. netlab handles both | ||
| automatically with the native `netlab_start_exec` group variable (containerlab's post-start | ||
| `exec:`): it enables `ssh-server`, sets the admin-user password, and creates an AAA user before any | ||
| configuration is deployed. No manual steps are required. | ||
|
|
||
| ## Configuration deployment | ||
|
|
||
| ArcOS uses netlab's native containerlab **"sh" config mode** | ||
| ([Linux configuration scripts](../dev/config/deploy.md)): each configuration module is rendered into | ||
| `/config/netlab/NN-<module>.sh` with a `#!/config/netlab/netlab-config.sh` shebang and deployed with | ||
| `docker exec`, which hands the rendered config to the mapped wrapper | ||
| `netsim/templates/provider/clab/arcos/netlab-config.j2` to load through `confd_cli` | ||
| (`load merge` / `commit`). No Ansible is used to deploy configuration -- this is the same | ||
| mapped-script pattern Juniper cRPD uses. `ansible_connection: docker` is retained only for the | ||
| validation/collect path. | ||
|
|
||
| ArcOS also ships the official `arrcus.arcos` `network_cli` collection (the project-recommended | ||
| interactive model), but every published version hangs against this image; see the | ||
| [ArcOS caveats](caveats-arcos). No extra Ansible collection is required. | ||
|
|
||
| ## Supported configuration modules | ||
|
|
||
| `initial`, `ospf` (v2/v3), `bgp`, `isis`, `vrf` (+ospf/isis/bgp), `vlan`, `lag`, `gateway` (VRRP), | ||
| `dhcp`/relay, `bfd`, `routing` (static/prefix-set/policy), `mpls` (LDP), `sr` (SR-MPLS via IS-IS), | ||
| `srv6`, `vxlan`, and `evpn` (L2VNI). See `netsim/devices/arcos.yml` `features:` for the | ||
| authoritative list; support level is **best-effort** (see [caveats](caveats-arcos)). | ||
|
|
||
| ## Validation | ||
|
|
||
| `netlab validate` reads ArcOS device state over the same docker-exec path used to deploy config | ||
| (`show <path> | display json | confd_cli`, parsed as OpenConfig JSON by | ||
| `netsim/validate/**/arcos.py`) -- netlab's standard device-side show-command validation, with no | ||
| SSH/NETCONF/gNMI and no `ansible` validation action. ArcOS is exercised with netlab's regular | ||
| [integration tests](../dev/integration-tests.md). | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,6 +15,7 @@ | |
| | Virtual network device | netlab device type | support level | | ||
| | -----------------------| ------------------ | ------------- | | ||
| | Arista vEOS/cEOS [❗](caveats-eos) | eos | full | | ||
| | Arrcus ArcOS [❗](caveats-arcos) | arcos | best effort | | ||
| | Aruba AOS-CX [❗](caveats-aruba) | arubacx | full | | ||
| | Cisco 8000v [❗](caveats-cisco8000v) | cisco8000v | minimal | | ||
| | Cisco ASAv [❗](caveats-asav) | asav | minimal | | ||
|
|
@@ -112,6 +113,7 @@ You cannot use all supported network devices with all virtualization providers. | |
| | Virtual network device | Vagrant<br />[Libvirt](labs/libvirt.md) | [Containerlab](labs/clab.md) | | ||
| | ------------------ | :-: | :-: | | ||
| | Arista vEOS | [✅](build-eos) | [✅](build-ceos) | | ||
| | Arrcus ArcOS | ❌ | ✅ | | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add a link to the anchor at the top of labs/arcos.md |
||
| | Aruba AOS-CX | [✅](build-arubacx) | ✅[❗](clab-vrnetlab) | | ||
| | Cisco 8000v | ❌ | ✅ | | ||
| | Cisco ASAv | [✅](build-asav) | ✅ [❗](clab-vrnetlab) | | ||
|
|
@@ -191,6 +193,7 @@ Ansible playbooks included with **netlab** can deploy and collect device configu | |
| | Operating system | Deploy<br>configuration | Collect<br> configuration | Configurable<br>save to startup | | ||
| | --------------------- |:--:|:--:|:--:| | ||
| | Arista EOS | ✅ | ✅ | | ||
| | Arrcus ArcOS [❗](caveats-arcos) | ✅ | ✅ | | ||
| | Aruba AOS-CX | ✅ | ✅ | | ||
| | Cisco ASAv | ✅ | ✅ | | ||
| | Cisco IOS/IOS XE[^18v]| ✅ [❗](cisco-ios-ssh) | ✅ | | ||
|
|
@@ -276,6 +279,7 @@ The following system-wide features are configured on supported network operating | |
| | Operating system | Hostname | IPv4/IPv6<br>hosts | LLDP | IPv4<br>Loopback | IPv6<br>Loopback | | ||
| | --------------------- | :------: | :--------: | :-----------------------: | :------------------------: | :------------------------: | | ||
| | Arista EOS | ✅ | ✅ | ✅ | ✅ | ✅ | | ||
| | Arrcus ArcOS | ✅ | ❌ | ❌ | ✅ | ✅ | | ||
| | Aruba AOS-CX | ✅ | ❌ | ✅ | ✅ | ✅ | | ||
| | Cisco ASAv | ✅ | ✅ | ❌ | ❌ | ❌ | | ||
| | Cisco IOS/IOS XE[^18v] | ✅ | ✅ | ✅ | ✅ | ✅ | | ||
|
|
@@ -307,6 +311,7 @@ The following interface parameters are configured on supported network operating | |
| | Operating system | Interface<br />description | Interface<br />bandwidth | MTU | Additional<br />loopbacks | ||
| | --------------------- |:---:|:---:|:---:|:---:| | ||
| | Arista EOS | ✅ | ✅ | ✅ | ✅ | | ||
| | Arrcus ArcOS | ❌ | ❌ | ✅ | ✅ | | ||
| | Aruba AOS-CX | ✅ | ❌ | ✅ | ✅ | | ||
| | Cisco ASAv | ✅ | ❌ | ✅ | ❌ | | ||
| | Cisco IOSv/IOSvL2 | ✅ | ✅ | ✅ | ✅ | | ||
|
|
@@ -336,6 +341,7 @@ The following interface addresses are supported on various platforms; most daemo | |
| | Operating system | IPv4<br />addresses | IPv6<br />addresses | Unnumbered<br />IPv4 interfaces | Configurable<br>IPv6 RA | | ||
| | --------------------- | :-: | :-: | :-: | :-: | | ||
| | Arista EOS | ✅ | ✅ | ✅ | ✅ | | ||
| | Arrcus ArcOS | ✅ | ✅ | ❌ | ❌ | | ||
| | Aruba AOS-CX | ✅ | ✅ | ✅ | ❌ | | ||
| | Cisco ASAv | ✅ | ✅ | ❌ | ❌ | | ||
| | Cisco IOSv/IOSvL2 | ✅ | ✅ | ❌ | ✅ | | ||
|
|
@@ -385,6 +391,7 @@ Routing protocol [configuration modules](module-reference.md) are supported on t | |
| | Operating system | [OSPF](module/ospf.md) | [IS-IS](module/isis.md) | [EIGRP](module/eigrp.md) | [BGP](module/bgp.md) | [RIPv2/ng](module/ripv2.md) | ||
| | --------------------- | :--: | :--: | :--: | :--: | :--: | | ||
| | Arista EOS | ✅ | ✅ | ❌ | ✅ | ✅ | | ||
| | Arrcus ArcOS [❗](caveats-arcos) | ✅ | ✅ | ❌ | ✅ | ❌ | | ||
| | Aruba AOS-CX | ✅ | ❌ | ❌ | ✅ | ❌ | | ||
| | BIRD Internet Routing Daemon | ✅ [❗](caveats-bird) | ❌ | ❌ | ✅ [❗](caveats-bird) | ❌ | | ||
| | Cisco ASAv | ✅ [❗](caveats-asav) | ✅ [❗](caveats-asav) | ❌ | ✅ | ❌ | | ||
|
|
@@ -411,6 +418,7 @@ These devices support additional control-plane protocols or BGP address families | |
| | Operating system | [BFD](module/bfd.md) | [EVPN](module/evpn.md) | [MPLS/VPN](module/mpls.md) | [FHRP](module/gateway.md) | | ||
| | --------------------- | :-: | :-: | :-: | :-: | | ||
| | Arista EOS | ✅ | ✅ | ✅ | ✅ | | ||
| | Arrcus ArcOS [❗](caveats-arcos) | ✅ | ✅ | ✅ | ✅ | | ||
| | Aruba AOS-CX | ✅ | ✅ | ✅ | ✅ | | ||
| | BIRD | ❌ | ✅ | ❌ | ✅ | | ||
| | Cisco IOS XE[^XE] | ✅ | ✅ | ✅ | ✅ | | ||
|
|
@@ -442,6 +450,7 @@ The layer-2 control plane [configuration modules](module-reference.md) are suppo | |
| | Operating system | [Spanning<br>Tree Protocol](module/stp.md) | [Link Aggregation<br>Groups](module/lag.md) | | ||
| | ------------------------- |:--:|:--:| | ||
| | Arista EOS | ✅ | ✅ | | ||
| | Arrcus ArcOS [❗](caveats-arcos) | ❌ | ✅ | | ||
| | Aruba CX | ✅ | ✅ | | ||
| | BIRD | ❌ | ✅ | | ||
| | Cumulus Linux | ✅ | ✅ | | ||
|
|
@@ -457,6 +466,7 @@ The data plane [configuration modules](module-reference.md) are supported on the | |
| | Operating system | [VLAN](module/vlan.md) | [VRF](module/vrf.md) | [VXLAN](module/vxlan.md) | [MPLS](module/mpls.md) | [SR-MPLS](module/sr-mpls.md) | [SRv6](module/srv6.md) | | ||
| | --------------------- |:--:|:--:|:--:|:--:|:--:|:--:| | ||
| | Arista EOS | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | | ||
| | Arrcus ArcOS [❗](caveats-arcos) | ✅ | ✅ | ✅ | ✅[❗](caveats-arcos) | ✅[❗](caveats-arcos) | ✅[❗](caveats-arcos) | | ||
| | Aruba AOS-CX | ✅ | ✅ | ✅[❗](caveats-aruba) | [❗](caveats-aruba) | ❌ | ❌ | | ||
| | BIRD | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | | ||
| | Cisco 8000v (IOS XR) | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | | ||
|
|
@@ -506,6 +516,7 @@ Core *netlab* functionality and all multi-protocol routing protocol configuratio | |
| | Operating system | OSPFv3 | IS-IS MT | EIGRP<br />IPv6 AF | BGP<br />IPv6 AF | SR-MPLS | | ||
| | --------------------- |:--:|:--:|:--:|:--:|:--:| | ||
| | Arista EOS | ✅ | ✅ | ❌ | ✅ | ✅ | | ||
| | Arrcus ArcOS | ✅ | ✅ | ❌ | ✅ | ❌ | | ||
| | Aruba AOS-CX | ✅ | ❌ | ❌ | ✅ | ❌ | | ||
| | BIRD | ✅ | ❌ | ❌ | ✅ | ❌ | | ||
| | Cisco ASAv | ❌ | ✅ | ❌ | ✅ | ❌ | | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,6 +14,7 @@ | |
| * The [**WireGuard tunnel** plugin](plugin-tunnel-wireguard) supports WireGuard tunnels on FRR. | ||
| * The [**bgp.session** plugin](plugin-bgp-session) and the [OSPF module](module-ospf) support graceful restart on Arista EOS, BIRD, FortiOS, and FRR | ||
| * The [**bgp.policy** plugin](plugin-bgp-policy) supports the **bgp.role** attribute on FRR and BIRD. | ||
| * [Arrcus ArcOS](https://arrcus.com/) is now supported (best-effort) as a native containerlab node, with configuration deployment and validation over a `docker exec` + `confd_cli` path. | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be in 26.08. 26.07 is already out. |
||
|
|
||
| **Minor changes and improvements** | ||
|
|
||
|
|
||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,16 @@ | ||
| --- | ||
| - name: save config | ||
| shell: echo 'show run' | confd_cli | ||
| # Fetch the ArcOS running-config over ansible_connection: docker. The tested container build has | ||
| # SSH/NETCONF/gNMI disabled, so confd_cli over docker exec is the only reachable CLI (config | ||
| # DEPLOY uses netlab's native sh-mode wrapper -- see netsim/devices/arcos.yml; this collect path | ||
| # stays on the docker connection, the same pattern netsim/devices/frr.yml + cRPD keep). | ||
| - name: "confd_cli: show running-config" | ||
| # confd_cli has no "-c <command>" one-shot flag (-c is --cwd, not "run this command"), so the | ||
| # command is fed non-interactively over stdin instead. | ||
| shell: printf 'show running-config\n' | confd_cli -C -u admin | ||
| args: | ||
| executable: /bin/bash | ||
| register: arcos_run_config | ||
| changed_when: false | ||
|
|
||
| - set_fact: | ||
| ansible_net_config: "{{ arcos_run_config.stdout }}" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| {# | ||
| ArcOS BFD template. Global `bfd profile <NAME>` with enable + timers; protocols reference the | ||
| profile (OSPF area-interface `bfd enabled true` is rendered by the ospf template). The GLOBAL | ||
| profile is the implicit default and "must have been explicitly configured" -- so we always | ||
| create it. | ||
| #} | ||
| bfd profile GLOBAL | ||
| enable | ||
| required-minimum-receive {{ bfd.min_rx|default(500) }} | ||
| desired-minimum-tx-interval {{ bfd.min_tx|default(500) }} | ||
| detection-multiplier {{ bfd.multiplier|default(3) }} | ||
| exit | ||
| ! |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| {# | ||
| ArcOS BGP. eBGP session reaches ESTABLISHED; allow ~60-90s to converge (ArcOS's connect-retry | ||
| timer). Dual-stack peers get TWO separate BGP sessions (one keyed on the IPv4 transport | ||
| address, one on IPv6) rather than one session carrying both AFs. | ||
|
|
||
| iBGP-over-loopback: without an explicit `neighbor X transport local-address <loopback>`, an | ||
| iBGP session addressed at the peer's loopback stays IDLE forever -- ArcOS does not auto-source | ||
| from the interface with the best route to the peer. | ||
|
|
||
| The bgp.session plugin (per-neighbor password/gtsm/timers/passive/bfd) is a separate template | ||
| and is not yet supported. | ||
| #} | ||
| network-instance default protocol BGP b1 | ||
| global as {{ bgp.as }} | ||
| global router-id {{ bgp.router_id }} | ||
| global afi-safi IPV4_UNICAST | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You might want to use "if bgp.ipv4 is defined" as well. |
||
| {% if bgp.ipv6|default(false) %} | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: Nothing wrong with this, but it would be easier to use "if bgp.ipv6 is defined". It is never set to False. |
||
| global afi-safi IPV6_UNICAST | ||
| {% endif %} | ||
| {% for a in bgp.advertise|default([]) %} | ||
| {% if a.ipv4 is defined %} | ||
| global afi-safi IPV4_UNICAST network {{ a.ipv4 }} | ||
| {% endif %} | ||
| {% if a.ipv6 is defined %} | ||
| global afi-safi IPV6_UNICAST network {{ a.ipv6 }} | ||
| {% endif %} | ||
| {% endfor %} | ||
| {% for n in bgp.neighbors|default([]) %} | ||
| {% if n.ipv4 is defined %} | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hint: Instead of repeating the same code snippet (which can lead to nasty problems once you start adding functionality), you could just add an inner loop iterating of "ipv4","ipv6" and have a local dictionary (or even device group variable) to map AF into afi-safi instance name (or use something like |
||
| neighbor {{ n.ipv4 }} peer-as {{ n.as }} | ||
| {% if n.local_as is defined %} | ||
| neighbor {{ n.ipv4 }} ebgp-local-as local-as {{ n.local_as }} | ||
| {% endif %} | ||
| {% if n.type|default("") == "ibgp" and n._source_intf is defined and n._source_intf.ipv4 is defined %} | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nits: A) _source_intf is defined only when needed (IBGP or multihop EBGP), so there's no need to check BGP neighbor type. |
||
| neighbor {{ n.ipv4 }} transport local-address {{ n._source_intf.ipv4 | ansible.utils.ipaddr('address') }} | ||
| {% endif %} | ||
| neighbor {{ n.ipv4 }} afi-safi IPV4_UNICAST | ||
| {% endif %} | ||
| {% if n.ipv6 is defined %} | ||
| neighbor {{ n.ipv6 }} peer-as {{ n.as }} | ||
| {% if n.local_as is defined %} | ||
| neighbor {{ n.ipv6 }} ebgp-local-as local-as {{ n.local_as }} | ||
| {% endif %} | ||
| {% if n.type|default("") == "ibgp" and n._source_intf is defined and n._source_intf.ipv6 is defined %} | ||
| neighbor {{ n.ipv6 }} transport local-address {{ n._source_intf.ipv6 | ansible.utils.ipaddr('address') }} | ||
| {% endif %} | ||
| neighbor {{ n.ipv6 }} afi-safi IPV6_UNICAST | ||
| {% endif %} | ||
| {% endfor %} | ||
|
|
||
| {# Redistribution into BGP via OpenConfig table-connections (bgp.import): | ||
| STATIC->BGP with src-dst-instance <static-inst> <bgp-inst> + import-policy. Static protocol | ||
| instance is "default" (routing template), BGP instance is "b1". connected/ospf/isis import | ||
| are not exercised here -> feature declares import: [ static ] only. #} | ||
| {% for proto, imp in bgp.import|default({})|dictsort %} | ||
| {% if proto == 'static' %} | ||
| network-instance default table-connection STATIC BGP IPV4 src-dst-instance default b1{% if imp is mapping and imp.policy is defined %} import-policy [ {{ imp.policy }}-ipv4 ]{% else %} default-import-policy ACCEPT_ROUTE{% endif %} | ||
|
|
||
| ! | ||
| {% endif %} | ||
| {% endfor %} | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would just point to the labs/arcos.md document instead of repeating the points already made there.