Skip to content

Commit

Permalink
tun up
Browse files Browse the repository at this point in the history
  • Loading branch information
ibigbug committed Sep 16, 2023
1 parent be0b422 commit 709c932
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 16 deletions.
2 changes: 1 addition & 1 deletion clash/tests/data/config/rules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ socks-port: 8889
mixed-port: 8899

tun:
enable: false
enable: true
device-id: "dev://utun1989"

dns:
Expand Down
1 change: 0 additions & 1 deletion clash_lib/src/proxy/transport/tls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use std::{io, sync::Arc};
use rustls::{ClientConfig, OwnedTrustAnchor, RootCertStore, ServerName};
use serde::Serialize;
use tokio_rustls::TlsConnector;
use tracing::warn;

use crate::{common::tls, proxy::AnyStream};

Expand Down
15 changes: 1 addition & 14 deletions clash_lib/src/proxy/tun/inbound.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,20 +162,7 @@ pub fn get_runner(
}
}

let network = cfg
.network
.as_ref()
.unwrap_or(&"198.19.0.0/16".to_owned())
.parse::<ipnet::IpNet>()?;

tun_cfg
.address(
network.hosts().nth(0).expect(
format!("tun network {:?} doesn't contain any address", cfg.network).as_str(),
),
)
.netmask(network.netmask())
.up();
tun_cfg.up();

let tun = tun::create_as_async(&tun_cfg).map_err(map_io_error)?;

Expand Down

0 comments on commit 709c932

Please sign in to comment.