mirror of
https://github.com/openziti/zrok.git
synced 2025-01-25 23:39:12 +01:00
1 line
7.7 KiB
JavaScript
1 line
7.7 KiB
JavaScript
|
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[749],{7392:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>c,contentTitle:()=>a,default:()=>h,frontMatter:()=>i,metadata:()=>r,toc:()=>d});const r=JSON.parse('{"id":"guides/vpn/vpn","title":"zrok VPN Guide","description":"zrok VPN backend allows for simple host-to-host VPN setup.","source":"@site/../docs/guides/vpn/vpn.md","sourceDirName":"guides/vpn","slug":"/guides/vpn/","permalink":"/docs/guides/vpn/","draft":false,"unlisted":false,"editUrl":"https://github.com/openziti/zrok/blob/main/docs/../docs/guides/vpn/vpn.md","tags":[],"version":"current","frontMatter":{"sidebar_label":"VPN"},"sidebar":"tutorialSidebar","previous":{"title":"Drives","permalink":"/docs/guides/drives"}}');var o=s(4848),t=s(8453);const i={sidebar_label:"VPN"},a="zrok VPN Guide",c={},d=[{value:"Starting VPN server",id:"starting-vpn-server",level:2},{value:"VPN share reservation",id:"vpn-share-reservation",level:2},{value:"Accessing VPN share",id:"accessing-vpn-share",level:2}];function l(e){const n={code:"code",h1:"h1",h2:"h2",header:"header",img:"img",p:"p",pre:"pre",...(0,t.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.header,{children:(0,o.jsx)(n.h1,{id:"zrok-vpn-guide",children:"zrok VPN Guide"})}),"\n",(0,o.jsx)(n.p,{children:"zrok VPN backend allows for simple host-to-host VPN setup."}),"\n",(0,o.jsx)(n.h2,{id:"starting-vpn-server",children:"Starting VPN server"}),"\n",(0,o.jsxs)(n.p,{children:["VPN is shared through the ",(0,o.jsx)(n.code,{children:"vpn"})," backend of ",(0,o.jsx)(n.code,{children:"zrok"})," command."]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"eugene@hermes $ sudo -E zrok share private --headless --backend-mode vpn\n[ 0.542] INFO sdk-golang/ziti.(*listenerManager).createSessionWithBackoff: {session token=[589d443c-f59d-4fc8-8c48-76609b7fb402]} new service session\n[ 0.705] INFO main.(*sharePrivateCommand).run: allow other to access your share with the following command:\nzrok access private 3rq7torslq3n\n[ 0.705] INFO zrok/endpoints/vpn.(*Backend).Run: started\n"})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.img,{alt:"VPN share",src:s(1171).A+"",width:"1626",height:"1314"})}),"\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.code,{children:"sudo"})," or equivalent invocation is required because VPN mode needs to create a virtual network device (",(0,o.jsx)(n.code,{children:"tun"}),")\n",(0,o.jsx)(n.code,{children:"-E"})," option allows ",(0,o.jsx)(n.code,{children:"zrok"})," to find your zrok configuration files (in your ",(0,o.jsx)(n.code,{children:"$HOME/.zrok"}),")"]}),"\n",(0,o.jsxs)(n.p,{children:["By default ",(0,o.jsx)(n.code,{children:"vpn"})," backend uses subnet ",(0,o.jsx)(n.code,{children:"10.122.0.0/16"})," and assigns ",(0,o.jsx)(n.code,{children:"10.122.0.1"})," to the host that stared VPN share."]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"$ ifconfig\ntun0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 16384\n inet 10.122.0.1 netmask 255.255.0.0 destination 10.122.0.1\n inet6 fe80::705f:24e4:dcfc:a6b2 prefixlen 64 scopeid 0x20<link>\n inet6 fd00:7a72:6f6b::1 prefixlen 64 scopeid 0x0<global>\n unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 500 (UNSPEC)\n RX packets 0 bytes 0 (0.0 B)\n RX errors 0 dropped 0 overruns 0 frame 0\n TX packets 27 bytes 3236 (3.2 KB)\n TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0\n"})}),"\n",(0,o.jsxs)(n.p,{children:["Default IP/subnet setting can be overridden by adding ",(0,o.jsx)(n.code,{children:"<target>"})," parameter:"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"$ sudo -E zrok share private --headless --backend-mode vpn 192.168.42.12/24\n"})}),"\n",(0,o.jsx)(n.h2,{id:"vpn-share-reservation",children:"VPN share reservation"}),"\n",(0,o.jsx)(n.p,{children:"Share reservation works the same as with other backend types:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"eugene@hermes $ zrok reserve private -b vp
|