<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  
  
  <channel>
    <title>chrisjrob: networking</title>
    <link>https://chrisjrob.com</link>
    <atom:link href="https://chrisjrob.com/tag/networking/feed/index.xml" rel="self" type="application/rss+xml" />
    <description>GNU Linux, Perl and FLOSS</description>
    <language>en-gb</language>
    <pubDate>Fri, 13 Feb 2026 17:22:31 +0000</pubDate>
    <lastBuildDate>Fri, 13 Feb 2026 17:22:31 +0000</lastBuildDate>
    
    <item>
      <title>Convert OpenVPN OVPN Files for use in Network Manager</title>
      <link>https://chrisjrob.com/2014/03/18/convert-openvpn-ovpn-files-for-use-in-network-manager/</link>
      <pubDate>Tue, 18 Mar 2014 00:00:00 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2014/03/18/convert-openvpn-ovpn-files-for-use-in-network-manager</guid>
      <description>
       <![CDATA[
         
           <img src="https://chrisjrob.com/assets/openvpn.png" align="right" alt="Featured Image">
         
         <p>Anyone who has enjoyed the dubious benefits of working with IPSEC will
find <a href="http://openvpn.net/" title="OpenVPN">OpenVPN</a> a delight, but what do you
do with your client.ovpn file once you have it?</p>

<p>If you spend most of your time in a terminal anyway, then I would
suggest just putting all your client.ovpn files into <code class="language-plaintext highlighter-rouge">~/.openvpn</code>,
renaming them in some appropriate way, and then using them simply by
typing:</p>

<!--more-->

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo openvpn client.ovpn
</code></pre></div></div>

<p>If, on the other hand, you live in a more graphically orientated world,
then you might like to integrate them into Network Manager. Sadly, the
Import feature in Ubuntu does not work, at least in the versions of
Ubuntu that I have used, and you have to make a few changes first.</p>

<p>Firstly, I would always create a hidden directory into which to store
your client files:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ mkdir ~/.openvpn
$ cd ~/.openvpn
$ mv ~/Downloads/client.ovpn ./
</code></pre></div></div>

<p>Secondly, you need to ensure that you have installed openvpn for
network-manager:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo apt-get install network-manager-openvpn-gnome
</code></pre></div></div>

<p>Thirdly, we need to extract some data out of the client.ovpn, and for
this I followed <a href="http://howto.praqma.net/ubuntu/vpn/openvpn-access-server-client-on-ubuntu" title="OpenVPN Access Server Client on Ubuntu">these
instructions</a>,
which I include below in case of link breakage:</p>

<ol>
  <li>Open client.ovpn in your favour text editor and copy the lines
between the &lt;ca&gt; tags into a new file named client.ca.</li>
  <li>Remove &lt;ca&gt; section including tags.</li>
  <li>Now copy the lines between the &lt;cert&gt; tags into a new file
named client.crt.</li>
  <li>Remove &lt;cert&gt; section including tags.</li>
  <li>Now copy the lines between &lt;key&gt; tags into a new file
named client.key.</li>
  <li>Remove &lt;key&gt; section including tags.</li>
  <li>Now copy the lines between &lt;tls-auth&gt; tags into a new file named
client.tls.</li>
  <li>Remove &lt;tls-auth&gt; section including tags.</li>
  <li>Remove the line “key-direction 1”.</li>
  <li>Insert the following text above the line # —–BEGIN RSA
SIGNATURE—– :</li>
</ol>

<!-- -->

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ca client.ca
cert client.crt
key client.key
tls-auth client.tls 1
</code></pre></div></div>

<p>Finally, save and close all the files and check that you now have all
the above files sitting happily in your ~/.openvpn directory.</p>

<p>Go to Network Manager -&gt; Edit Connections -&gt;VPN and click Import,
browse to the modified client.ovpn import that file.</p>

<p>Enter vpn username and password if prompted.</p>

<p>On the VPN page, select Advanced and on the General Tab, uncheck the
first option, “Use custom gateway.</p>


       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Simple networking in KVM</title>
      <link>https://chrisjrob.com/2009/03/21/simple-networking-in-kvm/</link>
      <pubDate>Sat, 21 Mar 2009 05:32:36 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2009/03/21/simple-networking-in-kvm</guid>
      <description>
       <![CDATA[
         
         <p>Most instructions on the web are suggesting setting up bridging and setting the interface to work in promiscuous mode; which I understand has security implications. I came across <a href="http://calamari.reverse-dns.net:980/cgi-bin/moin.cgi/QemuOnLinux">this website</a> which seemed to promise a simple alternative, by which instead of bridging the networks we just advertise the presence of the guest interface. It seems to work well as far as I can tell.</p>

<!--more-->

<h2 id="configuration">Configuration</h2>

<ul>
  <li>Host IP: 192.168.0.17</li>
  <li>TUN Interface IP: 192.168.0.18</li>
  <li>Guest Interface IP: 192.168.0.19</li>
</ul>

<p>I went into windows and provisioned the emulated ethernet interface with an IP address of 192.168.0.19; along with appropriate DNS settings and default gateway settings. I’ve also reserved the address 192.168.0.18 for use by the tunnel device.</p>

<p>My <code class="language-plaintext highlighter-rouge">/etc/qemu-ifup</code> looks like this:</p>

<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">#!/bin/sh</span>
<span class="c"># configure tun0 device (UML and newer versions of Qemu use tap0 here!)</span>
<span class="nb">sudo</span> /sbin/ifconfig <span class="nv">$1</span> 192.168.0.18

<span class="c"># activate ip forwarding</span>
<span class="nb">sudo </span>bash <span class="nt">-c</span> <span class="s1">'echo 1 &gt; /proc/sys/net/ipv4/ip_forward'</span>

<span class="c"># set up routing to the guest IP</span>
<span class="nb">sudo </span>route add <span class="nt">-host</span> 192.168.0.19 dev tap0

<span class="c"># activate ARP proxy to "spoof" arp address</span>
<span class="nb">sudo </span>bash <span class="nt">-c</span> <span class="s1">'echo 1 &gt; /proc/sys/net/ipv4/conf/tap0/proxy_arp'</span>

<span class="c"># set "spoofed" arp address</span>
<span class="nb">sudo </span>arp <span class="nt">-Ds</span> 192.168.0.19 eth0 pub
</code></pre></div></div>

<p>Thats it… The bridging is done only for a single IP address by installing a proxy ARP.</p>

<h2 id="running">Running</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo kvm -hda w2k3.img -smp 2 -m 512 -no-acpi -k en-gb -net nic,model=rtl8139 -net tap,script=/etc/qemu-ifup -usb -usbdevice tablet -snapshot
</code></pre></div></div>

<ul>
  <li>Note that you must sudo the command, as root priority is required for the qemu-ifup script.</li>
  <li>Note also that for some reason under KVM you need to specify the qemu-ifup script, as it does not default to that. I suspect that it defaults to kvm-ifup, but I have not looked into this further.</li>
  <li>The USB switch is useful in that it enables the mouse to leave the virtual window, and also seems to synchronise the host/guest cursors, which was a problem on our installation.</li>
</ul>

<h2 id="references">References</h2>

<ul>
  <li><a href="http://fabrice.bellard.free.fr/qemu/">QEMU</a></li>
  <li><a href="http://calamari.reverse-dns.net:980/cgi-bin/moin.cgi/QemuOnLinux">QEMU Networking</a>
    <ul>
      <li><a href="http://www.cnpbagwell.com/QEMU/HomePage">QEMU Setup Hints</a></li>
    </ul>
  </li>
</ul>

       ]]>
      </description>
    </item>
    
  </channel> 
</rss>
