1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit linux-mod bash-completion-r1
8 DESCRIPTION="Required tools for WireGuard, such as wg(8) and wg-quick(8)"
9 HOMEPAGE="https://www.wireguard.com/"
11 if [[ ${PV} == 9999 ]]; then
13 EGIT_REPO_URI="https://git.zx2c4.com/wireguard-tools"
16 SRC_URI="https://git.zx2c4.com/wireguard-tools/snapshot/wireguard-tools-${PV}.tar.xz"
17 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
23 DEPEND="net-libs/libmnl"
25 || ( net-firewall/nftables net-firewall/iptables )
26 !<=net-vpn/wireguard-0.0.20191219
29 wg_quick_optional_config_nob() {
30 CONFIG_CHECK="$CONFIG_CHECK ~$1"
31 declare -g ERROR_$1="CONFIG_$1: This option is required for automatic routing of default routes inside of wg-quick(8), though it is not required for general WireGuard usage."
35 wg_quick_optional_config_nob IP_ADVANCED_ROUTER
36 wg_quick_optional_config_nob IP_MULTIPLE_TABLES
37 wg_quick_optional_config_nob NETFILTER_XT_MARK
38 wg_quick_optional_config_nob NETFILTER_XT_CONNMARK
39 wg_quick_optional_config_nob IP6_NF_RAW
40 wg_quick_optional_config_nob IP_NF_RAW
45 emake RUNSTATEDIR="${EPREFIX}/run" -C src CC="$(tc-getCC)" LD="$(tc-getLD)"
52 WITH_BASHCOMPLETION=yes \
53 WITH_SYSTEMDUNITS=yes \
56 BASHCOMPDIR="$(get_bashcompdir)" \
57 PREFIX="${EPREFIX}/usr" \
63 einfo "After installing WireGuard, if you'd like to try sending some packets through"
64 einfo "WireGuard, you may use, for testing purposes only, the insecure client.sh"
65 einfo "test example script:"
67 einfo " \$ bzcat ${ROOT}usr/share/doc/${PF}/contrib/ncat-client-server/client.sh.bz2 | sudo bash -"
69 einfo "This will automatically setup interface wg0, through a very insecure transport"
70 einfo "that is only suitable for demonstration purposes. You can then try loading the"
71 einfo "hidden website or sending pings:"
73 einfo " \$ chromium http://192.168.4.1"
74 einfo " \$ ping 192.168.4.1"
76 einfo "If you'd like to redirect your internet traffic, you can run it with the"
77 einfo "\"default-route\" argument. You may not use this server for any abusive or illegal"
78 einfo "purposes. It is for quick testing only."
80 einfo "More info on getting started can be found at: https://www.wireguard.com/quickstart/"