16 lines
4.7 KiB
HTML
16 lines
4.7 KiB
HTML
<!doctype html><html lang=en><head><meta charset=utf-8><meta http-equiv=x-ua-compatible content="ie=edge"><title>VPS proxies with wireguard tunnels - bullshark369.org</title><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=https://bullshark369.org/favicon.png><link rel=canonical href=https://bullshark369.org/posts/wireguard/><link rel=stylesheet href=/css/style.min.1c18def2aed6b057aa439fbec51b1d6f55f2d2d8073fe48390bceb467a226be6.css><link rel=stylesheet href=/assets/css/extended.min.2b1b6b49935b83e767eb16e2d7e2fb6e6f0db844856efc36bc5a4829d2b387ed.css><meta name=description content="The most private VPN is your own"><meta name=keywords content="Nathan Buache,Test Manager,QA,Quality Assurance,Lausanne,Switzerland,Web Testing,Software Testing,QoQa"><meta property="og:title" content="VPS proxies with wireguard tunnels - bullshark369.org"><meta property="og:type" content="website"><meta property="og:url" content="https://bullshark369.org/posts/wireguard/"><meta property="og:site_name" content="bullshark369.org"><meta property="og:description" content="The most private VPN is your own"><meta name=twitter:card content="summary_large_image"><meta name=twitter:title content="VPS proxies with wireguard tunnels"><meta name=twitter:description content="The most private VPN is your own"></head><body class='page page-blog-single'><div id=menu-main-mobile class=menu-main-mobile><ul class=menu><li class=menu-item-home><a href=https://bullshark369.org/>Home</a></li><li class=menu-item-blog><a href=https://bullshark369.org/posts/>Blog</a></li><li class=menu-item-contact><a href=https://bullshark369.org/pages/contact/>Contact</a></li><li class="menu-item-friend projects"><a href=https://bullshark369.org/pages/frienpro/>Friend Projects</a></li></ul></div><div id=wrapper class=wrapper><div class=header><div class=menu-main><ul><li class=menu-item-home><a href=/><span>Home</span></a></li><li class=menu-item-blog><a href=/posts/><span>Blog</span></a></li><li class=menu-item-contact><a href=/pages/contact/><span>Contact</span></a></li><li class="menu-item-friend projects"><a href=/pages/frienpro/><span>Friend Projects</span></a></li></ul></div><div id=toggle-menu-main-mobile class=hamburger-trigger><button class=hamburger>Menu</button></div></div><div class=blog><div class=intro><h1>VPS proxies with wireguard tunnels</h1></div><div class=content><h2 id=quick-guide>Quick guide</h2><pre tabindex=0><code>apt update && apt upgrade
|
|
apt install wireguard-tools git go iptables
|
|
git clone https://github.com/bullshar-k/wgconf
|
|
cd wgconf
|
|
go build main.go
|
|
./main -peer 10 -dest server_ip -port 51855
|
|
mv server.conf /etc/wireguard
|
|
wg-quick up server
|
|
</code></pre><p>From there you move the client 1-10 onto the appropriate clients and use wg-quick up on them too.
|
|
Depending on your VPS you may need traffic forwarding post up rules like this;</p><pre tabindex=0><code>PostUp = iptables -A FORWARD -i server -j ACCEPT
|
|
PostUp = iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
|
|
PostDown = iptables -D FORWARD -i server -j ACCEPT
|
|
PostDown = iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
|
|
</code></pre><p><em>If it isn’t apparent this goes in the <code>[INTERFACE]</code> section after the interface info before the first <code>[PEER]</code>
|
|
Ensure <code>server</code> is the name of the .conf file as that will be the name of the interface, and <code>eth0</code> is the name of your WAN facing NIC interface.</em></p></div></div><div class=footer><p class=footer-credit>@bullshark.win maintained by shark</p><div class=footer-social><div class=social-link><a href=https://github.com/bullshar-k title=GitHub target=_blank rel=noopener>GitHub</a></div><div class=social-link><a href=mailto:bullsharkgunsemail@pm.me title=Email target=_blank rel=noopener>Email</a></div><button type=button class="social-link social-copy" data-copy=@bullshar_k:matrix.org title="Copy Matrix to clipboard">
|
|
<span class=social-copy-label>Matrix</span></button></div></div><script>(function(){var e=document.querySelectorAll(".social-copy");e.forEach(function(e){e.addEventListener("click",function(){var t,o=e.getAttribute("data-copy"),n=e.querySelector(".social-copy-label, .contact-social-name"),i=n?n.textContent:e.textContent;function s(){n.textContent="Copied!",setTimeout(function(){n.textContent=i},1500)}if(navigator.clipboard&&navigator.clipboard.writeText)navigator.clipboard.writeText(o).then(s).catch(s);else{t=document.createElement("textarea"),t.value=o,document.body.appendChild(t),t.select();try{document.execCommand("copy")}catch{}document.body.removeChild(t),s()}})})})()</script></div><script type=text/javascript src=/js/bundle.min.5993fcb11c07dea925a3fbd58c03c7f1857197c35fccce3aa963a12c0b3c9960.js></script></body></html> |