Skip to content

flant/netgwm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NetGWM stands for Network Gateway Manager
(http://flant.ru/projects/netgwm)

NetGWM is a tool on Python used for automatically switching
network gateway when your current ISP goes offline.

How to deploy NetGWM?
0) Install prerequisites:
   - iproute2
   - conntrack (http://conntrack-tools.netfilter.org/)
   - python-yaml (http://pyyaml.org/)
1) Execute "make install". It will create /usr/lib/netgwm
   with netgwm.py and /etc/netgwm with configs and samples.
2) Using simple YAML configuration file (samples/netgwm.yml),
   you should define your gateways (by IPs or devices) and
   their priorities. In /etc/default/netgwm, you can change
   the period of checking gateways (by default, every 60 sec).
3) Add new routing table named "netgwm_check" to your iproute
   configuration file (/etc/iproute2/rt_tables; there is
   an example at samples/rt_tables.sample). It's done
   automatically in the Debian package.
4) Use /etc/init.d/netgwm to launch NetGWM.

That's all! NetGWM will ping given addresses through your
current gateway to check your Internet connection. If all
of these addresses are down, NetGWM will switch your current
gateway to a working one (with a highest priority).

Other features:
* A gateway is considered as working only after N seconds
  of successfull checks. This setting ("min_uptime") can be
  configured in netgwm.yml.
* When a gateway with a higher priority goes back online
  NetGWM will automatically switch to it from the current
  one.
* Every time NetGWM switches a network gateway, it will
  execute all the scripts placed in
  /etc/netgwm/post-replace.d (for more details, please have
  a look at samples/post-replace.d/script.sh).
* NetGWM can maintain the full list of gateways statuses
  continually for your special needs (e.g. to be used in
  other software). This data is stored in
  /var/run/netgwm/gwstore.yml. This setting
  ("check_all_gateways") can be enabled in netgwm.yml.