# WiMAX posting route

Prepared for UbuntuMateRouterServer, Ubuntu 22.04 / NetworkManager 1.36.
This directory contains the deployment source. Setup was applied on 2026-10-22.

## Verified result (2026-10-22, 19:27-19:29 JST)

- Normal curl traffic exited through 218.185.167.200 (Wan).
- The posting browser, using the deployed selector and launch settings, exited
  through 106.146.85.202 (WiMAX).
- A real connection-refused error was simulated by directing only the test
  probe to a closed local proxy port. The deployed selector chose no proxy,
  and the browser then exited through 218.185.167.200.
- No WiMAX default route remained in the main IPv4/IPv6 tables; system DNS
  came only from Wan. The NetworkManager profile was saved to disk, and the
  proxy service was enabled and running. The reconnect dispatcher was root-owned
  and executable. Reboot and physical USB-disconnect tests were not performed.
- The deployed posting script matched this directory's version. No forum test
  post was submitted. Cron still stopped at the existing DAT preflight failure
  (curl exit 22), already present before this deployment.

## Apply

Run `sudo bash /home/user/ほしゅつーる/wimax/setup.sh` on Ubuntu.
The setup checks for concurrent posting and unexpected script edits first.
It backs up the original NetworkManager profile and posting script under
`/var/lib/hosyu-wimax`, with the cloned profile's autoconnect disabled.

The setup modifies only the WiMAX profile
`36bef876-11a3-3237-83b1-16b22866631f` / `enx6ce4da121d35`:

- Put DHCP IPv4 routes in table 179; select them for source 192.168.179.0/24.
- Ignore WiMAX DNS and disable IPv6 on this adapter to avoid normal use.
- Run a loopback-only Dante SOCKS proxy on 127.0.0.1:10809, with its outgoing
  address bound to the WiMAX adapter.
- Restart the dedicated proxy on USB reconnect / DHCP address changes.
- Deploy the staged `hosyu_post.sh` after validating the routes and service.

The posting browser uses the proxy only after a bounded HTTPS HEAD probe to
the target site's root succeeds. If the proxy or WiMAX is unavailable, it uses
the normal connection. The existing checks before posting continue to use the
normal connection. Existing safeguards against retransmitting an uncertain
submission remain in place. A failure after submission does not trigger a
normal-line retransmission.

The source route expects the currently observed WiMAX LAN, 192.168.179.0/24.
Changing that LAN subnet requires updating the source rule.

## Validation

`python3 verify.py` checks Python syntax and proxy selection with no posting.
Setup verifies ordinary IPv4 traffic uses Wan, the main routing tables contain
no WiMAX default, and WiMAX-source traffic selects the WiMAX adapter.
It also checks the proxy service and reports the WiMAX public IP if reachable.
No test post is submitted. Real routing and service activation require sudo;
the installed routing and browser behavior were verified as recorded above.

## References

- [NetworkManager routing tables](https://networkmanager.dev/docs/api/latest/settings-ipv4.html)
- [Dante external interface binding](https://www.inet.no/dante/doc/1.4.x/sockd.conf.5.html)
- [Playwright proxy configuration](https://playwright.dev/python/docs/network#http-proxy)
