> For the complete documentation index, see [llms.txt](https://prime-stake-pool.gitbook.io/node-setup-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://prime-stake-pool.gitbook.io/node-setup-guide/server-settings/dual-nic-wan-failover-setup.md).

# Dual NIC WAN failover setup

A WAN failover script using systemd automates switching network traffic to a backup/secondary internet connection (WAN) when the primary connection fails. This ensures continuous connectivity and can be implemented by periodically checking the primary connection's status and adjusting routing rules via a systemd service and script.

A script for switching back to the primary WAN after a failover involves detecting the restoration of the primary connection and then directing traffic back to it. This often involves monitoring the primary link's status (e.g., using ping checks) and then modifying routing rules or firewall configurations to ensure traffic flows through the primary interface again.

The setup includes four main steps:

1. Configure the Netplan inline with the failover script
2. Create a failover script file `wan-failover.sh` which switches network traffic to backup/secondary WAN when primary WAN fails and back to primary when connection restores
3. Deploy the script file `wan-failover.sh` as systemd service `wan-failover.service`
4. Set up systemd timer if required, which periodically triggers the failover script `wan-failover.timer`


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://prime-stake-pool.gitbook.io/node-setup-guide/server-settings/dual-nic-wan-failover-setup.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
