diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e347d0..9e6212d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,11 @@ All notable changes to this driver. The format follows 3.12 venv no longer has. ### Fixed +- The README describes `netgear_plus` too (#19). Its getter table now has a column per + driver: on Plus switches most getters return empty values without asking the switch, + and `cli`, `ping`, `get_route_to` and the configuration methods raise + `NotImplementedError`. Plus has its own tested model (GS308EP) and connection notes: + password-only login over HTTP, `optional_args` and the Netmiko options do not apply. - `get_arp_table()` on Smart switches reports the age as `-1.0` (unknown, napalm-device-types' `ARP_AGE_UNKNOWN`) instead of `0.0`, which means "confirmed just now". The "Age (min)" column of `show arp` is not parsed until real switch diff --git a/README.md b/README.md index 08bee39..8b6cbb2 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,26 @@ # napalm-netgear-switches -NAPALM community driver for **Netgear Smart Managed** and **Netgear Plus Managed** switches -(GS108EPP, GS110TP, GS316EPP and compatible Smart Managed Pro series). +NAPALM community drivers for two families of Netgear switches: + +| Driver | Switches | Transport | +|---|---|---| +| `netgear_smart` | Smart Managed Pro (GS110TP, GS108EPP, GS316EPP, …) | SSH CLI via Netmiko | +| `netgear_plus` | Plus / Smart Managed Plus (GS308EP, …) | the switch's web interface over HTTP, via [py-netgear-plus](https://pypi.org/project/py-netgear-plus/) | + +The two drivers share the package, not their abilities: `netgear_plus` reads far less than +`netgear_smart`, and changes nothing but PoE. The tables below say which driver does what. ## Tested devices -| Model | Series | Tested | -|---|---|---| -| GS110TP | Smart Managed Pro | ✅ | -| GS108EPP | Smart Managed Pro | ✅ | -| GS316EPP | Smart Managed Pro | ✅ | +| Model | Series | Driver | Tested | +|---|---|---|---| +| GS110TP | Smart Managed Pro | `netgear_smart` | ✅ | +| GS108EPP | Smart Managed Pro | `netgear_smart` | ✅ | +| GS316EPP | Smart Managed Pro | `netgear_smart` | ✅ | +| GS308EP | Plus | `netgear_plus` | ✅ | -> Other models from the Netgear Smart Managed Pro series should work as well — +> Other models from the Smart Managed Pro series should work with `netgear_smart`, and +> other Plus models that py-netgear-plus recognises with `netgear_plus` — > contributions welcome. ## Requirements @@ -22,6 +31,7 @@ NAPALM community driver for **Netgear Smart Managed** and **Netgear Plus Managed | NAPALM | 4.0 | | napalm-device-types | 4.21.1 | | Netmiko | 4.0 | +| py-netgear-plus (`netgear_plus`) | 0.6.4 | ## Installation @@ -53,41 +63,56 @@ with driver("192.168.0.239", "admin", "password") as device: ## Implemented getters -| Getter | Status | Notes | -|---|---|---| -| `get_facts` | ✅ | model, hostname, os_version, serial, uptime | -| `get_interfaces` | ✅ | status, speed, description, MTU | -| `get_interfaces_ip` | ✅ | management VLAN IP/mask | -| `get_config` | ✅ | running + startup | -| `get_arp_table` | ✅ | | -| `get_mac_address_table` | ✅ | | -| `get_lldp_neighbors` | ✅ | | -| `get_lldp_neighbors_detail` | ✅ | | -| `get_vlans` | ✅ | | -| `get_environment` | ✅ | CPU + memory only | -| `get_interfaces_counters` | ✅ | | -| `get_users` | ✅ | | -| `get_snmp_information` | ✅ | | -| `get_ntp_servers` | ✅ | | -| `get_ntp_peers` | ✅ | same as servers | -| `get_route_to` | ✅ | static/connected only | -| `ping` | ✅ | | -| `cli` | ✅ | | -| `is_alive` | ✅ | | -| `load_merge_candidate` | ✅ | | -| `load_replace_candidate` | ✅ | additive — no atomic replace | -| `compare_config` | ✅ | | -| `commit_config` | ✅ | | -| `discard_config` | ✅ | | -| `rollback` | ✅ | session-scoped backup | -| `get_bgp_neighbors` | ❌ | not applicable | -| `get_optics` | ❌ | DDM not exposed via CLI | -| `get_ipv6_neighbors_table` | ❌ | not exposed via CLI | -| `get_ntp_stats` | ❌ | not exposed via CLI | +✅ implemented · ⚪ always returns an empty value, the switch is not asked · +❌ raises `NotImplementedError` (or, for a driver without the method, it does not exist) -## Optional arguments +| Getter / method | `netgear_smart` | `netgear_plus` | Notes on `netgear_plus` | +|---|---|---|---| +| `get_facts` | ✅ | ✅ | model, hostname, os_version, serial; `uptime` is always `0.0` | +| `get_interfaces` | ✅ | ✅ | link, speed, port name; `is_enabled` always `True`, `mtu` always 1518, no MAC | +| `get_interfaces_ip` | ✅ | ⚪ | | +| `get_config` | ✅ | ⚪ | empty strings for running, startup and candidate | +| `get_arp_table` | ✅ | ⚪ | | +| `get_mac_address_table` | ✅ | ⚪ | | +| `get_lldp_neighbors` | ✅ | ⚪ | | +| `get_lldp_neighbors_detail` | ✅ | ⚪ | | +| `get_vlans` | ✅ | ✅ | 802.1Q VLANs from the web page `vlan.cgi`; keys are strings (`"1"`) | +| `get_vlans_detail` | ❌ | ✅ | tagged and untagged ports per VLAN | +| `get_environment` | ✅ | ✅ | Smart: CPU + memory only. Plus: PoE power status per PoE port only | +| `get_interfaces_counters` | ✅ | ✅ | rx/tx octets from the switch's cumulative totals, CRC errors as rx_errors; the rest `0` | +| `get_users` | ✅ | ⚪ | | +| `get_snmp_information` | ✅ | ⚪ | | +| `get_snmp_config` | ✅ | ⚪ | always `None`: SNMP is not read | +| `get_ntp_servers` | ✅ | ⚪ | | +| `get_ntp_peers` | ✅ | ⚪ | Smart: same as servers | +| `get_ntp_stats` | ⚪ | ⚪ | not exposed via the Smart CLI | +| `get_route_to` | ✅ | ❌ | Smart: static/connected only | +| `get_poe_status` | ✅ | ✅ | delivering or searching per PoE port, the model's power budgets; `enabled` always `True`, no power draw | +| `set_poe_enabled` | ❌ | ✅ | | +| `power_cycle_port` | ❌ | ✅ | | +| `get_firmware_offer` | ❌ | ✅ | GS305EP, GS305EPP, GS308EP, GS308EPP; see below | +| `ping` | ✅ | ❌ | Plus: `supports_ping()` is `False` | +| `traceroute` | ❌ | ❌ | | +| `cli` | ✅ | ❌ | Plus has no CLI | +| `is_alive` | ✅ | ✅ | Plus: whether `open()` logged in; the switch is not asked | +| `load_merge_candidate` | ✅ | ❌ | | +| `load_replace_candidate` | ✅ | ❌ | Smart: additive — no atomic replace | +| `compare_config` | ✅ | ❌ | | +| `commit_config` | ✅ | ❌ | | +| `discard_config` | ✅ | ❌ | | +| `rollback` | ✅ | ❌ | Smart: session-scoped backup | +| `get_bgp_neighbors` | ❌ | ❌ | not applicable | +| `get_optics` | ⚪ | ❌ | DDM not exposed via the Smart CLI | +| `get_ipv6_neighbors_table` | ⚪ | ❌ | not exposed via the Smart CLI | -| Argument | Default | Description | +`netgear_plus` also has `get_spanning_tree`, `get_port_channels`, `get_dot1x_ports` and +`get_mac_acl`; they always return an empty dict. + +## Connecting + +### `netgear_smart` (SSH) + +| Optional argument | Default | Description | |---|---|---| | `port` | `22` | SSH port | | `force_no_enable` | `False` | Skip `enable` after login | @@ -95,7 +120,7 @@ with driver("192.168.0.239", "admin", "password") as device: Any additional keyword arguments are forwarded to Netmiko. -## CLI notes +CLI notes: * Netmiko device type: `netgear_prosafe` * Prompt pattern: `(hostname) >` / `(hostname) #` / `(hostname) (Config)#` @@ -104,6 +129,20 @@ Any additional keyword arguments are forwarded to Netmiko. * Key-value output uses `Key: value` **or** `Key..... value` notation depending on firmware generation — both are handled automatically +### `netgear_plus` (HTTP) + +* The switch's web interface over plain HTTP, through py-netgear-plus, which detects + the model at login. The VLAN and port-name pages (`vlan.cgi`, `dashboard.cgi`) are + read directly. +* The login takes the password only: `username` is accepted and ignored. The password + is sent over plain HTTP. +* `optional_args` are ignored, and so is `timeout`; none of the Netmiko options above + applies. +* Interfaces are named `port1`, `port2`, … +* `get_firmware_offer` sends HTTPS `HEAD` requests to Netgear's download server + (`downloads.netgear.com`) to find the newest firmware for the model, at most once per + 24 hours per model and process. Other models get `None`. + ## Development The rules are in [STANDARDS.md](https://git.netork.io/NAPALM/driver-standard/src/branch/main/STANDARDS.md).