<?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>Gentoo – Yeri Tiete</title>
    <link>https://yeri.be/tag/gentoo/</link>
    <description>Yeri Tiete&#39;s blog</description>
    <language>en</language>
    <copyright>© Yeri Tiete</copyright>
    <lastBuildDate>Mon, 15 Mar 2010 17:08:21 +0100</lastBuildDate>
    <atom:link href="https://yeri.be/tag/gentoo/index.xml" rel="self" type="application/rss+xml" />
    
    <item>
      <title>VMware Server and kernel 2.6.33</title>
      <link>https://yeri.be/vmware-server-and-kernel-2-6-33/</link>
      <pubDate>Mon, 15 Mar 2010 17:08:21 +0100</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/vmware-server-and-kernel-2-6-33/</guid>
      <description>&lt;p&gt;Trying to recompile the VMware Server 2.0.2 on kernel 2.6.33 I came upon these two errors:&lt;/p&gt;&#xA;&lt;blockquote&gt;# uname -a&#xA;Linux Sauron 2.6.33 #1 SMP Tue Mar 9 15:09:05 CET 2010 x86_64 AMD Opteron(tm) Processor 248 AuthenticAMD GNU/Linux&lt;/blockquote&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://home.tiete.be/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;This&lt;/a&gt; is a Gentoo machine.&lt;/p&gt;&#xA;&lt;p&gt;Error 1:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;div id=&#34;_mcePaste&#34;&gt;The directory of kernel headers (version @@VMWARE@@ UTS_RELEASE) does not match&lt;/div&gt;&#xA;&lt;div id=&#34;_mcePaste&#34;&gt;your running kernel (version 2.6.33).  Even if the module were to compile&lt;/div&gt;&#xA;&lt;div id=&#34;_mcePaste&#34;&gt;successfully, it would not load into the running kernel.&lt;/div&gt;&#xA;&lt;div id=&#34;_mcePaste&#34;&gt;What is the location of the directory of C header files that match your running kernel? [/usr/src/linux/include]&lt;/div&gt;&lt;/blockquote&gt;&#xA;&lt;p&gt;This can be resolved by editing &lt;em&gt;version.h&lt;/em&gt; (usually in &lt;em&gt;/usr/src/linux/include/linux&lt;/em&gt;) and adding this line:&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>Trying to recompile the VMware Server 2.0.2 on kernel 2.6.33 I came upon these two errors:</p>
<blockquote># uname -a
Linux Sauron 2.6.33 #1 SMP Tue Mar 9 15:09:05 CET 2010 x86_64 AMD Opteron(tm) Processor 248 AuthenticAMD GNU/Linux</blockquote>
<p><a href="http://home.tiete.be/" target="_blank" rel="noopener noreferrer">This</a> is a Gentoo machine.</p>
<p>Error 1:</p>
<blockquote>
<div id="_mcePaste">The directory of kernel headers (version @@VMWARE@@ UTS_RELEASE) does not match</div>
<div id="_mcePaste">your running kernel (version 2.6.33).  Even if the module were to compile</div>
<div id="_mcePaste">successfully, it would not load into the running kernel.</div>
<div id="_mcePaste">What is the location of the directory of C header files that match your running kernel? [/usr/src/linux/include]</div></blockquote>
<p>This can be resolved by editing <em>version.h</em> (usually in <em>/usr/src/linux/include/linux</em>) and adding this line:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="c1">#define UTS_RELEASE &#34;2.6.33&#34;</span>
</span></span></code></pre></div><p>Error 2:</p>
<blockquote>The path "/usr/src/linux/include" is a kernel header file directory, but it does not contain the file "linux/autoconf.h" as expected.  This can happen if the kernel has never been built, or if you have invoked the "make mrproper" command in your kernel directory.  In any case, you may want to rebuild your kernel.
What is the location of the directory of C header files that match your running kernel? [/usr/src/linux/include]</blockquote>
<p>As the latest kernel doesn&rsquo;t seem to contain this file, I took the <a href="https://static.yeri.be/2010/03/autoconf.h" target="_blank" rel="noopener noreferrer">autoconf.h</a> file from 2.6.22.2, and copied it to the correct place. This made VMware compile (until it errored on other stuff, which can be fixed using <a href="https://web.archive.org/web/20101122085804/http://radu.cotescu.com:80/2010/01/19/how-to-install-vmware-server-ubuntu-fedora-opensuse/" target="_blank" rel="noopener noreferrer">this script</a>).</p>
<p>I&rsquo;m fairly clueless what implications it can have to make these changes. So use at your own risk. :)</p>
]]></content:encoded>
      <category>errors</category><category>linux</category>
      <category>gentoo</category><category>kernel</category><category>vmware</category>
    </item>
    
    <item>
      <title>MRTG</title>
      <link>https://yeri.be/mrtg/</link>
      <pubDate>Wed, 18 Nov 2009 17:14:57 +0100</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/mrtg/</guid>
      <description>&lt;p&gt;As I often have people asking for the files I use to make my pretty MRTG graphs; I&amp;rsquo;ll publish them here.&lt;/p&gt;&#xA;&lt;p&gt;Here are some examples:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://web.archive.org/web/20100712200524/http://mrtg.rootspirit.com:80/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Zero&lt;/a&gt; - &lt;a href=&#34;http://one.rootspirit.com/mrtg/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;One&lt;/a&gt; - &lt;a href=&#34;http://four.rootspirit.com/mrtg/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Four&lt;/a&gt; - &lt;a href=&#34;http://vm1.rootspirit.com/mrtg/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;vm1&lt;/a&gt; - &lt;a href=&#34;http://home.tiete.be/mrtg/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Sauron&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;The config files:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://static.yeri.be/2009/11/sauron.tar&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Sauron&lt;/a&gt; (including Squid stats),&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://static.yeri.be/2009/11/zero.tar&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Zero&lt;/a&gt; (including fan stats).&lt;/p&gt;&#xA;&lt;p&gt;List of files included:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;indexmaker; simple script (included with MRTG) to generate a simple index file with all the graphs&lt;/li&gt;&#xA;&lt;li&gt;snmp-if.sh; will show you the IDs of the interfaces on the server/pc. These IDs have to be edited in the mrtg.cfg file; e.g.:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Target[eth0]: &lt;span style=&#34;color: #ff0000;&#34;&gt;2&lt;/span&gt;:public@localhost:&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>As I often have people asking for the files I use to make my pretty MRTG graphs; I&rsquo;ll publish them here.</p>
