i am working on some scripts to automate this
- **Auto-detection**: Automatically finds the primary network interface
- Works with any kernel version (no need to downgrade) |
- **Bridge support**: Special handling for Proxmox bridge interfaces (vmbr0, etc.) |
- **Physical interface restart**: For bridges, also restarts underlying physical interfaces |
- **Hardware hang detection**: Detects and handles Intel e1000e controller hangs from kernel logs |
- **Hardware-level reset**: Module reload and PCI reset for hardware hangs (e1000e, etc.) |
- **Driver-aware resets**: Different reset strategies based on network controller driver |
- **Connectivity checking**: Tests network before and after restart with multiple targets |
- **Retry logic**: Attempts multiple times if first try fails |
- **DHCP renewal**: Automatically attempts DHCP lease renewal |
- **Extended diagnostics**: Comprehensive logging and troubleshooting information |
- **Logging**: Comprehensive logging to `/var/log/network-fix.log` |
- **Safe operation**: Checks for root privileges and interface existence |
- **Interactive mode**: Prompts before restarting if network appears working
ethtool approach as a fallback option if module reload doesn't work |
**Command output of a successful test**
```
root@proxmox:~/Network_Tools# ./fix-network.sh
=== Proxmox Network Interface Restart Script ===
[2025-07-12 23:04:13] [INFO] Script started
Using network interface: vmbr0
[2025-07-12 23:04:13] [INFO] Using network interface: vmbr0
Checking current network connectivity...
Network appears to be working. Are you sure you want to restart the interface? (y/N)
y
Attempt 1/3 to restart network interface...
[2025-07-12 23:04:16] [INFO] Attempting to restart interface: vmbr0
[2025-07-12 23:04:16] [INFO] Interface vmbr0 is a bridge with members: eno2 fwpr100p0 fwpr102p0 fwpr103p0 fwpr104p0 fwpr105p0 fwpr106p0 fwpr108p0 fwpr109p0 fwpr110p0 fwpr113p0 fwpr117p0 fwpr119p0
Detected bridge interface vmbr0 with members: eno2 fwpr100p0 fwpr102p0 fwpr103p0 fwpr104p0 fwpr105p0 fwpr106p0 fwpr108p0 fwpr109p0 fwpr110p0 fwpr113p0 fwpr117p0 fwpr119p0
Restarting bridge member: eno2
[2025-07-12 23:04:16] [INFO] Restarting physical bridge member: eno2
[2025-07-12 23:04:16] [INFO] Bridge member eno2 uses driver: e1000e
Intel e1000e controller detected for bridge member eno2, using proactive hardware reset
[2025-07-12 23:04:16] [INFO] Intel e1000e controller detected for bridge member eno2, applying proactive hardware reset
[2025-07-12 23:04:16] [INFO] Attempting hardware-level reset for eno2 (driver: e1000e)
Performing hardware reset for eno2...
Step 1: Attempting ethtool reset...
[2025-07-12 23:04:16] [INFO] Attempting ethtool reset for eno2
[2025-07-12 23:04:16] [INFO] ethtool reset successful for eno2
Actual changes:
tx-checksum-ipv4: off [requested on]
tx-checksum-ip-generic: on
tx-checksum-ipv6: off [requested on]
tx-checksum-fcoe-crc: off [requested on]
tx-checksum-sctp: off [requested on]
rx-checksum: on
Step 2: Detected Intel e1000e controller, attempting module reload...
[2025-07-12 23:04:21] [INFO] Attempting e1000e module reload for hardware hang recovery
[2025-07-12 23:04:21] [INFO] Interface eno2 PCI address: 0000:00:1f.6
Removing e1000e module...
[2025-07-12 23:04:23] [INFO] e1000e module removed successfully
Reloading e1000e module...
[2025-07-12 23:04:26] [INFO] e1000e module reload completed successfully
Step 3: Applying Proxmox community workaround...
Applying Proxmox forum workaround: disabling problematic features...
[2025-07-12 23:04:31] [INFO] Disabling problematic ethtool features for eno2 (Proxmox forum workaround)
[2025-07-12 23:04:31] [INFO] Disabled gso for eno2
[2025-07-12 23:04:31] [INFO] Disabled gro for eno2
[2025-07-12 23:04:31] [INFO] Disabled tso for eno2
[2025-07-12 23:04:31] [INFO] Disabled tx for eno2
[2025-07-12 23:04:31] [INFO] Disabled rx for eno2
Actual changes:
tx-vlan-hw-insert: off [not requested]
rx-vlan-hw-parse: off
[2025-07-12 23:04:31] [INFO] Disabled rxvlan for eno2
[2025-07-12 23:04:31] [INFO] Disabled txvlan for eno2
[2025-07-12 23:04:31] [INFO] Disabled sg for eno2
[2025-07-12 23:04:31] [INFO] Current features for eno2:
Creating persistent configuration for eno2...
[2025-07-12 23:04:31] [INFO] Creating persistent ethtool configuration for eno2
[2025-07-12 23:04:32] [INFO] Created and enabled persistent ethtool workaround service for eno2
✓ Persistent configuration created: /etc/systemd/system/ethtool-workaround-eno2.service
Hardware reset procedure completed for eno2
[2025-07-12 23:04:35] [INFO] Hardware reset procedure completed successfully for eno2
[2025-07-12 23:04:35] [DEBUG] Skipping virtual interface: fwpr100p0
[2025-07-12 23:04:35] [DEBUG] Skipping virtual interface: fwpr102p0
[2025-07-12 23:04:35] [DEBUG] Skipping virtual interface: fwpr103p0
[2025-07-12 23:04:35] [DEBUG] Skipping virtual interface: fwpr104p0
[2025-07-12 23:04:35] [DEBUG] Skipping virtual interface: fwpr105p0
[2025-07-12 23:04:35] [DEBUG] Skipping virtual interface: fwpr106p0
[2025-07-12 23:04:35] [DEBUG] Skipping virtual interface: fwpr108p0
[2025-07-12 23:04:35] [DEBUG] Skipping virtual interface: fwpr109p0
[2025-07-12 23:04:35] [DEBUG] Skipping virtual interface: fwpr110p0
[2025-07-12 23:04:35] [DEBUG] Skipping virtual interface: fwpr113p0
[2025-07-12 23:04:35] [DEBUG] Skipping virtual interface: fwpr117p0
[2025-07-12 23:04:35] [DEBUG] Skipping virtual interface: fwpr119p0
Bridge member summary: 1 physical, 12 virtual (skipped)
[2025-07-12 23:04:35] [INFO] Bridge member summary: 1 physical interfaces processed, 12 virtual interfaces skipped
Waiting for bridge members to stabilize...
Bringing down interface vmbr0...
[2025-07-12 23:04:40] [INFO] Interface vmbr0 brought down successfully
Bringing up interface vmbr0...
[2025-07-12 23:04:43] [INFO] Interface vmbr0 brought up successfully
Restarting networking service...
[2025-07-12 23:04:50] [INFO] Networking service restarted successfully
Waiting for bridge to stabilize...
[2025-07-12 23:05:00] [INFO] Interface status after restart: 5: vmbr0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
Attempting DHCP renewal...
[2025-07-12 23:05:00] [INFO] Attempting DHCP renewal for interface vmbr0
[2025-07-12 23:05:02] [INFO] DHCP release successful for vmbr0
[2025-07-12 23:05:04] [INFO] DHCP renewal successful for vmbr0
Verifying network connectivity...
Bridge interface detected, allowing extra time for stabilization...
Attempt 1/20: Network still not reachable, waiting 5s...
Attempt 2/20: Network still not reachable, waiting 5s...
Network connectivity restored!
[2025-07-12 23:05:29] [INFO] Network connectivity verified after 3 attempts
Network interface restart completed successfully!
[2025-07-12 23:05:29] [INFO] Network interface restart completed successfully on attempt 1
root@proxmox:~/Network_Tools#
```