github.com/tailscale/wireguard-go@v0.0.20201119-0.20210522003738-46b531feb08a/README.md (about)

     1  # DO NOT USE
     2  
     3  This is a temporary fork of wireguard-go. It is being eliminated.
     4  
     5  ---
     6  
     7  # Go Implementation of [WireGuard](https://www.wireguard.com/)
     8  
     9  This is an implementation of WireGuard in Go.
    10  
    11  ## Usage
    12  
    13  Most Linux kernel WireGuard users are used to adding an interface with `ip link add wg0 type wireguard`. With wireguard-go, instead simply run:
    14  
    15  ```
    16  $ wireguard-go wg0
    17  ```
    18  
    19  This will create an interface and fork into the background. To remove the interface, use the usual `ip link del wg0`, or if your system does not support removing interfaces directly, you may instead remove the control socket via `rm -f /var/run/wireguard/wg0.sock`, which will result in wireguard-go shutting down.
    20  
    21  To run wireguard-go without forking to the background, pass `-f` or `--foreground`:
    22  
    23  ```
    24  $ wireguard-go -f wg0
    25  ```
    26  
    27  When an interface is running, you may use [`wg(8)`](https://git.zx2c4.com/wireguard-tools/about/src/man/wg.8) to configure it, as well as the usual `ip(8)` and `ifconfig(8)` commands.
    28  
    29  To run with more logging you may set the environment variable `LOG_LEVEL=debug`.
    30  
    31  ## Platforms
    32  
    33  ### Linux
    34  
    35  This will run on Linux; however you should instead use the kernel module, which is faster and better integrated into the OS. See the [installation page](https://www.wireguard.com/install/) for instructions.
    36  
    37  ### macOS
    38  
    39  This runs on macOS using the utun driver. It does not yet support sticky sockets, and won't support fwmarks because of Darwin limitations. Since the utun driver cannot have arbitrary interface names, you must either use `utun[0-9]+` for an explicit interface name or `utun` to have the kernel select one for you. If you choose `utun` as the interface name, and the environment variable `WG_TUN_NAME_FILE` is defined, then the actual name of the interface chosen by the kernel is written to the file specified by that variable.
    40  
    41  ### Windows
    42  
    43  This runs on Windows, but you should instead use it from the more [fully featured Windows app](https://git.zx2c4.com/wireguard-windows/about/), which uses this as a module.
    44  
    45  ### FreeBSD
    46  
    47  This will run on FreeBSD. It does not yet support sticky sockets. Fwmark is mapped to `SO_USER_COOKIE`.
    48  
    49  ### OpenBSD
    50  
    51  This will run on OpenBSD. It does not yet support sticky sockets. Fwmark is mapped to `SO_RTABLE`. Since the tun driver cannot have arbitrary interface names, you must either use `tun[0-9]+` for an explicit interface name or `tun` to have the program select one for you. If you choose `tun` as the interface name, and the environment variable `WG_TUN_NAME_FILE` is defined, then the actual name of the interface chosen by the kernel is written to the file specified by that variable.
    52  
    53  ## Building
    54  
    55  This requires an installation of [go](https://golang.org) ≥ 1.16.
    56  
    57  ```
    58  $ git clone https://git.zx2c4.com/wireguard-go
    59  $ cd wireguard-go
    60  $ make
    61  ```
    62  
    63  ## License
    64  
    65      Copyright (C) 2017-2021 WireGuard LLC. All Rights Reserved.
    66      
    67      Permission is hereby granted, free of charge, to any person obtaining a copy of
    68      this software and associated documentation files (the "Software"), to deal in
    69      the Software without restriction, including without limitation the rights to
    70      use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
    71      of the Software, and to permit persons to whom the Software is furnished to do
    72      so, subject to the following conditions:
    73      
    74      The above copyright notice and this permission notice shall be included in all
    75      copies or substantial portions of the Software.
    76      
    77      THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    78      IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    79      FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    80      AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    81      LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    82      OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
    83      SOFTWARE.