<p>Here are some examples:</p>
<p><a href="https://web.archive.org/web/20100712200524/http://mrtg.rootspirit.com:80/" target="_blank" rel="noopener noreferrer">Zero</a> - <a href="http://one.rootspirit.com/mrtg/" target="_blank" rel="noopener noreferrer">One</a> - <a href="http://four.rootspirit.com/mrtg/" target="_blank" rel="noopener noreferrer">Four</a> - <a href="http://vm1.rootspirit.com/mrtg/" target="_blank" rel="noopener noreferrer">vm1</a> - <a href="http://home.tiete.be/mrtg/" target="_blank" rel="noopener noreferrer">Sauron</a></p>
<p>The config files:</p>
<p><a href="https://static.yeri.be/2009/11/sauron.tar" target="_blank" rel="noopener noreferrer">Sauron</a> (including Squid stats),</p>
<p><a href="https://static.yeri.be/2009/11/zero.tar" target="_blank" rel="noopener noreferrer">Zero</a> (including fan stats).</p>
<p>List of files included:</p>
<ul>
<li>indexmaker; simple script (included with MRTG) to generate a simple index file with all the graphs</li>
<li>snmp-if.sh; will show you the IDs of the interfaces on the server/pc. These IDs have to be edited in the mrtg.cfg file; e.g.:</li>
</ul>
<p>Target[eth0]: <span style="color: #ff0000;">2</span>:public@localhost:</p>
<p>Make sure 2 is indeed the ID of eth0. Be aware that virtual interfaces, like the TUN/TAP interfaces (using by openVPN for example), can change ID each time they are restarted/rebooted.</p>
<ul>
<li>mrtg.cfg; check the config file as an example.</li></ul>
<li>mrtg-&lt;xyz&gt;.sh; bunch of files to generate some data. Not all of  those still work, but I haven't deleted them yet in case. See the config to check those I'm using.
</li>
<li>
<p>mrtg._1 and mrtg.ok can be deleted/ignores. Those files are generated by MRTG and I was to lazy to remove them. :(</p>
</li>
<p>Some day, I&rsquo;ll write a decent howto, but for now, you&rsquo;ll have to do with this.</p>
<p>If there&rsquo;s any question, just leave a comment.</p>
]]></content:encoded>
      <category>hardware</category><category>misc</category><category>networking</category><category>software</category><category>www</category>
      <category>linux</category><category>ubuntu</category><category>debian</category><category>gentoo</category><category>mrtg</category><category>stats</category>
    </item>
    
    <item>
      <title>OpenVPN Linux &#43; Mac howto</title>
      <link>https://yeri.be/openvpn-linux-mac-howto/</link>
      <pubDate>Sun, 05 Jul 2009 05:14:01 +0200</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/openvpn-linux-mac-howto/</guid>
      <description>&lt;p&gt;A short howto, as I was unable to find any clear ones on the net.&lt;/p&gt;&#xA;&lt;p style=&#34;text-align: left;&#34;&gt;I&#39;m using Mac OS X (Leopard) as client, and a &lt;a href=&#34;http://home.tiete.be&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Gentoo server&lt;/a&gt; as server/host.&lt;/p&gt;&#xA;&lt;p style=&#34;text-align: left;&#34;&gt;I both tried &lt;a href=&#34;http://www.viscosityvpn.com/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Viscosity&lt;/a&gt; and &lt;a href=&#34;https://tunnelblick.net/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Tunnelblick&lt;/a&gt; on my Mac as OpenVPN software, and Viscosity is probably somewhat easier to configure (using the GUI), it was shareware. So I ended up using Tunnelblick and it seems to be doing its job quite well.&lt;/p&gt;&#xA;&lt;p style=&#34;text-align: left;&#34;&gt;First of all, make sure Gentoo is set up and working as intended. I used my home router as VPN server (having both eth0 and eth1 (= ppp0).&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>A short howto, as I was unable to find any clear ones on the net.</p>
