bubuntux / nordlynx

GNU General Public License v3.0
192 stars 43 forks source link

No connectivity even though logs show connected in WSL2 #108

Closed imthenachoman closed 1 year ago

imthenachoman commented 1 year ago
:warning: Make sure to follow the template, troubleshoot on your own first, review Open/Closed Issues, Discussions, Wiki and consider creating a discussion thread instead. :warning:

Describe the bug

The container logs show connected but when I go into the container I am not able to do anything, including curl or ping.

To Reproduce using docker CLI

docker run -d \
    --name=nordlynx \
    --cap-add=NET_ADMIN \
    --sysctl net.ipv4.conf.all.src_valid_mark=1 \
    --sysctl net.ipv6.conf.all.disable_ipv6=1 \
    -e PRIVATE_KEY="..." \
    -e QUERY="filters\[servers_groups\]\[identifier\]=legacy_p2p" \
    -e NET_LOCAL="192.168.0.0/16" \
    --dns=103.86.96.100 \
    --dns=103.86.99.100 \
    --restart unless-stopped \
    ghcr.io/bubuntux/nordlynx

Expected behavior

Container should be connected to VPN.

Logs

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service 00-legacy: starting
s6-rc: info: service 00-legacy successfully started
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
cont-init: info: running /etc/cont-init.d/00-firewall
cont-init: info: /etc/cont-init.d/00-firewall exited 0
cont-init: info: running /etc/cont-init.d/01-envfile
cont-init: info: /etc/cont-init.d/01-envfile exited 0
cont-init: info: running /etc/cont-init.d/01-migrations
cont-init: info: /etc/cont-init.d/01-migrations exited 0
cont-init: info: running /etc/cont-init.d/10-adduser
[custom-init] No custom services found, skipping...
[2022-11-10T03:41:04+00:00] Firewall is up, everything has to go through the vpn
[migrations] started
[migrations] no migrations found
usermod: no changes

-------------------------------------
          _         ()
2022-11-10T03:41:04.954347900Z |  ___   _    __
2022-11-10T03:41:04.954354400Z | / __| | |  /  \
2022-11-10T03:41:04.954360600Z | \__ \ | | | () |
         |_| |___/ |_|  \__/

Brought to you by linuxserver.io
-------------------------------------

To support the app dev(s) visit:
Bubuntux: https://github.com/sponsors/bubuntux
WireGuard: https://www.wireguard.com/donations/
To support LSIO projects visit:
https://www.linuxserver.io/donate/
cont-init: info: /etc/cont-init.d/10-adduser exited 0
cont-init: info: running /etc/cont-init.d/10-validate
cont-init: info: /etc/cont-init.d/10-validate exited 0
cont-init: info: running /etc/cont-init.d/20-inet
cont-init: info: /etc/cont-init.d/20-inet exited 0
cont-init: info: running /etc/cont-init.d/20-inet6
cont-init: info: /etc/cont-init.d/20-inet6 exited 0
cont-init: info: running /etc/cont-init.d/30-route
cont-init: info: /etc/cont-init.d/30-route exited 0
cont-init: info: running /etc/cont-init.d/30-route6
cont-init: info: /etc/cont-init.d/30-route6 exited 0
-------------------------------------
GID/UID
-------------------------------------

User uid:    911
User gid:    911
-------------------------------------

