-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Description
I did look on the code, but I could not find anything, is there any way to set the FwMark value like in the wg0.conf file?
[Interface]
PrivateKey = xxxxxxxxxxxxxxxxx
Address = 10.10.10.2/24
ListenPort = 51820
FwMark = 0x10
Currently I made this workaround, but I don't like it 😆
fn configure_wg_fwmark(interface_name: &str, fwmark: u32) -> Result<(), Box<dyn std::error::Error>> {
let output = Command::new("wg")
.args(["set", interface_name, "fwmark", &fwmark.to_string()])
.output()?;
if !output.status.success() {
let error_msg = String::from_utf8_lossy(&output.stderr);
return Err(format!("Failed to set fwmark: {error_msg}").into());
}
Ok(())
}
rsoodla
Metadata
Metadata
Assignees
Labels
No labels