|
6 | 6 | [](http://perso.crans.org/besson/LICENSE.html)
|
7 | 7 | # Table of Contents
|
8 | 8 | * [Introduction to x86routertools](#whatis)
|
| 9 | + |
9 | 10 | * [Using the command line tools](#cmdline)
|
| 11 | + |
10 | 12 | * [Using the daemon](#daemon)
|
| 13 | + |
11 | 14 | * [System requirements](#sysreq)
|
| 15 | + |
12 | 16 | * [Installation](#install)
|
| 17 | + |
13 | 18 | * [Configuration options](#cfgopt)
|
| 19 | + |
14 | 20 | * [Scripts and examples](#scripts)
|
| 21 | + |
15 | 22 | ## <a name="whatis"></a>Introduction to x86routertools
|
16 |
| -This is a command line toolkit written in Bash that aims to turn a regular x86_64 computer running GNU/Linux into a wireless router or access point (AP), whilst managing things like system services, alerts, system LEDs and making sure the network is always up via watchdog daemons. |
| 23 | +**This is a command line toolkit written in Bash that aims to turn a regular x86_64 computer running GNU/Linux into a wireless router or access point (AP), whilst managing things like system services, alerts, system LEDs and making sure the network is always up via watchdog daemons.** |
17 | 24 |
|
18 | 25 | Similar in nature to create_ap, this goes a bit further with the configurability of the whole program and the scope. It can do:
|
19 | 26 | * Watch and restart wireless APs when needed, with per-AP configuration and simple masquerading/fowarding rules.
|
| 27 | + |
20 | 28 | * Watch and restart the internet-facing interface when needed via user-made scripts (x86routertools takes care of 'detecting' connectivity)
|
| 29 | + |
21 | 30 | * Network status logging and status alerts to desktop/console/LED
|
| 31 | + |
22 | 32 | * Automatically restart a service 'stack' on network initialization, for DNS sinkholing setups for example.
|
| 33 | + |
23 | 34 | * Manage queue disciplines with CAKE SQM and pre-defined categories
|
| 35 | + |
24 | 36 | * Manage ath9k Wi-Fi cards' special features, like digital predistortion and ack timeout estimation.
|
| 37 | + |
25 | 38 | * Manage generic Wi-Fi AP features, like power saving, retransmission, regulatory domains and transmit power.
|
| 39 | + |
26 | 40 | * Optimize the network stack, for example, toggling on BBRv2/v1 if present.
|
| 41 | + |
27 | 42 | * Offer command line tools for wireless AP management and debugging.
|
28 | 43 |
|
29 |
| -x86routertools is currently not compatible with NetworkManager, but a patch to set predefined interfaces as 'unmanaged' to fix this should be easy to make. |
30 | 44 |
|
31 | 45 | ## <a name="cmdline"></a>Using the command line tools
|
32 | 46 | x86routertools comes with many verbs that can be used to get information on the system.
|
33 | 47 |
|
34 |
| -For example, you can check what MCS rates your phone is using on the connection, to measure the quality of the service it is getting: |
| 48 | +For example, you can check what MCS rates your client is using on the connection, to measure the quality of the service it is getting: |
35 | 49 | * Get the MAC address of the device by looking at the list of connected devices:
|
36 |
| -* `$ routertools ls` |
| 50 | +* -`$ routertools ls` |
37 | 51 | * Then, you can pull up the real-time rate display with the AP's interface name:
|
38 |
| -* `$ routertools display-rates wlan0 aa:bb:cc:dd:ee:ff` |
| 52 | +* -`$ routertools display-rates wlan0 aa:bb:cc:dd:ee:ff` |
39 | 53 |
|
40 | 54 | You can also toggle many runtime options of a wireless interface. For example, to turn on LNA mixing on ath9k cards (the daemon can do this for you, too):
|
41 |
| -* `# routertools lnamix-on wlan0` |
| 55 | +* -`# routertools lnamix-on wlan0` |
42 | 56 | * Or, to set it on all APs on the system:
|
43 |
| -* `# routertools lnamix-on` |
| 57 | +* -`# routertools lnamix-on` |
44 | 58 |
|
45 |
| -Calling `routertools --help` should be enough to get you a full, descriptive list of commands. |
| 59 | +**Calling `routertools --help` should be enough to get you a full, descriptive list of commands.** |
46 | 60 |
|
47 | 61 | ## <a name="daemon"></a>Using the daemon
|
48 |
| -The x86routertools daemon has two instances, Wi-Fi and internet, which are independent from each other. |
| 62 | +**The x86routertools daemon has two instances, Wi-Fi and internet, which are independent from each other.** |
49 | 63 |
|
50 |
| -Their function is to watch the system-wide SQM/qdisc configuration, and watch the AP interfaces and the internet-facing interface respectively. How they work and what they do is extensively configurable via files in `/etc/routertools.d/`. The most important of them, containing the most options, is arguably `x86routertools.conf`. |
| 64 | +Their function is to watch the system-wide SQM/qdisc configuration, and watch the AP interfaces and the internet-facing interface respectively. How they work and what they do is extensively configurable via files in `/etc/routertools.d/`. |
| 65 | + |
| 66 | +**The most important of them, containing the most options, is arguably `x86routertools.conf`.** |
| 67 | + |
| 68 | +**To start the internet daemon, you can use:** |
51 | 69 |
|
52 |
| -To start the internet daemon, you can use: |
53 | 70 | `sudo systemctl start routertoolsd-inet`
|
54 | 71 |
|
55 |
| -To start the wireless AP daemon: |
56 |
| -`sudo systemctl start routertoolsd-wifi@wlan0` |
| 72 | +**To start the wireless AP daemon:** |
| 73 | + |
| 74 | +`sudo systemctl start routertoolsd-wifi@wlan0` |
| 75 | + |
57 | 76 | Where, of course, wlan0 is the name of one interface you configured in `/etc/routertools.d/wifi-access-points`.
|
58 | 77 |
|
59 |
| -The daemons will regularly output their status to the system log, send desktop notifications, or make a light blink somewhere. |
| 78 | +**The daemons will regularly output their status to the system log, send desktop/tty notifications, or make a light blink somewhere.** |
60 | 79 |
|
61 | 80 | ## <a name="sysreq"></a>System requirements
|
62 | 81 | * Access point-capable Wi-Fi card (ath9k is preferred but optional)
|
63 | 82 |
|
64 | 83 | Must be installed:
|
65 | 84 | * systemd
|
| 85 | + |
66 | 86 | * netstat
|
| 87 | + |
67 | 88 | * iw
|
| 89 | + |
68 | 90 | * ifconfig
|
| 91 | + |
69 | 92 | * iptables
|
| 93 | + |
70 | 94 | * hostapd
|
71 | 95 |
|
| 96 | +Incompatible: |
| 97 | +* NetworkManager |
| 98 | + |
72 | 99 | Optional:
|
73 | 100 | * wget, for grabbing hostapd configuration reference.
|
| 101 | + |
74 | 102 | * haveged or rngd, without, WPA/WEP performance may suffer
|
| 103 | + |
75 | 104 | * A firewall like ufw, shorewall or firewalld. x86routertools *will not block any vulnerable ports for you*!
|
| 105 | + |
76 | 106 | * A DHCP server like Pi-hole or dnsmasq, otherwise your clients will not be able to use DHCP. x86routertools *will not configure DNS for you*!
|
| 107 | + |
77 | 108 | ## <a name="install"></a>Installation
|
78 | 109 | x86routertools is normally installed to `/usr/bin`. Other necessary directories like in `/etc` will be populated by the program on first run.
|
79 | 110 |
|
80 | 111 | To install it on your system:
|
| 112 | + |
81 | 113 | * Clone the repository somewhere:
|
82 |
| -* `$ git clone https://github.com/yagoplx/x86routertools.git` |
83 |
| -* `$ cd x86routertools` |
| 114 | +* -`$ git clone https://github.com/yagoplx/x86routertools.git` |
| 115 | +* -`$ cd x86routertools` |
84 | 116 | * Run make install:
|
85 |
| -* `# make install` |
| 117 | +* -`# make install` |
86 | 118 |
|
87 | 119 | You may also want to run a `systemctl daemon-reload` if you want to try out the daemon right away.
|
88 | 120 |
|
89 |
| -Configuration is well documented and required, check the new files at `/etc/routertools.d` for examples and info. For example, to register a new wireless interface with x86routertools, you will want to set up them at `/etc/routertools.d/wifi-access-points`. |
| 121 | +**Configuration is well documented and required, check the new files at** `/etc/routertools.d` **for examples and info.** |
| 122 | + |
| 123 | +**For example, to register a new wireless interface with x86routertools, you will want to set up them at** `/etc/routertools.d/wifi-access-points`. |
| 124 | + |
| 125 | +**Each wireless interface should have two files in there: a interface.conf, and a interface_hostapd.conf.** |
| 126 | + |
| 127 | +Example files with all possible options documented are provided for you to copy/rename. |
| 128 | + |
| 129 | +**As for the internet facing interface, you should set up scripts to set them up and down at** `/etc/routertools.d/scripts`. |
| 130 | + |
| 131 | +The default is to just call the Arch Linux pppoe-start and pppoe-stop commands for PPPoE, in this case the internet interface is ppp0. |
| 132 | + |
| 133 | +**The daemon will call the stop script when it restarts the interface, and then the start script. The command line tools also can use these scripts as well.** |
| 134 | + |
| 135 | +**If necessary, you should include configuration for other interfaces on the start script, for example, making a 6to4 tunnel or a bridge interface, setting addresses/routes for them via ip/iptables, etc.** |
90 | 136 |
|
91 |
| -Each wireless interface should have two files in there: a interfacename.conf, and a interfacename_hostapd.conf. Example files with all possible options documented are provided for you to copy/rename. |
| 137 | +In the scripts folder you can also add start-interfacename/stop-interfacename files for your access point interfaces. |
92 | 138 |
|
93 |
| -As for the internet facing interface, you should set up scripts to set them up and down at `/etc/routertools.d/scripts`. The default is to just call the Arch Linux pppoe-start and pppoe-stop commands for PPPoE, in this case the internet interface is ppp0. The daemon will call the stop script when it restarts the interface, and then the start script. The command line tools also can use these scripts as well. If necessary, you should include configuration for other interfaces on the start script, for example, making a 6to4 tunnel or a bridge interface, setting addresses/routes for them via ip/iptables, etc. |
94 |
| -In the scripts folder you can also add start-interfacename/stop-interfacename files for your access point interfaces. This is useful for additional routing/address work if the included functionality in x86routertools isn't enough (eg. IPv6). |
| 139 | +This is useful for additional routing/address work if the included functionality in x86routertools isn't enough (eg. IPv6). |
95 | 140 |
|
96 | 141 | You can have the daemon start on boot for the standard wifi router experience:
|
97 |
| -* `# systemctl enable routertoolsd-inet` |
98 |
| -* `# systemctl enable routertoolsd-wifi@interface_name` |
| 142 | +* -`# systemctl enable routertoolsd-inet` |
| 143 | +* -`# systemctl enable routertoolsd-wifi@interface_name` |
99 | 144 |
|
100 | 145 | #### <a name="cfgopt"></a>Configuration options
|
101 | 146 | Configuration is system-wide and is done via files in `/etc/routertools.d`
|
|
0 commit comments