Add Support for IPV6 and Arbitrary Server Address
Add IPV6 support for Apple Devices Note: Works in GUI not CLI Adds Support for Arbitrary Server Address
This commit is contained in:
parent
cca5999214
commit
2088ae6ede
20 changed files with 276 additions and 56 deletions
|
|
@ -57,7 +57,7 @@ impl TryFrom<&TunInterface> for ServerInfo {
|
|||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, JsonSchema)]
|
||||
pub struct ServerConfig {
|
||||
pub address: Option<String>,
|
||||
pub address: Vec<String>,
|
||||
pub name: Option<String>,
|
||||
pub mtu: Option<i32>,
|
||||
}
|
||||
|
|
@ -65,7 +65,7 @@ pub struct ServerConfig {
|
|||
impl Default for ServerConfig {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
address: Some("10.13.13.2".to_string()), // Dummy remote address
|
||||
address: vec!["10.13.13.2".to_string()], // Dummy remote address
|
||||
name: None,
|
||||
mtu: None,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,4 +2,4 @@
|
|||
source: burrow/src/daemon/command.rs
|
||||
expression: "serde_json::to_string(&DaemonCommand::Start(DaemonStartOptions {\n tun: TunOptions { ..TunOptions::default() },\n })).unwrap()"
|
||||
---
|
||||
{"Start":{"tun":{"name":null,"no_pi":false,"tun_excl":false,"tun_retrieve":false,"address":null}}}
|
||||
{"Start":{"tun":{"name":null,"no_pi":false,"tun_excl":false,"tun_retrieve":false,"address":[]}}}
|
||||
|
|
|
|||
|
|
@ -2,4 +2,4 @@
|
|||
source: burrow/src/daemon/command.rs
|
||||
expression: "serde_json::to_string(&DaemonCommand::Start(DaemonStartOptions::default())).unwrap()"
|
||||
---
|
||||
{"Start":{"tun":{"name":null,"no_pi":false,"tun_excl":false,"tun_retrieve":false,"address":null}}}
|
||||
{"Start":{"tun":{"name":null,"no_pi":false,"tun_excl":false,"tun_retrieve":false,"address":[]}}}
|
||||
|
|
|
|||
|
|
@ -2,4 +2,4 @@
|
|||
source: burrow/src/daemon/response.rs
|
||||
expression: "serde_json::to_string(&DaemonResponse::new(Ok::<DaemonResponseData,\n String>(DaemonResponseData::ServerConfig(ServerConfig::default()))))?"
|
||||
---
|
||||
{"result":{"Ok":{"ServerConfig":{"address":"10.13.13.2","name":null,"mtu":null}}},"id":0}
|
||||
{"result":{"Ok":{"ServerConfig":{"address":["10.13.13.2"],"name":null,"mtu":null}}},"id":0}
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ async fn try_start() -> Result<()> {
|
|||
let mut client = DaemonClient::new().await?;
|
||||
client
|
||||
.send_command(DaemonCommand::Start(DaemonStartOptions {
|
||||
tun: TunOptions::new().address("10.13.13.2"),
|
||||
tun: TunOptions::new().address(vec!["10.13.13.2", "::2"]),
|
||||
}))
|
||||
.await
|
||||
.map(|_| ())
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ pub fn initialize() {
|
|||
tracing_subscriber::fmt::layer()
|
||||
.with_level(true)
|
||||
.with_writer(std::io::stderr)
|
||||
.with_line_number(true)
|
||||
.compact()
|
||||
.with_filter(EnvFilter::from_default_env())
|
||||
});
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ pub struct Peer {
|
|||
|
||||
pub struct Interface {
|
||||
pub private_key: String,
|
||||
pub address: String,
|
||||
pub address: Vec<String>,
|
||||
pub listen_port: u32,
|
||||
pub dns: Vec<String>,
|
||||
pub mtu: Option<u32>,
|
||||
|
|
@ -93,8 +93,8 @@ impl Default for Config {
|
|||
fn default() -> Self {
|
||||
Self {
|
||||
interface: Interface {
|
||||
private_key: "GNqIAOCRxjl/cicZyvkvpTklgQuUmGUIEkH7IXF/sEE=".into(),
|
||||
address: "10.13.13.2/24".into(),
|
||||
private_key: "OEPVdomeLTxTIBvv3TYsJRge0Hp9NMiY0sIrhT8OWG8=".into(),
|
||||
address: vec!["10.13.13.2/24".into()],
|
||||
listen_port: 51820,
|
||||
dns: Default::default(),
|
||||
mtu: Default::default(),
|
||||
|
|
@ -102,8 +102,8 @@ impl Default for Config {
|
|||
peers: vec![Peer {
|
||||
endpoint: "wg.burrow.rs:51820".into(),
|
||||
allowed_ips: vec!["8.8.8.8/32".into(), "0.0.0.0/0".into()],
|
||||
public_key: "uy75leriJay0+oHLhRMpV+A5xAQ0hCJ+q7Ww81AOvT4=".into(),
|
||||
preshared_key: Some("s7lx/mg+reVEMnGnqeyYOQkzD86n2+gYnx1M9ygi08k=".into()),
|
||||
public_key: "8GaFjVO6c4luCHG4ONO+1bFG8tO+Zz5/Gy+Geht1USM=".into(),
|
||||
preshared_key: Some("ha7j4BjD49sIzyF9SNlbueK0AMHghlj6+u0G3bzC698=".into()),
|
||||
persistent_keepalive: Default::default(),
|
||||
name: Default::default(),
|
||||
}],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue