diff --git a/shared/src/types.rs b/shared/src/types.rs index a1e80b6..fb028a6 100644 --- a/shared/src/types.rs +++ b/shared/src/types.rs @@ -384,6 +384,10 @@ pub struct NetworkOpt { /// Specify a WireGuard backend to use. /// 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, } #[derive(Debug, Clone, Deserialize, Serialize, PartialEq)] diff --git a/shared/src/wg.rs b/shared/src/wg.rs index 4f32722..7a54952 100644 --- a/shared/src/wg.rs +++ b/shared/src/wg.rs @@ -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, 1420)?; + set_up(interface, network.mtu)?; if !network.no_routing { add_route(interface, address)?; }