openwrt / openwrt/packages

snowflake-proxy: NAT type detection fails on reboot

Open
#28,630 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Makefile
Stars
4.6k
Forks
4k
Avg merge
3d 12h
Merged PRs (30d)
134

Description

Package Name

snowflake-proxy

Maintainer

(@PolynomialDivision)

OpenWrt Version

25.12.0-rc5

OpenWrt Target/Subtarget

mediatek/filogic

Steps to Reproduce
  • install snowflake-proxy
  • add -ephemeral-ports-range 32768:60999 as a command parameter in the start_service() function in the init script
  • add a firewall rule to allow incoming IPv4 & IPv6 UDP traffic on the above port range on the WAN interface:
Image
  • # /etc/init.d/snowflake-proxy restart
  • # logread|grep snowflake-proxy

Observe after the line "Proxy starting" the line "NAT type: unrestricted"

  • reboot the router

The logs should report "NAT type: unrestricted" again.

Actual Behaviour

After a reboot logs say "NAT type: unknown".

I've reported the bug at the Tor Project's snowflake repo and been advised to report it here too. We suspect NAT type detection is failing because the STUN server probe test is conducted before the WAN connection is up.

Adding sleep 10 to the beginning of the start_service() function seems to fix it, but I expect there is a better way of waiting for a network connection.

Thanks for making this package available btw.

Confirmation Checklist

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the snowflake-proxy init script and its start_service() function; reproduce the reboot case with logread and compare it with a manual restart after the WAN is available. Trace how startup ordering exposes the STUN probe to the network, then verify that NAT detection reports unrestricted after reboot without relying on a fixed sleep.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.