|
1 | 1 | # ffac-private-wan-dhcp |
2 | 2 |
|
3 | | -This package adds dynamic uci configurations when a cellular or wan interface is made available. |
4 | | -It can be used to activate and configure a DHCP server on devices which terminate an uplink connection. |
| 3 | +Allows devices connected to a private WAN WiFi (terminating an LTE/DSL uplink) to |
| 4 | +use that uplink directly instead of being offloaded into the Freifunk mesh. |
5 | 5 |
|
6 | | -On cellular devices, activating the private wlan creates an interface in which no gateway is set by default. |
7 | | -For this situation, a dhcp server on br-wan is configured through this package. |
| 6 | +On `ifup` of the cellular uplink (`cellular` / `cellular_4`) it: |
| 7 | + |
| 8 | +* switches the `wan` interface to a static IPv4 net and runs a DHCP server on it |
| 9 | + (range, lease, DNS configurable via `/etc/config/private-wan-dhcp`), |
| 10 | +* sets up firewall rules + NAT (`wan` → `wwan`) so IPv4 clients reach the internet, |
| 11 | +* requests a `/64` on the cellular interface, derives the current global IPv6 /64 |
| 12 | + from `wwan0` and advertises it to the private WAN clients via **uradvd** on `br-wan`, |
| 13 | +* **adds an IPv6 policy-routing rule** (`network.lte_clients`, a `rule6`) that sends |
| 14 | + traffic from that /64 into the LTE routing table (lookup `1`, priority `9999`). |
| 15 | + Without it the clients' IPv6 traffic falls back to the `main` table, whose |
| 16 | + default route points at Freifunk — so they would get an address but no internet. |
| 17 | + |
| 18 | +The IPv6 rule is recreated with the *current* prefix on every uplink `ifup`, so it |
| 19 | +survives provider prefix changes automatically. On `ifdown` all of the above |
| 20 | +(including the rule) is reverted. |
| 21 | + |
| 22 | +## Config options (`/etc/config/private-wan-dhcp`) |
| 23 | + |
| 24 | +* `enabled` — master switch (`0`/`1`) |
| 25 | +* `ipaddr` / `netmask` — advertised private WAN IPv4 network |
| 26 | +* `dns_server` — IPv4 DNS advertised via dnsmasq |
| 27 | +* `uradvd_dns_server` — IPv6 DNS advertised via uradvd (list) |
| 28 | + |
| 29 | +> Why NAT-free routing works for IPv6: the cellular uplink (`wwan0`) is a |
| 30 | +> point-to-point link and the mobile network routes the whole /64 to the device |
| 31 | +> (3GPP / RFC 7278). The /64 can therefore be handed to clients and routed |
| 32 | +> directly — no NAT66 or NDP proxy required. |
0 commit comments