<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Exploits of Plouj &#187; fedora</title>
	<atom:link href="http://www.plouj.com/blog/tag/fedora/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.plouj.com/blog</link>
	<description>A blog by Michael Ploujnikov</description>
	<lastBuildDate>Tue, 01 Feb 2011 13:55:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>OpenDNS in Fedora with corporate DHCP and DNS with NetworkManager</title>
		<link>http://www.plouj.com/blog/2009/04/20/opendns-in-fedora-with-corporate-dhcp-and-dns/</link>
		<comments>http://www.plouj.com/blog/2009/04/20/opendns-in-fedora-with-corporate-dhcp-and-dns/#comments</comments>
		<pubDate>Mon, 20 Apr 2009 22:24:00 +0000</pubDate>
		<dc:creator>plouj</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[DHCP]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[nameserver]]></category>
		<category><![CDATA[networkmanager]]></category>
		<category><![CDATA[opendns]]></category>

		<guid isPermaLink="false">http://www.plouj.com/blog/?p=279</guid>
		<description><![CDATA[Here is how to configure a Fedora workstation to use OpenDNS nameservers in a network with corporate DNS and DHCP servers without loosing access to their services. This was done on a Fedora 9 machine with dnsmasq being the local DNS server. It should also work on newer Fedora versions and even other GNU/Linux distributions. [...]]]></description>
			<content:encoded><![CDATA[<p>Here is how to configure a Fedora workstation to use <a href="http://www.opendns.com/">OpenDNS</a> nameservers in a network with corporate DNS and DHCP servers without loosing access to their services.<br />
This was done on a Fedora 9 machine with <a href="http://www.thekelleys.org.uk/dnsmasq/doc.html">dnsmasq</a> being the local DNS server. It should also work on newer Fedora versions and even other GNU/Linux distributions.</p>
<p>The setup is actually very simple and unobtrusive. It is only necessary to properly configure a local DNS server and then force 127.0.0.1 to be used as the only nameserver instead of the corporate DNS servers.</p>
<p>First you need to configure dnsmasq as follows:</p>
<h2>/etc/dnsmasq.conf</h2>
<pre>
# don't use the /etc/resolv.conf file anymore
no-resolv

# OpenDNS nameservers:
server=208.67.222.222
server=208.67.220.220

# Force corporate nameservers for corporate.domain.com lookups
# OpenDNS wouldn't be able to answer such queries correctly
# adjust to suit your network
server=/corporate.domain.com/10.1.1.1
server=/corporate.domain.com/10.1.1.2

# only respond to queries from the local machine
listen-address=127.0.0.1
bind-interfaces

conf-dir=/etc/dnsmasq.d
</pre>
<p>Then you need to go into NetworkManager and set 127.0.0.1 as the DNS server to be used:<br />
<img src="http://www.plouj.com/blog/wp-content/uploads/2009/04/nm-localhost-dns-server.png" alt="nm-localhost-dns-server" title="nm-localhost-dns-server" width="439" height="522" class="alignnone size-full wp-image-423" /></p>
<p>This will result in the following important settings added to your network scripts:</p>
<pre>
DNS1=127.0.0.1
PEERDNS=no
</pre>
<p>I&#8217;ve noticed two minor problems with this setup:</p>
<ol>
<li>the corporate DNS server names are hardcoded in the configuration. Usually they are determined automatically by the DHCP client.</li>
<li>restarting the dnsmasq service sometimes shows this error:
<pre>dnsdomainname: Host name lookup failure</pre>
</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.plouj.com/blog/2009/04/20/opendns-in-fedora-with-corporate-dhcp-and-dns/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TAP that DHCP bridge for some Qemu TUN in Fedora</title>
		<link>http://www.plouj.com/blog/2008/07/29/tap-that-dhcp-bridge-for-some-qemu-tun-in-fedora/</link>
		<comments>http://www.plouj.com/blog/2008/07/29/tap-that-dhcp-bridge-for-some-qemu-tun-in-fedora/#comments</comments>
		<pubDate>Tue, 29 Jul 2008 23:22:40 +0000</pubDate>
		<dc:creator>plouj</dc:creator>
				<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[bridge]]></category>
		<category><![CDATA[DHCP]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[Qemu]]></category>
		<category><![CDATA[Redhat]]></category>
		<category><![CDATA[sysconfig]]></category>
		<category><![CDATA[TAP]]></category>
		<category><![CDATA[TUN]]></category>

		<guid isPermaLink="false">http://www.plouj.com/blog/?p=20</guid>
		<description><![CDATA[The other day I needed to setup bridged networking for a Qemu virtual machine. Although I found a rather well written generic TAP interfaces guide on Wikibooks. It only explained how to configure a network bridge on a host machine with a static IP. I wanted to do this on a host that used DHCP. [...]]]></description>
			<content:encoded><![CDATA[<p>The other day I needed to setup bridged networking for a Qemu virtual machine. Although I found a rather well written generic <a href="http://en.wikibooks.org/wiki/QEMU/Networking#TAP_interfaces">TAP interfaces guide on Wikibooks</a>. It only explained how to configure a network bridge on a host machine with a static IP. I wanted to do this on a host that used DHCP. Plus I wanted to keep all configuration in Fedora specific places. Having discovered a good way to do this through experimentation after a few fruitless Google searches I thought it would be useful for myself and others to have the configuration documented here.</p>
<h2>ifcfg-eth0</h2>
<p>First, I changed the host&#8217;s (auto-generated) <code>/etc/sysconfig/network-scripts/ifcfg-eth0</code> script from this:</p>
<pre># Attansic Technology Corp. L1 Gigabit Ethernet Adapter
DEVICE=eth0
BOOTPROTO=dhcp
HWADDR=00:1D:60:35:A7:64
ONBOOT=yes</pre>
<p>to this:</p>
<pre># Attansic Technology Corp. L1 Gigabit Ethernet Adapter
DEVICE=eth0
TYPE=Ethernet
BRIDGE=br0
ONBOOT=yes</pre>
<p>This turns off DHCP on the physical Ethernet device and just specifies that it will be connected to or a part of a bridge.</p>
<h2>ifcfg-br0</h2>
<p>Second, I created <code>/etc/sysconfig/network-scripts/ifcfg-br0</code>, which will be called to setup a bridge device:</p>
<pre>DEVICE=br0
TYPE=Bridge
BOOTPROTO=dhcp
HWADDR=00:1D:60:35:A7:64
ONBOOT=yes
DELAY=0
STP=off</pre>
<p>As you can see, most of this configuration is copied from eth0 plus the bridge configuration as per the Qemu Wikibook.</p>
<h2>qemu-ifup/down</h2>
<p>Third, I shortened the <code>/etc/qemu-ifup</code> and <code>/etc/qemu-ifdown</code> from Wikibooks to get this:</p>
<p><em>/etc/qemu-ifup:</em></p>
<pre>#!/bin/sh
USER=$(id -un)
sudo /usr/sbin/openvpn --mktun --dev $1 --user "$USER"
sudo /sbin/ifconfig $1 0.0.0.0 promisc up
sudo /usr/sbin/brctl addif br0 $1</pre>
<p><em>/etc/qemu-ifdown:</em></p>
<pre>#!/bin/sh
sudo /sbin/ifconfig $1 down
sudo /usr/sbin/brctl delif br0 $1
sudo /usr/sbin/openvpn --rmtun --dev $1</pre>
<p>Here I basically removed all of the configuration that is taken care of in the sysconfig scripts. I also made explicit use of sudo simply because that is my preference.</p>
<h2>Final steps</h2>
<p>Now I can simply run <code>/etc/qemu-ifup tap0</code> once to create a TAP device, and use something like: <code>qemu-kvm -hda /virtual-machines/fedora9.disk -m 512 -net nic -net tap,ifname=tap0,script=no</code> to start a virtual machine. When I&#8217;m done running the virtual machine, I can run <code>/etc/qemu-ifdown tap0</code> to remove the TAP device.</p>
<p>All this sounds simple now that it&#8217;s working, but initially it took a lot of guessing on my part so I&#8217;m documenting it here for the future.</p>
<p>I would appreciate it if someone can point me to the official Redhat/Fedora documentation on editing <code>/etc/sysconfig/network-scripts/</code> scripts.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plouj.com/blog/2008/07/29/tap-that-dhcp-bridge-for-some-qemu-tun-in-fedora/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Lexmark E250DN IPP Printing in CUPS</title>
		<link>http://www.plouj.com/blog/2008/06/22/lexmark-e250dn-ipp-printing-in-cups/</link>
		<comments>http://www.plouj.com/blog/2008/06/22/lexmark-e250dn-ipp-printing-in-cups/#comments</comments>
		<pubDate>Mon, 23 Jun 2008 01:14:24 +0000</pubDate>
		<dc:creator>plouj</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[cups]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[ipp]]></category>
		<category><![CDATA[lexmark]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[printing]]></category>

		<guid isPermaLink="false">http://www.plouj.com/blog/?p=19</guid>
		<description><![CDATA[I just finished setting up my newly purchased monochrome duplex network printer &#8211; Lexmark E250DN. It took me a while to figure out how to configure CUPS on my GNU/Linux/Fedora machines to communicate with this printer. The problem was that I just didn&#8217;t know what URI to use for the printer. Unsurprisingly, the PDF and [...]]]></description>
			<content:encoded><![CDATA[<p>I just finished setting up my newly purchased monochrome duplex network printer &#8211; Lexmark E250DN. It took me a while to figure out how to configure CUPS on my GNU/Linux/Fedora machines to communicate with this printer. The problem was that I just didn&#8217;t know what URI to use for the printer. Unsurprisingly, the PDF and HTML documents that came with the printer didn&#8217;t mention such information. After all, why would Windows users need to know that if they can simply run the printer-specific utility to configure everything for them? Sheesh&#8230; Anyways. The CUPS manual was actually quite useful in listing <a href="http://localhost:631/help/network.html?QUERY=lexmark#TABLE1">common printer URIs</a>. It turned out that the Lexmark URI <code>lpd://printer-address/ps</code> and a Generic PostScript driver worked quite well. In fact, the &#8220;/ps&#8221; part seems to be irrelevant, so simply <code>lpd://printer.lan</code> worked for me. However, the CUPS manual also suggested <a href="http://localhost:631/help/network.html?QUERY=lexmark#LPD">avoiding the LPD protocol</a> if the printer supported other protocols. Using nmap I confirmed that my printer has at least something running on the IPP port (631):</p>
<pre>$ nmap printer.lan

Starting Nmap 4.53 ( http://insecure.org ) at 2008-06-22 20:39 EDT
Interesting ports on printer.lan (10.1.1.7):
Not shown: 1705 closed ports
PORT      STATE SERVICE
21/tcp    open  ftp
79/tcp    open  finger
80/tcp    open  http
515/tcp   open  printer
631/tcp   open  ipp
5001/tcp  open  commplex-link
8000/tcp  open  http-alt
9100/tcp  open  jetdirect
10000/tcp open  snet-sensor-mgmt

Nmap done: 1 IP address (1 host up) scanned in 0.396 seconds</pre>
<p>After a bit of trial and error, I discovered that simply using the <code>http://printer.lan:631</code> or <code>ipp://printer.lan</code> URI and a Generic PostScript driver worked without problems with E250DN.</p>
<p>Apart from these initial pains I am quite happy to be able to print double-sided black-and-white documents from all of my home computers.</p>
<h1>Side Note:</h1>
<p>During the investigation process, I noticed that Fedora&#8217;s system-config-printer utility prints the following information to the terminal when I tell it the IPP printer hostname:</p>
<pre>...
printer.lan: /usr/lib/cups/backend/snmp "${HOST}" 2&gt;/dev/null
printer.lan: hp-makeuri -c "${HOST}" 2&gt; /dev/null
No ID match for device ipp://printer.lan:
&lt;manufacturer&gt;Lexmark&lt;/manufacturer&gt;
  &lt;model&gt;E250dn 6216N4G LE.PM.P121 -- Part Number -&lt;/model&gt;
  &lt;description&gt;Lexmark E250dn 6216N4G LE.PM.P121 -- Part Number -&lt;/description&gt;
  &lt;commandset&gt;&lt;/commandset&gt;
Using textonly.ppd
...</pre>
<p>I wonder how I could get that XML-ish output myself. It doesn&#8217;t seem to come from hp-makeuri.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plouj.com/blog/2008/06/22/lexmark-e250dn-ipp-printing-in-cups/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fedora 9 Jigdo</title>
		<link>http://www.plouj.com/blog/2008/05/14/fedora-9-jigdo/</link>
		<comments>http://www.plouj.com/blog/2008/05/14/fedora-9-jigdo/#comments</comments>
		<pubDate>Wed, 14 May 2008 20:55:00 +0000</pubDate>
		<dc:creator>plouj</dc:creator>
				<category><![CDATA[tools]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[jigdo]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.plouj.com/blog/?p=13</guid>
		<description><![CDATA[So Fedora 9 has been released upon the masses yesterday. I won&#8217;t be able to try it for a while, but I decided to start downloading it now anyways. On the download page I noticed a curious new option of using Jigdo. After reading a bit about Jigdo it looks like it could fit me [...]]]></description>
			<content:encoded><![CDATA[<p>So <a href="http://docs.fedoraproject.org/release-notes/f9/">Fedora 9</a> has been released upon the masses yesterday. I won&#8217;t be able to try it for a while, but I decided to start downloading it now anyways. On the download page I noticed a curious new option of using <a href="http://atterer.net/jigdo/">Jigdo</a>. After reading a bit about Jigdo it looks like it could fit me well. I have, what I consider to be, a fast (5Mbit download) Internet connection, but I don&#8217;t like the idea of straining mirror download servers of Free Software projects which usually exist on a volunteer basis (A recent check shows that the main Fedora mirror is indeed overloaded). Plus, my bittorrent download keeps going inactive so I&#8217;m currently downloading Fedora 9 with Jigdo.</p>
<p>In Fedora 8, Jigdo was easy to install:<br />
<code># yum install jigdo</code></p>
<p>From the jgdo manpage I discovered that the command line <strong>client</strong> version of jigdo is actually called &#8220;jigdo-lite&#8221;. Using this client turned out to be as easy as telling it which &#8220;.jigdo&#8221; file to use:</p>
<p><code>$ jigdo-lite http://www.muug.mb.ca/pub/fedora/linux/releases/9/Fedora/x86_64/jigdo/Fedora-9-x86_64-DVD.jigdo</code></p>
<p>Jigdo was nice enough to ask me to enter a path to previous installation media (presumably Fedora) to check for files which can be reused. To my amusement it turned out that the Fedora 7 x86_64 DVD contained no such files while the Fedora 8 x86_64 DVD contained 116 of the 2691 files required by the template.</p>
<p>Resuming jigdo was an interesting process. I canceled the first attempt with Ctrl-C. Then I simply re-ran the original jigdo command and it told me:</p>
<pre>The temporary directory `Fedora-9-x86_64-DVD.iso.tmpdir' already exists. Its contents
ARE GOING TO BE DELETED (possibly after having been copied to the
image, if they are of interest for it). If you do not want this
to happen, press Ctrl-C now. Otherwise, press Return to proceed.</pre>
<p>This puzzled me because it didn&#8217;t say what is the meaning of the files in the *.tmpdir directory. Without knowing that I shouldn&#8217;t be expected to assess the importance of the directory and make a decision about deleting it. My initial guess was that it contained <strong>everything</strong> that jigdo has downloaded in the previous session. I checked the &#8220;jigdo&#8221; and &#8220;jigdo-lite&#8221; mangpages but they did not mention resuming. Thankfully, the documentation on the website was more helpful. The <a href="http://atterer.net/jigdo/debian-jigdo-mini-howto/x205.html#DOWNLOADINGOFTHEISO">Downloading Of The ISO</a> section made it clear that I shouldn&#8217;t fear to loose Fedora-9-x86_64-DVD.iso.tmpdir after all. Apparently it simply stores files which have <strong>just</strong> been downloaded but haven&#8217;t been merged into the temporary image (which is called Fedora-9-x86_64-DVD.iso.tmp). I checked that currently Fedora-9-x86_64-DVD.iso.tmpdir is much smaller than Fedora-9-x86_64-DVD.iso.tmp so I feel confident in letting jigdo delete that dir:</p>
<pre>$ ls -lah
total 3.9G
drwxrwxr-x  3 plouj plouj 4.0K 2008-05-14 15:48 .
drwxr-xr-x 25 plouj plouj 4.0K 2008-05-14 11:16 ..
-rw-rw-r--  1 plouj plouj 314K 2008-05-14 11:30 Fedora-9-x86_64-DVD.iso.list
-rw-rw-r--  1 plouj plouj 3.9G 2008-05-14 15:47 Fedora-9-x86_64-DVD.iso.tmp
drwxrwxr-x  4 plouj plouj 4.0K 2008-05-14 15:47 Fedora-9-x86_64-DVD.iso.tmpdir
-rw-rw-r--  1 plouj plouj 211K 2008-05-12 13:11 Fedora-9-x86_64-DVD.jigdo
-rw-rw-r--  1 plouj plouj  12M 2008-05-12 11:38 Fedora-9-x86_64-DVD.template
-rw-rw-r--  1 plouj plouj 3.0M 2008-05-14 11:30 jigdo-file-cache.db
$ du -sh Fedora-9-x86_64-DVD.iso.tmpdir
7.5M	Fedora-9-x86_64-DVD.iso.tmpdir</pre>
<p>Find confirms the same:</p>
<pre>$ find Fedora-9-x86_64-DVD.iso.tmpdir -type f
Fedora-9-x86_64-DVD.iso.tmpdir/gulus.usherbrooke.ca/pub/distro/fedora/linux/releases/9/Fedora/x86_64/os/Packages/lucene-contrib-2.3.0-1jpp.0.fc9.x86_64.rpm
Fedora-9-x86_64-DVD.iso.tmpdir/gulus.usherbrooke.ca/pub/distro/fedora/linux/releases/9/Fedora/x86_64/os/Packages/libpng-1.2.24-1.fc9.x86_64.rpm
Fedora-9-x86_64-DVD.iso.tmpdir/gulus.usherbrooke.ca/pub/distro/fedora/linux/releases/9/Fedora/x86_64/os/Packages/lftp-3.6.3-2.fc9.i386.rpm
Fedora-9-x86_64-DVD.iso.tmpdir/www.muug.mb.ca/pub/fedora/linux/releases/9/Fedora/x86_64/os/Packages/glibc-2.8-3.x86_64.rpm</pre>
<p>After I pressed &#8220;Return&#8221;, jigdo happily resumed downloading my Fedora 9 DVD. Some time later, the download finished successfully and the resulting image passed the SHA1SUM check.</p>
<p>In addition to the resuming confusion I noticed a few other problems with Jigdo. Firstly, it just takes a long time to download and check all the files. It has been running for over 3 hours and at 500KB/s (the average speed I get from good servers) the whole DVD image (3970.8 MB) would have been downloaded by now. Secondly, the name is hard to spell correctly. I&#8217;ve gone from &#8220;Jingo&#8221; to &#8220;Jidgo&#8221; to &#8220;Figdo&#8221;.</p>
<p>To be fair, I have to admit that the coolness of what jigdo does in the background outweighs its shortcomings and I am happy with it in the end.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.plouj.com/blog/2008/05/14/fedora-9-jigdo/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

