Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| docs:guide-user:network:wan:multiwan:2wan_netifd [2023/11/01 22:43] – [Command-line instructions] update vgaetera | docs:guide-user:network:wan:multiwan:2wan_netifd [2023/11/10 09:08] (current) – migrated to docs:guide-user:network:wan:multiwan:mwan_netifd vgaetera | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Dual WAN with netifd ====== | ||
| - | {{section> | ||
| - | |||
| - | ===== Introduction ===== | ||
| - | * This instruction configures dual WAN with [[docs: | ||
| - | * Enable [[docs: | ||
| - | * Follow [[docs: | ||
| - | |||
| - | ===== Features ===== | ||
| - | * Implement dual WAN based on PBR with netifd. | ||
| - | * Perform connectivity check with ICMP and ICMPv6. | ||
| - | * Provide a simple failover method. | ||
| - | * Support dual-stack setups. | ||
| - | |||
| - | ===== Command-line instructions ===== | ||
| - | Assuming pre-configured upstream interfaces '' | ||
| - | Set up PBR with netifd using [[docs: | ||
| - | Save the failover script and assign the main and fallback interfaces. | ||
| - | Configure cron to run the failover script. | ||
| - | |||
| - | <code bash> | ||
| - | # Failover script | ||
| - | cat << " | ||
| - | NET_IF=" | ||
| - | NET_FIF=" | ||
| - | . / | ||
| - | for IPV in 4 6 | ||
| - | do | ||
| - | network_flush_cache | ||
| - | eval network_get_device${IPV%4} NET_DEV " | ||
| - | eval network_get_gateway${IPV%4} NET_GW " | ||
| - | if ping -q -c 3 -w 5 -I " | ||
| - | then NET_RT=" | ||
| - | else NET_RT=" | ||
| - | fi | ||
| - | NET_CRT=" | ||
| - | if [ " | ||
| - | then logger -t 2wan " | ||
| - | uci set network.default${IPV%4}.lookup=" | ||
| - | service network reload | ||
| - | fi | ||
| - | done | ||
| - | EOF | ||
| - | cat << " | ||
| - | / | ||
| - | EOF | ||
| - | |||
| - | # Configure cron | ||
| - | cat << " | ||
| - | * * * * * . / | ||
| - | EOF | ||
| - | uci set system.@system[0].cronloglevel=" | ||
| - | uci commit system | ||
| - | service cron restart | ||
| - | </ | ||