client, server: configurable MTU via --mtu
ex: innernet --mtu 1400 up foobarnet Closes #102pull/121/head
parent
2fa7524def
commit
d431953353
|
@ -384,6 +384,10 @@ pub struct NetworkOpt {
|
||||||
/// Specify a WireGuard backend to use.
|
/// Specify a WireGuard backend to use.
|
||||||
/// If not set, innernet will auto-select based on availability.
|
/// If not set, innernet will auto-select based on availability.
|
||||||
pub backend: Backend,
|
pub backend: Backend,
|
||||||
|
|
||||||
|
#[structopt(long, default_value = "1420")]
|
||||||
|
/// Specify the desired MTU for your interface.
|
||||||
|
pub mtu: u32,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq)]
|
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq)]
|
||||||
|
|
|
@ -85,7 +85,7 @@ pub fn up(
|
||||||
.set_private_key(wgctrl::Key::from_base64(&private_key).unwrap())
|
.set_private_key(wgctrl::Key::from_base64(&private_key).unwrap())
|
||||||
.apply(interface, network.backend)?;
|
.apply(interface, network.backend)?;
|
||||||
set_addr(interface, address)?;
|
set_addr(interface, address)?;
|
||||||
set_up(interface, 1420)?;
|
set_up(interface, network.mtu)?;
|
||||||
if !network.no_routing {
|
if !network.no_routing {
|
||||||
add_route(interface, address)?;
|
add_route(interface, address)?;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue