diff --git a/portmapper/src/upnp.rs b/portmapper/src/upnp.rs index eec16ce3..69673282 100644 --- a/portmapper/src/upnp.rs +++ b/portmapper/src/upnp.rs @@ -16,8 +16,8 @@ pub type Gateway = aigd::Gateway; use crate::{Protocol, defaults::UPNP_SEARCH_TIMEOUT as SEARCH_TIMEOUT}; -/// Seconds we ask the router to maintain the port mapping. 0 means infinite. -const PORT_MAPPING_LEASE_DURATION_SECONDS: u32 = 0; +/// Seconds we ask the router to maintain the port mapping. Use 2 hours for now. +const PORT_MAPPING_LEASE_DURATION_SECONDS: u32 = 2 * 60 * 60; /// Tailscale uses the recommended port mapping lifetime for PMP, which is 2 hours. So we assume a /// half lifetime of 1h. See