parent
4a458a413c
commit
d6ab8e6653
|
@ -385,9 +385,9 @@ pub struct NetworkOpt {
|
|||
/// If not set, innernet will auto-select based on availability.
|
||||
pub backend: Backend,
|
||||
|
||||
#[structopt(long, default_value = "1420")]
|
||||
/// Specify the desired MTU for your interface.
|
||||
pub mtu: u32,
|
||||
#[structopt(long)]
|
||||
/// Specify the desired MTU for your interface (default: 1420 for IPv4 and 1400 for IPv6).
|
||||
pub mtu: Option<u32>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq)]
|
||||
|
|
|
@ -85,7 +85,7 @@ pub fn up(
|
|||
.set_private_key(wgctrl::Key::from_base64(&private_key).unwrap())
|
||||
.apply(interface, network.backend)?;
|
||||
set_addr(interface, address)?;
|
||||
set_up(interface, network.mtu)?;
|
||||
set_up(interface, network.mtu.unwrap_or_else(|| if address.is_ipv4() { 1420 } else { 1400 }))?;
|
||||
if !network.no_routing {
|
||||
add_route(interface, address)?;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue