Grand Route Dispatch is a python script for routing specific url to Wi-Fi or Ethernet.
This tool is helpful when your company limit access of internal ressources to Ethernet and limit certain services to wifi.
GRD WORKS ONLY ON OS X & LINUX!
For example, imagine you need to plug your Ethernet cable in order to:
- Connect to LDAP
- Access internal support websites
- ...
But you can't use Ethernet for streaming music or using dropbox.
You just need to create your own hosts list then give it to GRD and it will automatically create route for you.
NB: Routes will vanish when disconnect Wi-Fi and Ethernet
There is only two specific tags.
First, !wifi
every URLs after this tag and before next one (or EOF) will be routed to Wi-Fi.
Next one is !ethernet
, every URLs after this tag until EOF or another tag will be routed to Ethernet.
Empty lines, wrong URLs and lines starting with #
will be omitted.
See [example](## Host list example)
- First, git clone it!
git clone https://github.com/Miasma87/grand-route-dispatch.git
- Make it executable
chmod +x grand-route-dispatch.py
- Launch it!
sudo ./grand-route-dispatch.py
N.B: You should launch it with super-user privileges as route
command need it.
First of all you will need to write a file listing all the URLs you want to dispatch.
See [Host list example](## Host list example) for file example.
!wifi
# Here we will have URLs that will need to be redirected to Wi-Fi
google.com
spotify.com
!ethernet
# Here we will have URLs that will need to be redirected to Ethernet
ldap.yourcompany.com
webmail.yourcompany.com
# Printer IP
10.10.10.10
./grand-route-dispatch.py -h
usage: grand-route-dispatch.py [-h] [-f HOSTSFILE] [-d]
Grand Route Dispatch is a python script for routing specific url to Wi-Fi or
Ethernet.
optional arguments:
-h, --help show this help message and exit
-f HOSTSFILE, --hostsfile HOSTSFILE
use given hosts file
-d, --debug pretty print debug info
Not yet 🍻
- Only works with OSX and Linux, for now
- Only works if the two devices are Wi-Fi and Thunderbolt Ethernet
- Wi-Fi need to be upper Thunderbolt Ethernet in "Service Order"
- Support Windows (Pull requests are welcome)
I would like to thanks ofaurax for being the bootstrap of this project!
- Merged
*_OSX
&*_linux
functions to uniques functions, OS separation is now mad inside the function
- CIDR address support
- Linux support
- First commit
- Support OS X only for now