diff --git a/core/src/net/gateway.rs b/core/src/net/gateway.rs
index ee0e9b4dc..7ebcc12eb 100644
--- a/core/src/net/gateway.rs
+++ b/core/src/net/gateway.rs
@@ -241,11 +241,19 @@ pub async fn check_port(
.await
.map_or(false, |r| r.is_ok());
+ let local_ipv4 = ip_info
+ .subnets
+ .iter()
+ .find_map(|s| match s.addr() {
+ IpAddr::V4(v4) => Some(v4),
+ _ => None,
+ })
+ .unwrap_or(Ipv4Addr::UNSPECIFIED);
let client = reqwest::Client::builder();
#[cfg(target_os = "linux")]
let client = client
.interface(gateway.as_str())
- .local_address(IpAddr::V4(Ipv4Addr::UNSPECIFIED));
+ .local_address(IpAddr::V4(local_ipv4));
let client = client.build()?;
let mut res = None;
@@ -784,12 +792,16 @@ async fn watcher(
}
}
-async fn get_wan_ipv4(iface: &str, base_url: &Url) -> Result