mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-01 21:13:09 +00:00
misc networking fixes
This commit is contained in:
@@ -353,6 +353,7 @@ pub async fn show_config(
|
||||
Ok(client
|
||||
.client_config(
|
||||
ip,
|
||||
subnet,
|
||||
wg.as_key().de()?.verifying_key(),
|
||||
(wan_addr, wg.as_port().de()?).into(),
|
||||
)
|
||||
|
||||
@@ -7,6 +7,6 @@ PrivateKey = {privkey}
|
||||
[Peer]
|
||||
PublicKey = {server_pubkey}
|
||||
PresharedKey = {psk}
|
||||
AllowedIPs = 0.0.0.0/0,::/0
|
||||
AllowedIPs = {subnet}
|
||||
Endpoint = {server_addr}
|
||||
PersistentKeepalive = 25
|
||||
@@ -170,12 +170,14 @@ impl WgConfig {
|
||||
pub fn client_config(
|
||||
self,
|
||||
addr: Ipv4Addr,
|
||||
subnet: Ipv4Net,
|
||||
server_pubkey: Base64<PublicKey>,
|
||||
server_addr: SocketAddr,
|
||||
) -> ClientConfig {
|
||||
ClientConfig {
|
||||
client_config: self,
|
||||
client_addr: addr,
|
||||
subnet,
|
||||
server_pubkey,
|
||||
server_addr,
|
||||
}
|
||||
@@ -213,6 +215,7 @@ where
|
||||
pub struct ClientConfig {
|
||||
client_config: WgConfig,
|
||||
client_addr: Ipv4Addr,
|
||||
subnet: Ipv4Net,
|
||||
#[serde(deserialize_with = "deserialize_verifying_key")]
|
||||
server_pubkey: Base64<PublicKey>,
|
||||
server_addr: SocketAddr,
|
||||
@@ -226,6 +229,7 @@ impl std::fmt::Display for ClientConfig {
|
||||
privkey = self.client_config.key.to_padded_string(),
|
||||
psk = self.client_config.psk.to_padded_string(),
|
||||
addr = self.client_addr,
|
||||
subnet = self.subnet,
|
||||
server_pubkey = self.server_pubkey.to_padded_string(),
|
||||
server_addr = self.server_addr,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user