A daemon, running in background on a Linux router or firewall, monitoring the state of multiple internet uplinks/providers and changing the routing accordingly. LAN/DMZ internet traffic is load balanced between the uplinks.
error received when running. Attempting to route traffic from wlan0 (AP) to 2 etc{1,3} addresses:
$ fault_tolerant_router monitor
/var/lib/gems/2.1.0/gems/fault_tolerant_router-1.2.0/lib/fault_tolerant_router/uplink.rb:65:in detect_ppp_ips!': undefined methodip_address' for nil:NilClass (NoMethodError)
from /var/lib/gems/2.1.0/gems/fault_tolerant_router-1.2.0/lib/fault_tolerant_router/uplink.rb:45:in initialize' from /var/lib/gems/2.1.0/gems/fault_tolerant_router-1.2.0/lib/fault_tolerant_router/uplinks.rb:5:innew'
from /var/lib/gems/2.1.0/gems/fault_tolerant_router-1.2.0/lib/fault_tolerant_router/uplinks.rb:5:in block in initialize' from /var/lib/gems/2.1.0/gems/fault_tolerant_router-1.2.0/lib/fault_tolerant_router/uplinks.rb:5:ineach'
from /var/lib/gems/2.1.0/gems/fault_tolerant_router-1.2.0/lib/fault_tolerant_router/uplinks.rb:5:in each_with_index' from /var/lib/gems/2.1.0/gems/fault_tolerant_router-1.2.0/lib/fault_tolerant_router/uplinks.rb:5:ineach'
from /var/lib/gems/2.1.0/gems/fault_tolerant_router-1.2.0/lib/fault_tolerant_router/uplinks.rb:5:in map' from /var/lib/gems/2.1.0/gems/fault_tolerant_router-1.2.0/lib/fault_tolerant_router/uplinks.rb:5:ininitialize'
from /var/lib/gems/2.1.0/gems/fault_tolerant_router-1.2.0/bin/fault_tolerant_router:150:in new' from /var/lib/gems/2.1.0/gems/fault_tolerant_router-1.2.0/bin/fault_tolerant_router:150:in<top (required)>'
from /usr/local/bin/fault_tolerant_router:23:in load' from /usr/local/bin/fault_tolerant_router:23:in'
Config file:
uplinks:
interface: eth1
type: ppp
description: Example Provider 1
priority_group: 1
optional parameter
weight: 1
interface: eth3
type: ppp
description: Example Provider 2
priority_group: 1
optional parameter
weight: 2
downlinks:
lan: wlan0
leave blank if you have no DMZ
dmz:
tests:
an array of IP addresses to ping to verify the uplinks state. You can add as
many as you wish. Predefined ones are Google DNS, OpenDNS DNS, other public
DNS. Every time an uplink is tested the IP addresses are shuffled, so listing
order is not important.
ips:
8.8.8.8
8.8.4.4
208.67.222.222
208.67.220.220
4.2.2.2
4.2.2.3
number of successfully pinged IP addresses to consider an uplink to be
functional
required_successful: 4
number of ping retries before giving up on an IP
ping_retries: 1
seconds between a check of the uplinks and the next one
interval: 30
log:
file: "/var/log/fault_tolerant_router.log"
file: "/tmp/fault_tolerant_router.log"
maximum log file size (in bytes). Once reached this size, the log file will
It's normal you get such error in _detect_pppips! method, because in the configuration you specified the interface as a PPP one while it is not. See my answer to issue #19.
error received when running. Attempting to route traffic from wlan0 (AP) to 2 etc{1,3} addresses:
$ fault_tolerant_router monitor /var/lib/gems/2.1.0/gems/fault_tolerant_router-1.2.0/lib/fault_tolerant_router/uplink.rb:65:in'
detect_ppp_ips!': undefined method
ip_address' for nil:NilClass (NoMethodError) from /var/lib/gems/2.1.0/gems/fault_tolerant_router-1.2.0/lib/fault_tolerant_router/uplink.rb:45:ininitialize' from /var/lib/gems/2.1.0/gems/fault_tolerant_router-1.2.0/lib/fault_tolerant_router/uplinks.rb:5:in
new' from /var/lib/gems/2.1.0/gems/fault_tolerant_router-1.2.0/lib/fault_tolerant_router/uplinks.rb:5:inblock in initialize' from /var/lib/gems/2.1.0/gems/fault_tolerant_router-1.2.0/lib/fault_tolerant_router/uplinks.rb:5:in
each' from /var/lib/gems/2.1.0/gems/fault_tolerant_router-1.2.0/lib/fault_tolerant_router/uplinks.rb:5:ineach_with_index' from /var/lib/gems/2.1.0/gems/fault_tolerant_router-1.2.0/lib/fault_tolerant_router/uplinks.rb:5:in
each' from /var/lib/gems/2.1.0/gems/fault_tolerant_router-1.2.0/lib/fault_tolerant_router/uplinks.rb:5:inmap' from /var/lib/gems/2.1.0/gems/fault_tolerant_router-1.2.0/lib/fault_tolerant_router/uplinks.rb:5:in
initialize' from /var/lib/gems/2.1.0/gems/fault_tolerant_router-1.2.0/bin/fault_tolerant_router:150:innew' from /var/lib/gems/2.1.0/gems/fault_tolerant_router-1.2.0/bin/fault_tolerant_router:150:in
<top (required)>' from /usr/local/bin/fault_tolerant_router:23:inload' from /usr/local/bin/fault_tolerant_router:23:in
Config file:
uplinks:
optional parameter
weight: 1
optional parameter
weight: 2
downlinks: lan: wlan0
leave blank if you have no DMZ
dmz:
tests:
an array of IP addresses to ping to verify the uplinks state. You can add as
many as you wish. Predefined ones are Google DNS, OpenDNS DNS, other public
DNS. Every time an uplink is tested the IP addresses are shuffled, so listing
order is not important.
ips:
number of successfully pinged IP addresses to consider an uplink to be
functional
required_successful: 4
number of ping retries before giving up on an IP
ping_retries: 1
seconds between a check of the uplinks and the next one
interval: 30
log:
file: "/var/log/fault_tolerant_router.log"
file: "/tmp/fault_tolerant_router.log"
maximum log file size (in bytes). Once reached this size, the log file will
be rotated.
max_size: 1024000
number of old rotated files to keep
old_files: 10
email: send: false sender: router@domain.com recipients:
see http://ruby-doc.org/stdlib-2.3.1/libdoc/net/smtp/rdoc/Net/SMTP.html
smtp_parameters: address: smtp.gmail.com port: 587
domain: domain.com
authentication: :login enable_starttls_auto: true user_name: user@gmail.com password: secret-password
base IP route table number, just need to change if you are already using
multiple routing tables
base_table: 1
just need to change if you are already using ip policy routing, to avoid
overlapping, must be higher than 32767 (the default routing table priority,
see output of "ip rule" command)
base_priority: 40000
just need to change if you are already using packet marking, to avoid
overlapping
base_fwmark: 1