Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Basic features:
- Detect and prevent interference from following Linux system daemons:
- NetworkManager (handle interface (un)managed status)
- firewalld (use temporary `trusted` zone)
- Integration with systemd
- Instances managing. You can run multiple instances, to create different sub-networks.

**For many other features, see below [CLI usage](#cli-usage-and-other-features)**
Expand Down Expand Up @@ -466,6 +467,18 @@ On exit of a linux-router instance, script **will do cleanup**, i.e. undo most c
5. The wifi device which is used to create hotspot is `rfkill unblock`ed
6. WiFi country code, if user assigns

### Integration with systemd

A sample systemd service unit file is available and can be used to run this program as a service.
The service unit can be designed and written in a number of ways, but the important thing to make
systemd readiness notification work, is these specific lines:

```
[Service]
Type=notify
NotifyAccess=all
```

## Meet contributor(s) and become one of them

Visit [**my homepage** 🏡](https://garywill.github.io) to see **more tools and projects** 🛠️.
Expand Down
11 changes: 11 additions & 0 deletions linux-router.example.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# copy this file to /etc/linux-router.conf and modify it for your specific setup
PRIVATE_NETWORK_IPV4=192.168.0.0/24
AP_NETWORK=192.168.100.0/24
AP_DNS_ADDRESS=192.168.0.1
AP_NET_GATEWAY=192.168.100.1
AP_WIFI_COUNTRY=US
AP_WIFI_CHANNEL=11
AP_WIFI_INTERFACE=wlan0
AP_WIFI_ESSID=MyHotspot
AP_WIFI_PSK=MyPskKey
AP_WIFI_GW_INTERFACE=eth0
22 changes: 22 additions & 0 deletions linux-router.example.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[Unit]
Description=Linux Router
After=network.target

[Service]
Type=notify
NotifyAccess=all
User=root
EnvironmentFile=/etc/linux-router.conf
ExecStart=/usr/local/bin/lnxrouter \
--country "$AP_WIFI_COUNTRY" \
-n --no-virt \
--dns "$AP_DNS_ADDRESS" \
-g "$AP_NET_GATEWAY" \
-c "$AP_WIFI_CHANNEL" --wifi4 --ht-capab "" \
--ap "$AP_WIFI_INTERFACE" "$AP_WIFI_ESSID" \
-p "$AP_WIFI_PSK"
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target
1 change: 1 addition & 0 deletions lnxrouter
Original file line number Diff line number Diff line change
Expand Up @@ -2520,6 +2520,7 @@ fi
echo ""
is_firewalld_running && firewalld_addto_tmptrustedzone

systemd-notify --ready --status="Active on WiFi network ${SSID}" || true

echo
echo "== Setting up completed, now linux-router should be working =="
Expand Down