shared: set default mtu of 1280

pull/202/head
Jake McGinty 2022-03-15 11:01:26 +09:00
parent e544391303
commit 5e645ef9f5
2 changed files with 2 additions and 2 deletions

View File

@ -471,7 +471,7 @@ pub struct NetworkOpts {
pub backend: Backend,
#[clap(long)]
/// Specify the desired MTU for your interface (default: 1420 for IPv4 and 1400 for IPv6).
/// Specify the desired MTU for your interface (default: 1280).
pub mtu: Option<u32>,
}

View File

@ -100,7 +100,7 @@ pub fn up(
.set_private_key(wireguard_control::Key::from_base64(private_key).unwrap())
.apply(interface, network.backend)?;
set_addr(interface, address)?;
set_up(interface, network.mtu.unwrap_or(1412))?;
set_up(interface, network.mtu.unwrap_or(1280))?;
if !network.no_routing {
add_route(interface, address)?;
}