-
tozhu
jperkin: is it this one?
tailscale.com
-
tozhu
jperkin: Thanks for the advice, I have installed tailscale/wireguard-go/wireguard-tools in a zone, but can’t find example to config and use it
-
tozhu
is there any docs or examples, a big thanks
-
tozhu
jperkin: I find the latest version is 1.44, should it be upgrade for pkgsrc? thanks
-
jperkin
tozhu: yes, though the current version should work fine - nahamu can probably provide an example config
-
tozhu
jperkin: thanks, do you know where had the example configuration of wireguard on illumos/smartos ? or tailscale? I have installed tailscale, wireguard-go, wireguard-tools in a native zones, but have not found configuration example, I want to replace wireguare for my OpenBSD box which is running on Bhyve in SmartOS
-
tozhu
a big thanks
-
nahamu
tozhu: do you want to use tailscale or just wireguard-go?
-
nahamu
If you have a tailscale account set up already, tailscale is almost disturbingly simple
-
nahamu
pkgin in tailscale; svcadm enable tailscale; tailscale up
-
nahamu
or at least that's pretty much how it should be.
-
nahamu
and yes, the pkgsrc package needs an update (I've already done the rebase and tag, jperkin) but the current package should be fine to get started.
-
nahamu
tozhu: feel free to ping me if you have additional questions.
-
nahamu
I'm overdue to write a blog post on how to use the packaged versions on OmniOS and SmartOS.
-
neuroserve
nahamu : you can even set up your own headscale server (but in a hvm instance only)
-
neuroserve
-
nahamu
also true.
-
tozhu
nahamu: a big thanks for the answer, I’m going to run wireguard-go in smartos zones; I don’t have tailscale account
-
nahamu
tozhu: ah, I'm less of an expert on the wireguard configurations.
-
nahamu
did you use wg-quick on the openbsd machine?
-
tozhu
nahamu: thank you for the help, I’m going to regist a account for tailscale
-
nahamu
I ported wg-quick to illumos so you should be able to port the config if so.
-
tozhu
wireguard configuration is very simple
-
tozhu
sure, thank you very much
-
nahamu
if you want to remove any keys from the config and gist it somewhere, I can take a look and see how much work is needed.
-
nahamu
-
nahamu
I think the package includes the wg-quick smf service so you should be able to create /etc/wireguard/mywg.conf and then `svcadm enable wg-quick:mywg`
-
nahamu
(I really really need to consolidate the documentation, sigh.)
-
CmdLnKid
-
tozhu
nahamu, a big thank, I’ll try it
-
tozhu
nahamu: there is /opt/local/lib/svc/manifest/wireguard-tools.xml in the zone after install wireguard-tools-1.0.20210914 , is it the correct file to configure wireguard services ?
-
tozhu
but there is nothing when run command: svcs -a |grep -i wireguard
-
tozhu
nahamu: jperkin: would you please help to take a look what’s the issue so that can’t import the SMF
pastebin.com/75cPH3Tm I installed wireguard-go-0.0.20220316 and wireguard-tools-1.0.20210914 from pkgin/pkgsrc, but can’t import the services
-
tozhu
and here is my tun0.conf file for wireguard configuration for reference
pastebin.com/wFMr1KJ1
-
nahamu
tozhu: in a little bit. $work is currently grabbing my attention :)
-
tozhu
okay, got it :)
-
nahamu
tozhu: which zone image are you using?
-
tozhu
image uuid: e44ed3e0-910b-11ed-a5d4-00151714048c
-
tozhu
base-64-lts 22.4.0
-
nahamu
yep, spinning up a test zone now.
-
jperkin
the SMF should have been imported in a disabled state during install, sorry I can't take a look, I need to leave in a minute for a weekend away
-
jperkin
if you still have the install output from pkgin it may have clues
-
nahamu
just 2 commands:
-
nahamu
svccfg -s wireguard-tools add tun0
-
tozhu
jperkin: Thank you, and have nice weekend
-
nahamu
svcadm enable wireguard-tools:tun
-
nahamu
tozhu: those are the 2 commands you need to run
-
nahamu
the actual tun device might be a different number; you can name that e.g. tunnel.cfg and use "tunnel" instead of "tun0"
-
tozhu
after import it?
-
tozhu
thank you, I’ll do a test
-
nahamu
uh, I thought it was already imported... let me test again.
-
nahamu
but yes, you could import the manifest if it's not imported.
-
nahamu
jperkin: have a great weekend!
-
nahamu
tozhu: did you get it to work?
-
tozhu
nahamu: I have imported, but the state leaves maintenance
-
tozhu
after command ‘svcadm enable wireguard-tools’
-
bahamat
tozhu: svcadm clear wireguard-tools
-
tozhu
and network interface tun0 is up , but leave 0.0.0.0/0
-
nahamu
hmm
-
tozhu
still leave the state ‘maintenance’ after ‘svcadm clear wireguard-tools’ command
-
jperkin
thanks, first time attempting a 100k ultra marathon, insert straight-face erk smiley here - ping me on Monday nahamu and I'll update the packages to latest versions
-
bahamat
jperkin: Good luck!
-
bahamat
please don't die! :-)
-
tozhu
and there is /etc/wireguard/tun0.conf
-
nahamu
first let's rename that from tun0.conf to tunnel.conf
-
nahamu
wg-quick will automatically detect the tun device number when it gets created.
-
tozhu
nahamu: I have rename tun0.conf to tunnel.conf, then killed wireguard-go, and run ‘svcadm clear wireguard-tools’
-
tozhu
but there is no new file generated in /etc/wireguard dir, and also there is no tunX interface by ifconfig command
-
nahamu
"svccfg -s wireguard-tools delete tun0"
-
nahamu
just to be safe
-
tozhu
okay, thank you
-
nahamu
on my machine wg-quick doesn't like the keys from your example.
-
tozhu
nahamu: have run ‘svccfg -s wireguard-tools delete tun0’ command, and then re-run the command ‘svccfg -s wireguard-tools add tun0’ to import it, but leave the same status
-
nahamu
don't add a tun0
-
nahamu
if the file is named "tunnel.conf" add "tunnel"
-
tozhu
okay, I’ll re-run
-
nahamu
then you can see the errors with:
-
nahamu
cat `svcs -L wireguard-tools:tunnel`
-
nahamu
When I put in new keys, it works for me.
-
tozhu
nahamu: here is my command log and screen dump
pastebin.com/i7VnWbHk would you please show me your configuration in /etc/wireguard/XXX.conf ?
-
nahamu
yup, one moment.
-
tozhu
and this zone is a local zone, it is not a global zone
-
nahamu
you might have a dangling wireguard-go process you should kill.
-
nahamu
pkill wireguard-go
-
nahamu
need a few more minutes.
-
nahamu
tozhu: can you create a fresh zone and try out this script?
gist.github.com/nshalman/25a7adb26d29a67e98bb03b4f72f9913
-
nahamu
If that works, you should be able to adapt the resulting config file to work for you.
-
tozhu
nahamu: Thank you very much
-
tozhu
Thank you
-
nahamu
My wg-quick might be messing up with /32 at the end of IP addresses in certain places.
-
tozhu
okay, thanks again for the great help
-
nahamu
please let me know in the end what you had to do to get it working.
-
tozhu
sure, I’ll test it in this weekend, and then feedback to you the status, thanks again
-
nahamu
sounds good. good luck tozhu!