Skip to content

Commit

Permalink
minor change
Browse files Browse the repository at this point in the history
  • Loading branch information
e1732a364fed committed Jan 1, 2099
1 parent 1e04f65 commit d0e7949
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion resource/remote.lua
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ Config = {

out_auto_route = {
tun_dev_name = "utun321",
original_dev_name = "enp0s1",
original_dev_name = "enp0s1", --wlp3s0
router_ip = "192.168.0.1",
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/net/tun/route.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,10 @@ pub fn out_auto_route(params: &OutAutoRouteParams) -> anyhow::Result<()> {

// ip_forward is NECESSARY

let _r = utils::run_command("ip", "route del default");

let list = format!(
r#"sysctl -w net.ipv4.ip_forward=1
ip route del default
ip route add default via {router_ip} dev {original_dev_name}
iptables -I FORWARD -i {tun_dev_name} -o {original_dev_name} -m conntrack --ctstate NEW -j ACCEPT
iptables -I FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
Expand Down

0 comments on commit d0e7949

Please sign in to comment.