Last active
April 15, 2020 20:56
-
-
Save braian87b/f3c7885c508358f008e98f384a4d56b4 to your computer and use it in GitHub Desktop.
Equal Cost Routing (OpenWrt - LEDE)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Equal Cost Routing (OpenWrt - LEDE) | |
# Attention: This was not tested yet. | |
# Can be used with, for example, two Internet access points. In this case accessible via the same interface. | |
# Install software package iproute2 | |
opkg update | |
opkg install ip | |
# Set up routing at boot, idk if could be elsewhere in better place | |
cat<<'EOF' > /etc/rc.local | |
#!/bin/sh | |
ip route del default | |
ip route add default scope global nexthop via 172.16.0.1 weight 1 nexthop via 172.16.0.2 weight 1 | |
exit 0 | |
EOF | |
chmod +x /etc/rc.local | |
# Check routing | |
ip r | |
# 172.16.0.0/24 dev eth0 proto kernel scope link src 172.16.0.3 | |
# 192.168.0.0/16 dev eth1 proto kernel scope link src 192.168.1.251 | |
# 192.168.0.0/16 dev bond0 proto kernel scope link src 192.168.11.251 | |
# default | |
# nexthop via 172.16.0.1 dev eth0 weight 1 | |
# nexthop via 172.16.0.2 dev eth0 weight 1 | |
# Check the public IP address | |
opkg install curl | |
curl -s http://checkip.dyndns.org/ | grep -o "[[:digit:].]\+" | |
# taken from: https://wiki.opennet-initiative.de/wiki/Link_Aggregation |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment