windows changes testr
This commit is contained in:
@@ -114,6 +114,11 @@ pub fn setup_platform_routing(remote_address: &str) -> io::Result<()> {
|
|||||||
{
|
{
|
||||||
let gateway = get_default_gateway().unwrap_or_else(|| "192.168.1.1".to_string());
|
let gateway = get_default_gateway().unwrap_or_else(|| "192.168.1.1".to_string());
|
||||||
|
|
||||||
|
let if_idx = get_active_interface_index().unwrap_or(0);
|
||||||
|
if if_idx == 0 {
|
||||||
|
warn!("Could not find active interface index, routing might fail.");
|
||||||
|
}
|
||||||
|
|
||||||
let _ = run_cmd_ext(
|
let _ = run_cmd_ext(
|
||||||
&format!(
|
&format!(
|
||||||
"route add {} mask 255.255.255.255 {} metric 1",
|
"route add {} mask 255.255.255.255 {} metric 1",
|
||||||
@@ -137,14 +142,15 @@ pub fn setup_platform_routing(remote_address: &str) -> io::Result<()> {
|
|||||||
true,
|
true,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// 3. DNS
|
||||||
let _ = run_cmd_ext(
|
let _ = run_cmd_ext(
|
||||||
&format!("netsh interface ipv4 set dnsservers name=\"netr0\" static 10.0.0.2 primary"),
|
&format!("netsh interface ipv4 set dnsservers name=\"netr0\" static 10.0.0.2 primary"),
|
||||||
true,
|
true,
|
||||||
);
|
);
|
||||||
|
|
||||||
info!(
|
info!(
|
||||||
"Full tunneling configured: Internet via netr0, Proxy Exception via {}",
|
"Full tunneling configured: Internet via netr0 (if {}), Proxy Exception via {}",
|
||||||
gateway
|
if_idx, gateway
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user