[2022-11-10T03:41:05+00:00] Enabling connection to eth0 172.17.0.2/16
[2022-11-10T03:41:05+00:00] Enabling connection to secure interfaces
[2022-11-10T03:41:05+00:00] No interface network6 detected
[2022-11-10T03:41:05+00:00] Enabling connection to network 192.168.0.0/16
[custom-init] No custom files found, skipping...
[ls.io-init] done.
[2022-11-10T03:41:05+00:00] Finding the best server...
[2022-11-10T03:41:05+00:00] Using server: {
  "id": 956996,
  "created_at": "2020-03-23 10:36:49",
  "updated_at": "2022-11-10 03:32:19",
  "name": "United States #5104",
  "station": "86.107.55.242",
  "ipv6_station": "",
  "hostname": "us5104.nordvpn.com",
  "load": 7,
  "status": "online",
  "cpt": 42,
  "locations": [
    {
      "id": 305,
      "created_at": "2017-06-15 14:06:47",
      "updated_at": "2017-06-15 14:06:47",
      "latitude": 40.7141667,
      "longitude": -74.0063889,
      "country": {
        "id": 228,
        "name": "United States",
        "code": "US",
        "city": {
          "id": 8971718,
          "name": "New York",
cont-init: info: running /etc/cont-init.d/40-allowlist
cont-init: info: /etc/cont-init.d/40-allowlist exited 0
cont-init: info: running /etc/cont-init.d/99-custom-files
cont-init: info: /etc/cont-init.d/99-custom-files exited 0
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service init-mods: starting
s6-rc: info: service init-mods successfully started
s6-rc: info: service init-mods-package-install: starting
s6-rc: info: service init-mods-package-install successfully started
s6-rc: info: service init-mods-end: starting
s6-rc: info: service init-mods-end successfully started
s6-rc: info: service init-services: starting
s6-rc: info: service init-services successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun wireguard (no readiness notification)
s6-rc: info: service legacy-services successfully started
s6-rc: info: service 99-ci-service-check: starting
s6-rc: info: service 99-ci-service-check successfully started
          "latitude": 40.7141667,
          "longitude": -74.0063889,
          "dns_name": "new-york",
          "hub_score": 0
        }
      }
    }
  ],
  "groups": [
    {
      "id": 11,
      "created_at": "2017-06-13 13:43:00",
      "updated_at": "2017-06-13 13:43:00",
      "title": "Standard VPN servers",
      "identifier": "legacy_standard",
      "type": {
        "id": 3,
        "created_at": "2017-06-13 13:40:17",
        "updated_at": "2017-06-13 13:40:23",
        "title": "Legacy category",
        "identifier": "legacy_group_category"
      }
    },
    {
      "id": 15,
      "created_at": "2017-06-13 13:43:38",
      "updated_at": "2017-06-13 13:43:38",
      "title": "P2P",
      "identifier": "legacy_p2p",
      "type": {
        "id": 3,
        "created_at": "2017-06-13 13:40:17",
        "updated_at": "2017-06-13 13:40:23",
        "title": "Legacy category",
        "identifier": "legacy_group_category"
      }
    },
    {
      "id": 21,
      "created_at": "2017-10-27 14:23:03",
      "updated_at": "2017-10-30 08:09:48",
      "title": "The Americas",
      "identifier": "the_americas",
      "type": {
        "id": 5,
        "created_at": "2017-10-27 14:16:30",
        "updated_at": "2017-10-27 14:16:30",
        "title": "Regions",
        "identifier": "regions"
      }
    }
  ],
  "specifications": [
    {
      "id": 8,
      "title": "Version",
      "identifier": "version",
      "values": [
        {
          "id": 257,
          "value": "2.1.0"
        }
      ]
    }
  ],
  "ips": [
    {
      "id": 439076,
      "created_at": "2021-12-08 11:15:30",
      "updated_at": "2021-12-08 11:15:30",
      "server_id": 956996,
      "ip_id": 109169,
      "type": "entry",
      "ip": {
        "id": 109169,
        "ip": "86.107.55.242",
        "version": 4
      }
    }
  ]
}
[2022-11-10T03:41:05+00:00] Connecting...
[#] 
[#] ip link add wg0 type wireguard
[#] wg setconf wg0 /dev/fd/63
[#] ip -4 address add 10.5.0.2/32 dev wg0
[#] ip link set mtu 1420 up dev wg0
[#] resolvconf -a wg0 -m 0 -x
[#] wg set wg0 fwmark 51820
[#] ip -4 route add 0.0.0.0/0 dev wg0 table 51820
[#] ip -4 rule add not fwmark 51820 table 51820
[#] ip -4 rule add table main suppress_prefixlength 0
[#] iptables-restore -n
iptables-restore v1.8.7 (legacy): unknown option "--save-mark"
Error occurred at line: 5
Try `iptables-restore -h' or 'iptables-restore --help' for more information.
[#] resolvconf -d wg0 -f
[#] ip -4 rule delete table 51820
[#] ip -4 rule delete table main suppress_prefixlength 0
[#] ip link delete dev wg0
[2022-11-10T03:41:06+00:00] Connected! \(ᵔᵕᵔ)/

Additional context

I am doing this on Windows 10 running WSL2 in Debian.

image

momo57420 commented 1 year ago

Hi there, that's normal. You have to compile the kernel of your WSL distribution. https://github.com/bubuntux/nordlynx/issues/81

imthenachoman commented 1 year ago

I see. Thank you!