<p style="text-align: left;">I'm using Mac OS X (Leopard) as client, and a <a href="http://home.tiete.be" target="_blank" rel="noopener">Gentoo server</a> as server/host.</p>
<p style="text-align: left;">I both tried <a href="http://www.viscosityvpn.com/" target="_blank" rel="noopener">Viscosity</a> and <a href="https://tunnelblick.net/" target="_blank" rel="noopener">Tunnelblick</a> on my Mac as OpenVPN software, and Viscosity is probably somewhat easier to configure (using the GUI), it was shareware. So I ended up using Tunnelblick and it seems to be doing its job quite well.</p>
<p style="text-align: left;">First of all, make sure Gentoo is set up and working as intended. I used my home router as VPN server (having both eth0 and eth1 (= ppp0).</p>
<p style="text-align: left;">Using this <a href="http://forums.gentoo.org/viewtopic-p-5849651.html" target="_blank" rel="noopener">howto</a>, you'll be able to get the server up and running.</p>
<p style="text-align: left;">Besides the installation, and perhaps (config) file locations it should be pretty similar on other Linux distros.</p>
<p style="text-align: left;">As I have dnsmasq running on my server (taking care of DNS) I added the following to the server.conf:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">push <span class="s2">&#34;dhcp-option DNS 10.0.0.1&#34;</span>
</span></span><span class="line"><span class="cl">push <span class="s2">&#34;redirect-gateway def1&#34;</span>
</span></span><span class="line"><span class="cl">client-config-dir ccd
</span></span><span class="line"><span class="cl">route 10.20.30.0 255.255.255.252
</span></span></code></pre></div><p>Don&rsquo;t forget to allow DNS requests over tun0 interface in dnsmasq.conf.</p>
<p>The first line tells the server to hand out 10.0.0.1 as DNS server to its connecting clients (10.0.0.1 being the internal eth0 IP of my server).</p>
<p>The 2nd line, tells all clients to route ALL of their traffic through the VPN. I used the VPN to access a website that allowed only Belgian IPs, and I was in The Netherlands at the time I had to access the site (Skynet&rsquo;s Rock Werchter stream). So I connected through my server at home.</p>
<p>And the 3rd and 4th line are needed if the client access the VPN is on a private IP subnet (like being connected on a WiFi router, using IP 192.168.178.x).</p>
<p>You&rsquo;ll have to add, in the client-config directory a file per username connecting to the VPN with something similar to this:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">iroute 192.168.178.0 255.255.255.0
</span></span></code></pre></div><p>I&rsquo;m not entirely sure if you can add multiple iroutes; something I&rsquo;ll have to figure out when being on a different network.</p>
<p>This is what my client config looks like (vpn-server-name.conf, located in ~<em>/</em>Library/openvpn/):</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">client
</span></span><span class="line"><span class="cl">dev tun
</span></span><span class="line"><span class="cl">proto udp
</span></span><span class="line"><span class="cl">remote home.tiete.be <span class="m">9000</span>
</span></span><span class="line"><span class="cl">resolv-retry infinite
</span></span><span class="line"><span class="cl">nobind
</span></span><span class="line"><span class="cl">tun-mtu <span class="m">1500</span>
</span></span><span class="line"><span class="cl">tun-mtu-extra <span class="m">32</span>
</span></span><span class="line"><span class="cl">mssfix <span class="m">1200</span>
</span></span><span class="line"><span class="cl">persist-key
</span></span><span class="line"><span class="cl">persist-tun
</span></span><span class="line"><span class="cl">ca <span class="s2">&#34;ca.crt&#34;</span>
</span></span><span class="line"><span class="cl">cert <span class="s2">&#34;yeri.crt&#34;</span>
</span></span><span class="line"><span class="cl">key <span class="s2">&#34;yeri.key&#34;</span>
</span></span><span class="line"><span class="cl">tls-auth <span class="s2">&#34;ta.key&#34;</span> <span class="m">1</span>
</span></span><span class="line"><span class="cl">comp-lzo
</span></span><span class="line"><span class="cl">verb <span class="m">3</span>
</span></span></code></pre></div><p>Yeri being my username. Don&rsquo;t forget to download and add the ca.crt, user.crt, user.key (located in /usr/share/openvpn/easy-rsa/keys/) and ta.key (located in /etc/openvpn/) you&rsquo;ve created on the server.</p>
<p>If your client asks for &ldquo;directions&rdquo;, pick 1.</p>
<p>Start up server and client software.</p>
<p>Hitting connect in Tunnelblick should connect you to the VPN server, and (in my case) giving me an IP similar to 10.20.30.6. You can check this using &ldquo;ifconfig&rdquo; in Terminal.</p>
<p>Client:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">tun0: <span class="nv">flags</span><span class="o">=</span><span class="m">8851</span> mtu <span class="m">1500</span>
</span></span><span class="line"><span class="cl">    inet 10.20.30.6 --&gt; 10.20.30.5 netmask 0xffffffff
</span></span><span class="line"><span class="cl">    open <span class="o">(</span>pid 20551<span class="o">)</span>
</span></span></code></pre></div><p>Server:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">tun0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
</span></span><span class="line"><span class="cl">inet addr:10.20.30.1  P-t-P:10.20.30.2  Mask:255.255.255.255
</span></span><span class="line"><span class="cl">UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
</span></span><span class="line"><span class="cl">RX packets:407595 errors:0 dropped:0 overruns:0 frame:0
</span></span><span class="line"><span class="cl">TX packets:574351 errors:0 dropped:0 overruns:0 carrier:0
</span></span><span class="line"><span class="cl">collisions:0 txqueuelen:100
</span></span><span class="line"><span class="cl">RX bytes:27473209 <span class="o">(</span>26.2 MiB<span class="o">)</span>  TX bytes:603524377 <span class="o">(</span>575.5 MiB<span class="o">)</span>
</span></span></code></pre></div><p>Don&rsquo;t forget; when using &ldquo;tun&rdquo; as driver, your gateway/VPN server will always have the IP ending on .1 (e.g.: 10.20.30.1).</p>
<p>Now, if you want to route all traffic throug the VPN, like I did, you&rsquo;ll have to change some stuff in iptables (as the server is also acting as my home router, I already did have a few rules in it).</p>
<p>Allow all traffic through tun0 interface:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">iptables -A OUTPUT -o tun0 -j ACCEPT
</span></span><span class="line"><span class="cl">iptables -A INPUT -i tun0 -j ACCEPT
</span></span></code></pre></div><p>Allow traffic through the external port 9000 (UDP):</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">iptables -A INPUT -i ppp0 -p udp -m udp --dport <span class="m">9000</span> -j ACCEPT
</span></span></code></pre></div><p>Enable forwarding and NAT:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">iptables -A FORWARD -s 10.20.30.0/24 -i tun0 -j ACCEPT
</span></span><span class="line"><span class="cl">iptables -A FORWARD -d 10.20.30.0/24 -i ppp0 -j ACCEPT
</span></span><span class="line"><span class="cl">iptables -A POSTROUTING -o ppp0 -j MASQUERADE
</span></span></code></pre></div><p>And lastly, as I have Squid running on my server, I want to transparently forward all port 80 requests to the Squid server running on port 8080:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">iptables -t nat -A PREROUTING -i tun0 -p tcp -m tcp --dport <span class="m">80</span> -j REDIRECT --to-ports <span class="m">8080</span>
</span></span></code></pre></div><p>That&rsquo;s about it. You should have a running VPN from your current location to your VPN server. And you&rsquo;re able to use it as a gateway.</p>
<p>You can always traceroute/tracepath to your VPN server (10.20.30.1). It should only find one hop.</p>
]]></content:encoded>
      <category>apple</category><category>linux</category><category>networking</category>
      <category>apple</category><category>linux</category><category>gentoo</category><category>openvpn</category><category>vpn</category>
    </item>
    
  </channel>
</rss>
