<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Vpn on sysarcher/@ich_code</title><link>https://sysarcher.github.io/categories/vpn/</link><description>Recent content in Vpn on sysarcher/@ich_code</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Wed, 24 Feb 2021 21:22:37 +0200</lastBuildDate><atom:link href="https://sysarcher.github.io/categories/vpn/index.xml" rel="self" type="application/rss+xml"/><item><title>Some nice Hacks</title><link>https://sysarcher.github.io/posts/nice-hacks/</link><pubDate>Wed, 24 Feb 2021 21:22:37 +0200</pubDate><guid>https://sysarcher.github.io/posts/nice-hacks/</guid><description>&lt;p&gt;&lt;em&gt;Linux only&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;DISCLAIMER: THE FOLLOWING CAN LEAD TO CREATING SECURITY HOLES IN THE VPN-PROTECTED NETWORK&amp;hellip; BE VERY CAREFUL. MAKE SURE YOU KNOW WHAT YOU&amp;rsquo;RE DOING. IF YOU DON&amp;rsquo;T UNDERSTAND WHAT YOU&amp;rsquo;RE DOING, &lt;strong&gt;DO NOT PROCEED&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;VPNs are a pain in the neck. I managed to find a way to have VPN traffic limited to some sites instead of routing everything through your corporate network.&lt;/p&gt;
&lt;p&gt;Routing everything through corporate network is also a cause of load on the company&amp;rsquo;s servers. Imagine a ton of people watching Youtube over VPN. Now, I&amp;rsquo;m talking about traditional VPN here, not p2p stuff.&lt;/p&gt;</description><content:encoded><![CDATA[<p><em>Linux only</em></p>
<p><em>DISCLAIMER: THE FOLLOWING CAN LEAD TO CREATING SECURITY HOLES IN THE VPN-PROTECTED NETWORK&hellip; BE VERY CAREFUL. MAKE SURE YOU KNOW WHAT YOU&rsquo;RE DOING. IF YOU DON&rsquo;T UNDERSTAND WHAT YOU&rsquo;RE DOING, <strong>DO NOT PROCEED</strong></em></p>
<p>VPNs are a pain in the neck. I managed to find a way to have VPN traffic limited to some sites instead of routing everything through your corporate network.</p>
<p>Routing everything through corporate network is also a cause of load on the company&rsquo;s servers. Imagine a ton of people watching Youtube over VPN. Now, I&rsquo;m talking about traditional VPN here, not p2p stuff.</p>
<h2 id="use-vpn-slice">Use <code>vpn-slice</code></h2>
<p><a href="https://github.com/dlenski/vpn-slice"><code>vpn-slice</code></a> is an awesome tool that allows you to use the VPN for only a certain few websites. I used <code>vpn-slice</code> along with <code>openconnect</code>.</p>
<p>Installation is pretty straightforward if you follow the documentation. Just make sure the <code>root</code> user sees the binary. I installed <code>pyenv</code> seperately for the <code>root</code> user and configured the global python env to be 3.9.2 (<code>pyenv global 3.9.2</code>).</p>
<p>That&rsquo;s it. Now install <code>vpn-slice</code>:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-console" data-lang="console"><span style="display:flex;"><span>$ pyenv global 3.9.2  <span style="color:#75715e"># or whatever version you want</span>
</span></span><span style="display:flex;"><span>$ pip install --upgrade pip
</span></span><span style="display:flex;"><span>$ pip install dnspython  <span style="color:#75715e"># recommended in project README</span>
</span></span><span style="display:flex;"><span>$ pip install vpn-slice
</span></span></code></pre></div><h2 id="usage-with-openconnect">Usage with <code>openconnect</code></h2>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="color:#75715e"># Source: https://docs.microsoft.com/en-us/microsoft-365/enterprise/urls-and-ip-address-ranges?view=o365-worldwide#skype-for-business-online-and-microsoft-teams</span>
</span></span><span style="display:flex;"><span>MSFT<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;teams.microsoft.com login.microsoftonline.com microsoftstreams.com 13.107.64.0/18, 52.112.0.0/14, 52.120.0.0/14&#34;</span>
</span></span><span style="display:flex;"><span>MYCOMPANY<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;&#34;</span>  <span style="color:#75715e"># Your company&#39;s domains, IP addr etc.</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>openconnect <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span>  -c /home/$USER/.cert/CERT.crt <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span>  -k /home/$USER/.cert/private.key --key-password-from-fsid <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span>  -s <span style="color:#e6db74">&#34;vpn-slice </span>$MSFT<span style="color:#e6db74"> </span>$MYCOMPANY<span style="color:#e6db74">&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span>  vpn.company.com
</span></span></code></pre></div>]]></content:encoded></item></channel></rss>