Hello Guest, if you are reading this it means you have not registered yet. Please take a second, Click here to register, and in a few simple steps you will be able to enjoy our community and use our OpenViX support section.
Page 1 of 2 12 LastLast
Results 1 to 15 of 24

Thread: Wireguard on enigma2

  1. #1
    dsayers's Avatar
    Title
    ViX Beta Tester
    Join Date
    Mar 2016
    Posts
    1,767
    Thanks
    473
    Thanked 608 Times in 434 Posts

    Wireguard on enigma2

    Hi I'm looking for help with setting up wireguard via VPN but I can't seem to find much documentation

    I can get the wg.conf file from keepsolid VPN.

    What I have done so far is


    Commands I have done

    opkg update && opkg install wireguard-tools

    opkg install openresolv


    This creates a folder in etc called wireguard so I added my config in there but I'm not sure what to do next

    Code:
    root@vuuno4k:~# wg-quick up wg0                                           
    
    [#] ip link add wg0 type wireguard                                       
    
    [#] wg setconf wg0 /dev/fd/63                                             
    
    [#] ip -4 address add 10.xxx.xxx.xx/32 dev wg0                           
    
    [#] ip link set mtu 1420 up dev wg0                                       
    
    [#] resolvconf -a wg0 -m 0 -x                                             /sbin/resolvconf: illegal option -- x                                     
    
    [#] wg set wg0 fwmark 51820                                               
    
    [#] ip -4 route add 0.0.0.0/0 dev wg0 table 51820                         ip: invalid argument '51820' to 'table'                                   
    
    [#] resolvconf -d wg0 -f                                                  
    
    [#] ip link delete dev wg0
    This is an example of my config

    Code:
    [Interface]
    PrivateKey = xxxxxxxx=
    ListenPort = 51820
    Address = 10.xxx.107.xxx/32
    DNS = 10.100.0.1
    
    [Peer]
    PublicKey = xxxxxxxxxx=
    PresharedKey = xxxxxxxxxx=
    AllowedIPs = 0.0.0.0/0
    Endpoint = 5.xxx.169.xxx:51820
    PersistentKeepalive = 25
    What I have noticed is openreslov maybe outdated.

    Current version on feeds openresolv (3.5.2-r0)

    I think latest is openresolv 3.12.0
    Code:
    https://guix.gnu.org/packages/openresolv-3.12.0/

  2. #2

    Title
    ViX Beta Tester
    Join Date
    May 2011
    Posts
    684
    Thanks
    56
    Thanked 237 Times in 164 Posts
    I've just tried with 6.3.001.004 (Dev) on a ZGemma H7 and got the same
    Code:
    /sbin/resolvconf: illegal option -- x
    I've found a openresolv-3.12.0-r1.apk file online and extracted the \sbin\resolvconf file and the contents of the \lib\resolvconf\ folder and put them on the box. That removes the message
    Code:
    /sbin/resolvconf: illegal option -- x
    I still get an error

    Code:
    [#] ip -4 route add 0.0.0.0/0 dev wg1784 table 51820
    ip: invalid argument '51820' to 'table'
    when using the
    Code:
    AllowedIPs = 0.0.0.0/0
    I have changed that to allow everything except the 192* range and wireguard appears to start. It allocates the interface address and adds the allowed addresses. IP checker shows the correct local address but I get no Internet, I've tried a few different endpoints on NordVPN. I can connect a GL-Net router through wireguard using the same parameters

    Here is my current config
    Code:
    [Interface]
    PrivateKey = ***********************
    ListenPort = 51820
    Address = 10.*.0.*/32
    DNS = 1.1.1.1
    
    [Peer]
    PublicKey = *******************************
    AllowedIPs = 0.0.0.0/1, 128.0.0.0/2, 193.0.0.0/8, 194.0.0.0/7, 196.0.0.0/6, 200.0.0.0/5, 208.0.0.0/4, 224.0.0.0/3
    Endpoint = uk2007.nordvpn.com:51820
    PersistentKeepalive = 25
    And the telnet output
    Code:
    root@zgemmah7:~# wg-quick up uk2007
    [#] ip link add uk2007 type wireguard
    [#] wg setconf uk2007 /dev/fd/63
    [#] ip -4 address add 10.*.0.*/32 dev uk2007
    [#] ip link set mtu 1420 up dev uk2007
    [#] resolvconf -a uk2007 -m 0 -x
    [#] ip -4 route add 193.0.0.0/8 dev uk2007
    [#] ip -4 route add 194.0.0.0/7 dev uk2007
    [#] ip -4 route add 196.0.0.0/6 dev uk2007
    [#] ip -4 route add 200.0.0.0/5 dev uk2007
    [#] ip -4 route add 208.0.0.0/4 dev uk2007
    [#] ip -4 route add 224.0.0.0/3 dev uk2007
    [#] ip -4 route add 128.0.0.0/2 dev uk2007
    [#] ip -4 route add 0.0.0.0/1 dev uk2007
    root@zgemmah7:~#
    I get this in the Enigma log which appears to show that Wireguard is not up
    Code:
    17:54:15.2057 [Network] Add new interface: uk2007
    17:54:15.2087 [Network] read configured interface: {'lo': {'dhcp': False}, 'wlan0': {'dhcp': True}, 'atml0': {'dhcp': True}, 'eth0': {'dhcp': True}, 'eth1': {'dhcp': True}, 'usb0': {'dhcp': False}, 'bnep0': {'dhcp': True}}
    17:54:15.2098 [Network] self.ifaces after loading: {'eth0': {'up': True, 'dhcp': True, 'preup': False, 'predown': False, 'ip': [192, 168, 1, 222], 'netmask': [255, 255, 255, 0], 'bcast': [192, 168, 1, 255], 'mac': '00:17:9a:23:86:fa', 'gateway': [192, 168, 1, 1]}, 'uk2007': {'up': False, 'dhcp': True, 'preup': False, 'predown': False, 'ip': [0, 0, 0, 0], 'netmask': [0, 0, 0, 0], 'gateway': [0, 0, 0, 0]}}
    That's as far as I've got and am beyond my skill level - maybe worth trying it with your keepsolid VPN config M8. I have attached the openresolv-3.12.0-r1.apk in a rar for you to try
    Attached Files Attached Files

  3. The Following User Says Thank You to lincsat For This Useful Post:

    dsayers (29-12-22)

  4. #3
    dsayers's Avatar
    Title
    ViX Beta Tester
    Join Date
    Mar 2016
    Posts
    1,767
    Thanks
    473
    Thanked 608 Times in 434 Posts
    Quote Originally Posted by lincsat View Post
    I've just tried with 6.3.001.004 (Dev) on a ZGemma H7 and got the same
    Code:
    /sbin/resolvconf: illegal option -- x
    I've found a openresolv-3.12.0-r1.apk file online and extracted the \sbin\resolvconf file and the contents of the \lib\resolvconf\ folder and put them on the box. That removes the message
    Code:
    /sbin/resolvconf: illegal option -- x
    I still get an error

    Code:
    [#] ip -4 route add 0.0.0.0/0 dev wg1784 table 51820
    ip: invalid argument '51820' to 'table'
    when using the
    Code:
    AllowedIPs = 0.0.0.0/0
    I have changed that to allow everything except the 192* range and wireguard appears to start. It allocates the interface address and adds the allowed addresses. IP checker shows the correct local address but I get no Internet, I've tried a few different endpoints on NordVPN. I can connect a GL-Net router through wireguard using the same parameters

    Here is my current config
    Code:
    [Interface]
    PrivateKey = ***********************
    ListenPort = 51820
    Address = 10.*.0.*/32
    DNS = 1.1.1.1
    
    [Peer]
    PublicKey = *******************************
    AllowedIPs = 0.0.0.0/1, 128.0.0.0/2, 193.0.0.0/8, 194.0.0.0/7, 196.0.0.0/6, 200.0.0.0/5, 208.0.0.0/4, 224.0.0.0/3
    Endpoint = uk2007.nordvpn.com:51820
    PersistentKeepalive = 25
    And the telnet output
    Code:
    root@zgemmah7:~# wg-quick up uk2007
    [#] ip link add uk2007 type wireguard
    [#] wg setconf uk2007 /dev/fd/63
    [#] ip -4 address add 10.*.0.*/32 dev uk2007
    [#] ip link set mtu 1420 up dev uk2007
    [#] resolvconf -a uk2007 -m 0 -x
    [#] ip -4 route add 193.0.0.0/8 dev uk2007
    [#] ip -4 route add 194.0.0.0/7 dev uk2007
    [#] ip -4 route add 196.0.0.0/6 dev uk2007
    [#] ip -4 route add 200.0.0.0/5 dev uk2007
    [#] ip -4 route add 208.0.0.0/4 dev uk2007
    [#] ip -4 route add 224.0.0.0/3 dev uk2007
    [#] ip -4 route add 128.0.0.0/2 dev uk2007
    [#] ip -4 route add 0.0.0.0/1 dev uk2007
    root@zgemmah7:~#
    I get this in the Enigma log which appears to show that Wireguard is not up
    Code:
    17:54:15.2057 [Network] Add new interface: uk2007
    17:54:15.2087 [Network] read configured interface: {'lo': {'dhcp': False}, 'wlan0': {'dhcp': True}, 'atml0': {'dhcp': True}, 'eth0': {'dhcp': True}, 'eth1': {'dhcp': True}, 'usb0': {'dhcp': False}, 'bnep0': {'dhcp': True}}
    17:54:15.2098 [Network] self.ifaces after loading: {'eth0': {'up': True, 'dhcp': True, 'preup': False, 'predown': False, 'ip': [192, 168, 1, 222], 'netmask': [255, 255, 255, 0], 'bcast': [192, 168, 1, 255], 'mac': '00:17:9a:23:86:fa', 'gateway': [192, 168, 1, 1]}, 'uk2007': {'up': False, 'dhcp': True, 'preup': False, 'predown': False, 'ip': [0, 0, 0, 0], 'netmask': [0, 0, 0, 0], 'gateway': [0, 0, 0, 0]}}
    That's as far as I've got and am beyond my skill level - maybe worth trying it with your keepsolid VPN config M8. I have attached the openresolv-3.12.0-r1.apk in a rar for you to try
    I get similar results.

    There is a wireguard plugin here but I don't have a VPN that it supports
    Code:
    https://www.linuxsat-support.com/thread/153852-wireguard-vpn-plugin-by-madhouse/?pageNo=1

  5. The Following User Says Thank You to dsayers For This Useful Post:

    lincsat (30-12-22)

  6. #4

    Title
    Senior Member
    Join Date
    May 2019
    Posts
    111
    Thanks
    14
    Thanked 30 Times in 27 Posts
    Quote Originally Posted by dsayers View Post
    Hi I'm looking for help with setting up wireguard via VPN but I can't seem to find much documentation

    I can get the wg.conf file from keepsolid VPN.

    What I have done so far is


    Commands I have done

    opkg update && opkg install wireguard-tools

    opkg install openresolv


    This creates a folder in etc called wireguard so I added my config in there but I'm not sure what to do next

    Code:
    root@vuuno4k:~# wg-quick up wg0                                           
    
    [#] ip link add wg0 type wireguard                                       
    
    [#] wg setconf wg0 /dev/fd/63                                             
    
    [#] ip -4 address add 10.xxx.xxx.xx/32 dev wg0                           
    
    [#] ip link set mtu 1420 up dev wg0                                       
    
    [#] resolvconf -a wg0 -m 0 -x                                             /sbin/resolvconf: illegal option -- x                                     
    
    [#] wg set wg0 fwmark 51820                                               
    
    [#] ip -4 route add 0.0.0.0/0 dev wg0 table 51820                         ip: invalid argument '51820' to 'table'                                   
    
    [#] resolvconf -d wg0 -f                                                  
    
    [#] ip link delete dev wg0
    This is an example of my config

    Code:
    [Interface]
    PrivateKey = xxxxxxxx=
    ListenPort = 51820
    Address = 10.xxx.107.xxx/32
    DNS = 10.100.0.1
    
    [Peer]
    PublicKey = xxxxxxxxxx=
    PresharedKey = xxxxxxxxxx=
    AllowedIPs = 0.0.0.0/0
    Endpoint = 5.xxx.169.xxx:51820
    PersistentKeepalive = 25
    What I have noticed is openreslov maybe outdated.

    Current version on feeds openresolv (3.5.2-r0)

    I think latest is openresolv 3.12.0
    Code:
    https://guix.gnu.org/packages/openresolv-3.12.0/
    found this info elswere not sure if it may help.



    Code:
    opkg update && opkg upgrade
    opkg install wireguard-tools
    opkg install wireguard-tools-bash-completion
    opkg install openresolv
    restart box.

    Download Wireguard *.conf and rename it: wg0.conf
    Copy wg0.conf to /etc/wireguard .


    Code:
    chmod 600 /etc/wireguard/wg0.conf
    Create enigma2_pre_start.sh :



    Code:
    #!/bin/sh
    
    wg-quick up wg0
    
    exit
    Copy enigma2_pre_start.sh to /usr/bin/ .



    Code:
    chmod 755 /usr/bin/enigma2_pre_start.sh
    restart box.

  7. #5

    Title
    ViX Beta Tester
    Join Date
    May 2011
    Posts
    684
    Thanks
    56
    Thanked 237 Times in 164 Posts
    Quote Originally Posted by dsayers View Post
    I get similar results.

    There is a wireguard plugin here but I don't have a VPN that it supports
    Code:
    https://www.linuxsat-support.com/thread/153852-wireguard-vpn-plugin-by-madhouse/?pageNo=1
    I've just loaded that plugin and works well with both Nord and Surfshark on my H7 box. The plugin thread does show how to check status of the WG using the script from this thread

    Code:
    wg show wg0
    That shows a connection to my server but nothing downloading (NOTE: this is using the script only, not the plugin)

    Code:
    root@zgemmah7:/tmp# wg show wg0
    interface: wg0
      public key: YgsI5+xsk03hZKXw32jDXLeAk/sCEbMqiZ2DK5Bj6VA=
      private key: (hidden)
      listening port: 51820
    
    peer: K53l2wOIHU3262sX5N/5kAvCvt4r55lNui30EbvaDlE=
      endpoint: 195.206.183.211:51820
      allowed ips: 0.0.0.0/32, 0.0.0.2/31, 0.0.0.4/30, 0.0.0.8/29, 0.0.0.16/28, 0.0.0.32/27, 0.0.0.64/26, 0.0.0.128/25, 0.0.1.0/24, 0.0.2.0/23, 0.0.4.0/22, 0.0.8.0/21, 0.0.16.0/20, 0.0.32.0/19, 0.0.64.0/18, 0.0.128.0/17, 0.1.0.0/16, 0.2.0.0/15, 0.4.0.0/14, 0.8.0.0/13, 0.16.0.0/12, 0.32.0.0/11, 0.64.0.0/10, 0.128.0.0/9, 1.0.0.0/8, 2.0.0.0/7, 4.0.0.0/6, 8.0.0.0/5, 16.0.0.0/4, 32.0.0.0/3, 64.0.0.0/2, 128.0.0.0/1
      latest handshake: 2 minutes, 37 seconds ago
      transfer: 92 B received, 4.07 MiB sent
      persistent keepalive: every 25 seconds
    It looks like it's very close to working. If you have the skill, maybe you could look in the plugin to see what it does differently

  8. #6
    dsayers's Avatar
    Title
    ViX Beta Tester
    Join Date
    Mar 2016
    Posts
    1,767
    Thanks
    473
    Thanked 608 Times in 434 Posts
    Does the plugin not copy a config to etc/wireguard? If it does you could see if it modifies the default config

    If it does you could also save a copy of the config and stop the wireguard plugin and send the config back to the wireguard folder and start it via command line to see if the plugin is doing something else

  9. #7

    Title
    ViX Beta Tester
    Join Date
    May 2011
    Posts
    684
    Thanks
    56
    Thanked 237 Times in 164 Posts
    Quote Originally Posted by dsayers View Post
    Does the plugin not copy a config to etc/wireguard? If it does you could see if it modifies the default config

    If it does you could also save a copy of the config and stop the wireguard plugin and send the config back to the wireguard folder and start it via command line to see if the plugin is doing something else
    Never thought of that! It does and that connection works with the script - looks like we were missing telling the box how to route to the WG server

    Code:
    # Script created by Madhouse
    [Interface]
    PrivateKey = **********************
    Address = 10.*.*.2/16
    DNS = 162.252.172.57, 149.154.159.92
    PostUp = ip -4 route add 178.238.10.208 via 192.168.1.1
    PostDown = ip -4 route del 178.238.10.208 via 192.168.1.1
    
    [Peer]
    PublicKey = iBJRXLZwXuWWrOZE1ZrAXEKMgV/z0WjG0Tks5rnWLBI=
    AllowedIps= 0.0.0.0/1,128.0.0.0/1
    Endpoint = 178.238.10.208:51820
    PersistentKeepalive = 25

  10. The Following 2 Users Say Thank You to lincsat For This Useful Post:

    dsayers (30-12-22),Huevos (30-12-22)

  11. #8
    dsayers's Avatar
    Title
    ViX Beta Tester
    Join Date
    Mar 2016
    Posts
    1,767
    Thanks
    473
    Thanked 608 Times in 434 Posts
    Thanks I'll take a look. I was already trying IP routes and I was getting errors when trying above. This morning I have no internet connection on my box although wireguard isn't running.

    I'll try a reflash and try again. Thanks

    Edit after reconfiguring network connection this is the error I'm getting

    Code:
    [#] ip -4 route add 195.181.164.197: via 192.168.0.1
    ip: RTNETLINK answers: File exists
    Last edited by dsayers; 31-12-22 at 11:36.

  12. #9
    dsayers's Avatar
    Title
    ViX Beta Tester
    Join Date
    Mar 2016
    Posts
    1,767
    Thanks
    473
    Thanked 608 Times in 434 Posts
    Quote Originally Posted by lincsat View Post
    Never thought of that! It does and that connection works with the script - looks like we were missing telling the box how to route to the WG server

    Code:
    # Script created by Madhouse
    [Interface]
    PrivateKey = **********************
    Address = 10.*.*.2/16
    DNS = 162.252.172.57, 149.154.159.92
    PostUp = ip -4 route add 178.238.10.208 via 192.168.1.1
    PostDown = ip -4 route del 178.238.10.208 via 192.168.1.1
    
    [Peer]
    PublicKey = iBJRXLZwXuWWrOZE1ZrAXEKMgV/z0WjG0Tks5rnWLBI=
    AllowedIps= 0.0.0.0/1,128.0.0.0/1
    Endpoint = 178.238.10.208:51820
    PersistentKeepalive = 25
    Ok got this working now with VPN unlimited. I've been on and off on this since the beginning of the year so thanks for your help

  13. #10

    Title
    Senior Member
    Join Date
    May 2019
    Posts
    111
    Thanks
    14
    Thanked 30 Times in 27 Posts
    Quote Originally Posted by dsayers View Post
    Ok got this working now with VPN unlimited. I've been on and off on this since the beginning of the year so thanks for your help
    And now what do you think wireguard vs openvpn for myself with openvpn with a gigablue quad uhd 4k with Gigabit ethernet port on 200 mb virgin media package most I could get was between 35 - 65 Mbps now with wireguard
    speedtest.png

  14. #11

    Title
    ViX Beta Tester
    Join Date
    May 2011
    Posts
    684
    Thanks
    56
    Thanked 237 Times in 164 Posts
    Wireguard is much faster than openVPN for me on every device I've used it on, almost as fast as having no VPN at all.

  15. #12
    dsayers's Avatar
    Title
    ViX Beta Tester
    Join Date
    Mar 2016
    Posts
    1,767
    Thanks
    473
    Thanked 608 Times in 434 Posts
    I tested on Canada server using VPN unlimited and only got 35mb lol

    Now I know how to configure it it can test different countries to see if I can get a better speed. I also have purevpn I need to test

  16. #13
    Ev0's Avatar
    Title
    V.I.P
    Join Date
    Jan 2011
    Posts
    1,054
    Thanks
    347
    Thanked 429 Times in 267 Posts
    Wow.

    Using Nordvpn previously I was getting between 70 and 100mbps using openvpn.

    Just installed wireguard on Ultimo4K and now seeing 435mbps (I don't get more than 500mbps without a vpn anyway).


  17. The Following User Says Thank You to Ev0 For This Useful Post:

    Lu1981kas (01-01-23)

  18. #14

    Title
    Junior Member
    Join Date
    Jan 2023
    Posts
    1
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Hi @all iam New member here. the discussion here make me interesting. Wanna test wireguard with purevpn on my duo 4kse.... Does it work with python 2 and 3 images? Do you know if purevpn works to?

  19. #15
    dsayers's Avatar
    Title
    ViX Beta Tester
    Join Date
    Mar 2016
    Posts
    1,767
    Thanks
    473
    Thanked 608 Times in 434 Posts
    Quote Originally Posted by Lu1981kas View Post
    Hi @all iam New member here. the discussion here make me interesting. Wanna test wireguard with purevpn on my duo 4kse.... Does it work with python 2 and 3 images? Do you know if purevpn works to?
    If wireguard is available to install via command line then it should work.

    I can't seem to get purevpn working although I can get VPN unlimited working.

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
This website uses cookies
We use cookies to store session information to facilitate remembering your login information, to allow you to save website preferences, to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners.