2024-11-22 04:59:26 +00:00
|
|
|
---
|
|
|
|
icon: material/delete-clock
|
|
|
|
---
|
|
|
|
|
|
|
|
!!! failure "Deprecated in sing-box 1.11.0"
|
|
|
|
|
|
|
|
WireGuard outbound is deprecated and will be removed in sing-box 1.13.0, check [Migration](/migration/#migrate-wireguard-outbound-to-endpoint).
|
|
|
|
|
2024-11-22 09:41:19 +00:00
|
|
|
!!! quote "Changes in sing-box 1.11.0"
|
|
|
|
|
|
|
|
:material-delete-alert: [gso](#gso)
|
|
|
|
|
2023-12-20 12:00:00 +00:00
|
|
|
!!! quote "Changes in sing-box 1.8.0"
|
|
|
|
|
|
|
|
:material-plus: [gso](#gso)
|
|
|
|
|
2022-08-17 07:19:10 +00:00
|
|
|
### Structure
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
2022-08-31 05:21:29 +00:00
|
|
|
"type": "wireguard",
|
|
|
|
"tag": "wireguard-out",
|
|
|
|
|
|
|
|
"server": "127.0.0.1",
|
|
|
|
"server_port": 1080,
|
2022-09-09 07:40:35 +00:00
|
|
|
"system_interface": false,
|
|
|
|
"interface_name": "wg0",
|
2022-08-31 05:21:29 +00:00
|
|
|
"local_address": [
|
2024-11-22 04:59:26 +00:00
|
|
|
"10.0.0.1/32"
|
2022-08-31 05:21:29 +00:00
|
|
|
],
|
|
|
|
"private_key": "YNXtAzepDqRv9H52osJVDQnznT5AM11eCK3ESpwSt04=",
|
2023-03-31 04:31:26 +00:00
|
|
|
"peers": [
|
|
|
|
{
|
|
|
|
"server": "127.0.0.1",
|
|
|
|
"server_port": 1080,
|
|
|
|
"public_key": "Z1XXLsKYkYxuiYjJIkRvtIKFepCYHTgON+GwPq7SOV4=",
|
|
|
|
"pre_shared_key": "31aIhAPwktDGpH4JDhA8GNvjFXEf/a6+UaQRyOAiyfM=",
|
|
|
|
"allowed_ips": [
|
|
|
|
"0.0.0.0/0"
|
|
|
|
],
|
|
|
|
"reserved": [0, 0, 0]
|
|
|
|
}
|
|
|
|
],
|
2022-08-31 05:21:29 +00:00
|
|
|
"peer_public_key": "Z1XXLsKYkYxuiYjJIkRvtIKFepCYHTgON+GwPq7SOV4=",
|
|
|
|
"pre_shared_key": "31aIhAPwktDGpH4JDhA8GNvjFXEf/a6+UaQRyOAiyfM=",
|
2022-10-29 10:00:05 +00:00
|
|
|
"reserved": [0, 0, 0],
|
2022-11-07 08:35:15 +00:00
|
|
|
"workers": 4,
|
2022-08-31 05:21:29 +00:00
|
|
|
"mtu": 1408,
|
|
|
|
"network": "tcp",
|
|
|
|
|
2024-11-22 09:41:19 +00:00
|
|
|
// Deprecated
|
|
|
|
|
|
|
|
"gso": false,
|
|
|
|
|
2022-08-31 05:21:29 +00:00
|
|
|
... // Dial Fields
|
2022-08-17 07:19:10 +00:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2022-08-31 05:21:29 +00:00
|
|
|
### Fields
|
2022-08-17 07:19:10 +00:00
|
|
|
|
|
|
|
#### server
|
|
|
|
|
2023-03-31 04:31:26 +00:00
|
|
|
==Required if multi-peer disabled==
|
2022-08-17 07:19:10 +00:00
|
|
|
|
|
|
|
The server address.
|
|
|
|
|
|
|
|
#### server_port
|
|
|
|
|
2023-03-31 04:31:26 +00:00
|
|
|
==Required if multi-peer disabled==
|
2022-08-17 07:19:10 +00:00
|
|
|
|
|
|
|
The server port.
|
|
|
|
|
2022-09-09 07:40:35 +00:00
|
|
|
#### system_interface
|
|
|
|
|
2023-12-20 12:00:00 +00:00
|
|
|
Use system interface.
|
2022-09-09 07:40:35 +00:00
|
|
|
|
2023-12-20 12:00:00 +00:00
|
|
|
Requires privilege and cannot conflict with exists system interfaces.
|
2022-09-15 04:20:38 +00:00
|
|
|
|
|
|
|
Forced if gVisor not included in the build.
|
2022-09-09 07:40:35 +00:00
|
|
|
|
|
|
|
#### interface_name
|
|
|
|
|
2023-12-20 12:00:00 +00:00
|
|
|
Custom interface name for system interface.
|
|
|
|
|
|
|
|
#### gso
|
|
|
|
|
2024-11-22 09:41:19 +00:00
|
|
|
!!! failure "Deprecated in sing-box 1.11.0"
|
|
|
|
|
|
|
|
GSO will be automatically enabled when available since sing-box 1.11.0.
|
|
|
|
|
2023-12-20 12:00:00 +00:00
|
|
|
!!! question "Since sing-box 1.8.0"
|
|
|
|
|
|
|
|
!!! quote ""
|
|
|
|
|
|
|
|
Only supported on Linux.
|
|
|
|
|
|
|
|
Try to enable generic segmentation offload.
|
2022-09-09 07:40:35 +00:00
|
|
|
|
2022-08-17 07:19:10 +00:00
|
|
|
#### local_address
|
|
|
|
|
|
|
|
==Required==
|
|
|
|
|
2022-09-05 16:15:09 +00:00
|
|
|
List of IP (v4 or v6) address prefixes to be assigned to the interface.
|
2022-08-17 07:19:10 +00:00
|
|
|
|
|
|
|
#### private_key
|
|
|
|
|
|
|
|
==Required==
|
|
|
|
|
|
|
|
WireGuard requires base64-encoded public and private keys. These can be generated using the wg(8) utility:
|
|
|
|
|
|
|
|
```shell
|
|
|
|
wg genkey
|
|
|
|
echo "private key" || wg pubkey
|
|
|
|
```
|
|
|
|
|
2023-03-31 04:31:26 +00:00
|
|
|
#### peers
|
|
|
|
|
|
|
|
Multi-peer support.
|
|
|
|
|
|
|
|
If enabled, `server, server_port, peer_public_key, pre_shared_key` will be ignored.
|
|
|
|
|
|
|
|
#### peers.allowed_ips
|
|
|
|
|
|
|
|
WireGuard allowed IPs.
|
|
|
|
|
|
|
|
#### peers.reserved
|
|
|
|
|
|
|
|
WireGuard reserved field bytes.
|
|
|
|
|
|
|
|
`$outbound.reserved` will be used if empty.
|
|
|
|
|
2022-08-17 07:19:10 +00:00
|
|
|
#### peer_public_key
|
|
|
|
|
2023-03-31 04:31:26 +00:00
|
|
|
==Required if multi-peer disabled==
|
2022-08-17 07:19:10 +00:00
|
|
|
|
|
|
|
WireGuard peer public key.
|
|
|
|
|
|
|
|
#### pre_shared_key
|
|
|
|
|
|
|
|
WireGuard pre-shared key.
|
|
|
|
|
2022-10-29 10:00:05 +00:00
|
|
|
#### reserved
|
|
|
|
|
|
|
|
WireGuard reserved field bytes.
|
|
|
|
|
2022-11-07 08:35:15 +00:00
|
|
|
#### workers
|
|
|
|
|
|
|
|
WireGuard worker count.
|
|
|
|
|
|
|
|
CPU count is used by default.
|
|
|
|
|
2022-08-17 07:19:10 +00:00
|
|
|
#### mtu
|
|
|
|
|
2022-11-07 08:35:15 +00:00
|
|
|
WireGuard MTU.
|
|
|
|
|
|
|
|
1408 will be used if empty.
|
2022-08-17 07:19:10 +00:00
|
|
|
|
|
|
|
#### network
|
|
|
|
|
|
|
|
Enabled network
|
|
|
|
|
|
|
|
One of `tcp` `udp`.
|
|
|
|
|
|
|
|
Both is enabled by default.
|
|
|
|
|
|
|
|
### Dial Fields
|
|
|
|
|
2023-12-14 14:23:52 +00:00
|
|
|
See [Dial Fields](/configuration/shared/dial/) for details.
|