feat: report the firewall's CARP addresses as virtual IPs #17

Merged
christianmanivong merged 2 commits from feat/carp-virtual-ips into master 2026-10-16 09:21:22 +00:00
Owner

get_virtual_ips() for OPNsense (NetOrk/netork#1121).

  • Source: /api/interfaces/overview/export, which get_interfaces_ip already reads. Every address bound to a CARP VHID counts: the CARP address and IP aliases on its VHID alike. Each comes with this node's CARP state, so the reading says who holds it (MASTER).
  • interfaces/vip_settings/search_item is not read: it returns each VHID's CARP password in plain text.
  • vip_manager/keepalived are None (Linux mechanisms). The meaning of the states is napalm_device_types.carp_virtual_ip, so this needs napalm-device-types 4.10.0 (NAPALM/napalm-device-types#38, merged).

Checked read-only against gw-01/gw-02: 21 entries each, gw-01 all MASTER, gw-02 all BACKUP, no password in the reading.

Tests: tests/unit/test_virtual_ips.py with a cut-down overview fixture. Suite 348 passed.

`get_virtual_ips()` for OPNsense (NetOrk/netork#1121). - Source: `/api/interfaces/overview/export`, which `get_interfaces_ip` already reads. Every address bound to a CARP VHID counts: the CARP address and IP aliases on its VHID alike. Each comes with this node's CARP state, so the reading says who holds it (MASTER). - `interfaces/vip_settings/search_item` is **not** read: it returns each VHID's CARP password in plain text. - `vip_manager`/`keepalived` are None (Linux mechanisms). The meaning of the states is `napalm_device_types.carp_virtual_ip`, so this needs napalm-device-types 4.10.0 (NAPALM/napalm-device-types#38, merged). Checked read-only against gw-01/gw-02: 21 entries each, gw-01 all MASTER, gw-02 all BACKUP, no password in the reading. Tests: `tests/unit/test_virtual_ips.py` with a cut-down overview fixture. Suite 348 passed.
christianmanivong added 1 commit 2026-10-16 09:10:44 +00:00
feat: report the firewall's CARP addresses as virtual IPs
CI / test (3.10) (push) Successful in 30s
CI / test (3.11) (push) Successful in 29s
CI / test (3.12) (push) Successful in 30s
CI / test (3.10) (pull_request) Successful in 29s
CI / test (3.11) (pull_request) Successful in 28s
CI / test (3.12) (pull_request) Successful in 30s
00172f7a69
get_virtual_ips() reads every address bound to a CARP VHID -- the CARP
address and IP aliases on its VHID alike -- from
/api/interfaces/overview/export, with this node's CARP state, so the reading
says who holds each address. interfaces/vip_settings would list the same
addresses with each VHID's CARP password; it is not read.

vip_manager and keepalived are Linux mechanisms and are None here. Needs
napalm-device-types 4.10.0 (carp_virtual_ip).

netOrk #1121.
christianmanivong added 1 commit 2026-10-16 09:11:45 +00:00
refactor: the CARP state table lives with the driver that speaks CARP
CI / test (3.10) (push) Failing after 15s
CI / test (3.11) (push) Failing after 15s
CI / test (3.12) (push) Successful in 30s
CI / test (3.10) (pull_request) Successful in 30s
CI / test (3.11) (pull_request) Successful in 28s
CI / test (3.12) (pull_request) Successful in 29s
c868d41322
carp_virtual_ip() and its state table moved here from napalm-device-types
(4.10.1, NAPALM/napalm-device-types#39): under the agreed structure the base
package carries only the shape of the reading, and what a CARP state means is
protocol knowledge. Tests moved along (test_carp_states.py).
christianmanivong merged commit 2af99995e9 into master 2026-10-16 09:21:22 +00:00
christianmanivong deleted branch feat/carp-virtual-ips 2026-10-16 09:21:22 +00:00
Sign in to join this conversation.