modified: src/client.rs
modified: src/server.rs
This commit is contained in:
parent
5831be033b
commit
fbb594de97
@ -16,9 +16,10 @@ use crate::udp::{UDPVpnPacket, UDPVpnHandshake, UDPSerializable};
|
|||||||
|
|
||||||
fn configure_routes() {
|
fn configure_routes() {
|
||||||
let ip_output = Command::new("ip")
|
let ip_output = Command::new("ip")
|
||||||
.arg("addr")
|
.arg("-4")
|
||||||
|
.arg("address")
|
||||||
.arg("add")
|
.arg("add")
|
||||||
.arg("10.8.0.2/24")
|
.arg("10.66.66.2/32")
|
||||||
.arg("dev")
|
.arg("dev")
|
||||||
.arg("tun0")
|
.arg("tun0")
|
||||||
.output()
|
.output()
|
||||||
@ -32,6 +33,8 @@ fn configure_routes() {
|
|||||||
let link_output = Command::new("ip")
|
let link_output = Command::new("ip")
|
||||||
.arg("link")
|
.arg("link")
|
||||||
.arg("set")
|
.arg("set")
|
||||||
|
.arg("mtu")
|
||||||
|
.arg("1420")
|
||||||
.arg("up")
|
.arg("up")
|
||||||
.arg("dev")
|
.arg("dev")
|
||||||
.arg("tun0")
|
.arg("tun0")
|
||||||
|
@ -108,6 +108,7 @@ pub async fn server_mode(server_config: ServerConfiguration) {
|
|||||||
|
|
||||||
loop {
|
loop {
|
||||||
if let Ok((len, addr)) = sock_rec.recv_from(&mut buf).await {
|
if let Ok((len, addr)) = sock_rec.recv_from(&mut buf).await {
|
||||||
|
info!("There is packet!");
|
||||||
let mut mp = addrs_lp.lock().await;
|
let mut mp = addrs_lp.lock().await;
|
||||||
let plp = peers_lp.lock().await;
|
let plp = peers_lp.lock().await;
|
||||||
match buf.first() {
|
match buf.first() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user