<?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>Reflections // Images And Words &#187; Linux</title>
	<atom:link href="http://www.henningweiler.de/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.henningweiler.de</link>
	<description>Images And Words - reflections from around the globe</description>
	<lastBuildDate>Tue, 08 Nov 2011 21:16:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>[Extension] XEN Mixed Networking (translation from referenced German howto)</title>
		<link>http://www.henningweiler.de/2009/09/11/extension-xen-mixed-networking-translation-from-referenced-german-howto/</link>
		<comments>http://www.henningweiler.de/2009/09/11/extension-xen-mixed-networking-translation-from-referenced-german-howto/#comments</comments>
		<pubDate>Fri, 11 Sep 2009 10:28:25 +0000</pubDate>
		<dc:creator>henning</dc:creator>
				<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Hetzner]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[Xen]]></category>

		<guid isPermaLink="false">http://www.henningweiler.de/?p=93</guid>
		<description><![CDATA[This is a translation of the Hetzner Dokuwiki Article &#8220;Xen mit Routing-Setup und zusätzlicher (interner) Bridge&#8221; [1] which I mentioned in my last post about XEN Networking [2]. [1] http://wiki.hetzner.de/index.php/Xen_mit_Routing_und_Bridge [2] http://www.henningweiler.de/?p=85 1. Preparation First, you copy &#8216;vif-route&#8217; to &#8216;vif-virtual&#8217; and &#8216;network-route&#8217; to &#8216;network-virtual. Both are located in /etc/xen/scripts. The, you&#8217;ll have to patch the [...]]]></description>
			<content:encoded><![CDATA[<p>This is a translation of the Hetzner Dokuwiki Article &#8220;Xen mit Routing-Setup und zusätzlicher (interner) Bridge&#8221; [1] which I mentioned in my last post about XEN Networking [2]. </p>
<p>[1] http://wiki.hetzner.de/index.php/Xen_mit_Routing_und_Bridge<br />
[2] http://www.henningweiler.de/?p=85</p>
<p><span id="more-93"></span></p>
<p><strong>1. Preparation</strong></p>
<p>First, you copy &#8216;vif-route&#8217; to &#8216;vif-virtual&#8217; and &#8216;network-route&#8217; to &#8216;network-virtual. Both are located in /etc/xen/scripts. The, you&#8217;ll have to patch the file &#8216;vif-virtual&#8217; :</p>
<p><code><br />
 --- vif-route   2008-04-25 15:03:45.000000000 +0200<br />
 +++ vif-virtual 2008-05-02 14:29:22.725192247 +0200<br />
 @@ -47,6 +47,11 @@<br />
      done<br />
  fi</p>
<p> +# add/remove vif to internalbridge<br />
 +if [ `echo "${vif}" | grep -e ".*\-br$"` ]; then<br />
 +    brctl ${ipcmd}if xeninternbr0 ${vif}<br />
 +fi<br />
 +<br />
  handle_iptable</p>
<p>  log debug "Successful vif-route $command for $vif."<br />
</code></p>
<p>The host (dom0) has to have a bridge on startup, which you can create in /etc/network/interfaces and give it an internal IP. Mine looks something like this:</p>
<p><code><br />
auto xenintbr<br />
iface xenintbr inet static<br />
  address   10.10.10.100<br />
  netmask   255.0.0.0<br />
  pre-up /usr/sbin/brctl addbr xenintbr<br />
  post-up /usr/sbin/tunctl -t tap0<br />
  post-up /usr/sbin/brctl addif xenintbr tap0<br />
  post-down /sbin/ifconfig xenintbr down<br />
  post-down /usr/sbin/brctl delbr xenintbr<br />
  post-down /usr/sbin/tunctl -d tap0<br />
#  bridge_maxwait 0<br />
#  bridge_fd 0<br />
#  bridge_hello 0<br />
#  bridge_stp off<br />
  post-up /sbin/ifconfig xenintbr 10.10.10.100 netmask 255.0.0.0<br />
</code></p>
<p>Now edit the file /etc/xen/xend-config.sxp and substitute the vif-route and network-route entries with the following entries:</p>
<p><code><br />
 (network-script network-virtual)<br />
 (vif-script     vif-virtual)<br />
</code></p>
<p><strong>2. DomU Configuration</strong></p>
<p>The configuration for the virtual Network Interfaces for the corresponding DomU configuration file has to be setup in the following way:</p>
<p><code><br />
 vif = [ 'ip=xx.xx.xx.xx,mac=aa:bb:cc:dd:ee:ff,vifname=domUname-vif',<br />
 'mac=aa:bb:cc:dd:ee:ff,vifname=domUname-vif-br']<br />
</code></p>
<p>The first line describes the public IP(v4) address in your providers subnet. The second line describes the internal interface. Remember to change the MAC Adresses for both interfaces since those have to be different!</p>
<p>The extension &#8216;-vif&#8217; or &#8216;-vif-br&#8217; determines if the interface is connected to the external interface or to the internal bridge, whereby the &#8216;-vif-br&#8217; resembles the bridge. With the configuration shown above, the domU will have two interfaces (eth0 and eth1) where eth0 points to the external interface and eth1 to the internal bridge.</p>
<p><strong>3. Finishing Touches</strong></p>
<p>To be able to use the network, the domU internal network configuration in /etc/network/interfaces has to be changed to hold an internal IP address on eth1 (which corresponds to an IP address in the subnet you specified in the bridge configuration).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.henningweiler.de/2009/09/11/extension-xen-mixed-networking-translation-from-referenced-german-howto/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>XEN Mixed Networking (Direct Routing + Internal Bridge)</title>
		<link>http://www.henningweiler.de/2009/08/15/xen-mixed-networking-direct-routing-internal-bridge/</link>
		<comments>http://www.henningweiler.de/2009/08/15/xen-mixed-networking-direct-routing-internal-bridge/#comments</comments>
		<pubDate>Sat, 15 Aug 2009 20:16:18 +0000</pubDate>
		<dc:creator>henning</dc:creator>
				<category><![CDATA[Chaos]]></category>
		<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.henningweiler.de/?p=85</guid>
		<description><![CDATA[Hi Everybody, in order to setup a new server, I had to deal with this more or less troublesome topic. I want to give everybody a hint who is facing trouble with this. The Setup: - Debian Lenny (Kernel 2.6.26-2-xen-amd64) 64 Bit host and 64 Bit guests - xen-hypervisor 3.2-1 The Goal: I. have a [...]]]></description>
			<content:encoded><![CDATA[<p>Hi Everybody,</p>
<p>in order to setup a new server, I had to deal with this more or less troublesome topic. I want to give everybody a hint who is facing trouble with this.</p>
<p>The Setup:<br />
- Debian Lenny (Kernel 2.6.26-2-xen-amd64) 64 Bit host and 64 Bit guests<br />
- xen-hypervisor 3.2-1</p>
<p>The Goal:<br />
I. have a directly routed interface for the public IPs<br />
II. create a virtual LAN between the domUs<br />
III. let the hosts on the virtual LAN talk to the outside world (those are mostly the domUs, which do not have a public IP)</p>
<p>First, for I. and II. go ahead and apply the tutorial in [1]</p>
<p>In addition to that, I had to perform the following operations:<br />
<strong>edit /etc/xen/scripts/vif-common.sh</strong> and add the two lines indicated</p>
<p><code>vifname=$(xenstore_read_default "$XENBUS_PATH/vifname" "")<br />
if [ "$vifname" ]<br />
then<br />
  if [ "$command" == "online" ] &#038;&#038; ! ip link show "$vifname" >&#038;/dev/null<br />
  then<br />
    do_or_die ip link set "$vif" down ### ADD THIS LINE<br />
    do_or_die ip link set "$vif" name "$vifname"<br />
    do_or_die ip link set "$vifname" up ### ADD THIS LINE<br />
  fi<br />
  vif="$vifname"<br />
fi</code></p>
<p>Ok, now there is something you should keep in mind:<br />
While editing your domU config be sure to <strong>keep the vifname parameter SHORT</strong>!! I called it &#8216;mysql-mirror-vif-br&#8217; which was way too long, which then resulted in a non-starting script. The script did not tell me anything. Not on stdout not in the logs. Now it&#8217;s &#8216;mymirr-vif-br&#8217; which is fine.</p>
<p>For III. do the following for every IP you want to have internet access from the inside of the respective domU:</p>
<p><code>iptables -t nat -A POSTROUTING -o eth0 -s virtualLanIP/32 -j MASQUERADE</code></p>
<p>Hope this helps someone. </p>
<p>Cheers!</p>
<p>[1] Hetzner Dokuwiki: http://wiki.hetzner.de/index.php/Xen_mit_Routing_und_Bridge</p>
]]></content:encoded>
			<wfw:commentRss>http://www.henningweiler.de/2009/08/15/xen-mixed-networking-direct-routing-internal-bridge/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>CUPS and Multiple Identical Printers</title>
		<link>http://www.henningweiler.de/2009/01/20/cups-and-multiple-identical-printers/</link>
		<comments>http://www.henningweiler.de/2009/01/20/cups-and-multiple-identical-printers/#comments</comments>
		<pubDate>Tue, 20 Jan 2009 12:25:24 +0000</pubDate>
		<dc:creator>henning</dc:creator>
				<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[administration]]></category>
		<category><![CDATA[Computer]]></category>
		<category><![CDATA[CUPS]]></category>
		<category><![CDATA[FS-1030D]]></category>
		<category><![CDATA[Kyocera]]></category>
		<category><![CDATA[multiple identical printers]]></category>

		<guid isPermaLink="false">http://www.henningweiler.de/?p=70</guid>
		<description><![CDATA[CUPS (Common Unix Printing System) and multiple identical printers can be a pain in the butt. Especially, if the printer manufacturers are naughty and do not make the printers serial number public on usb connect. This shall be a little how-to for all those people who discover the same trouble! The setup I had to [...]]]></description>
			<content:encoded><![CDATA[<p>CUPS (Common Unix Printing System) and multiple identical printers can be a pain in the butt. Especially, if the printer manufacturers are naughty and do not make the printers serial number public on usb connect.</p>
<p>This shall be a little how-to for all those people who discover the same trouble!</p>
<p><span id="more-70"></span></p>
<p>The setup I had to deal with:<br />
- Ubuntu (x64 Server)<br />
- CUPS 1.2.8<br />
- 2x Kyocera Mita FS-1030D attached via USB</p>
<p>The problem:<br />
If you connect both printers, they both get the same ID:<br />
<code><br />
# lsusb<br />
Bus 004 Device 093: ID 0482:0015 Kyocera Corp.<br />
Bus 004 Device 092: ID 0482:0015 Kyocera Corp.<br />
</code></p>
<p>AND (even worse) are both mapped to usb://Kyocera/FS-1030D</p>
<p>An auto-installation on the cups web interface will result in a success, BUT you&#8217;ll only be able to print on the first of the two USB devices. So not a good solution.</p>
<p>OK, this is where you want to go:</p>
<p>1. Set up the printer(s) using the web interface.<br />
2. Fire up your console and goto /dev/<br />
3. Find the files usblp0 and usblp1 (depending on your system, there might be a sub folder named &#8216;usb&#8217;. If so, see if there are two files named &#8216;lp0&#8242; and &#8216;lp1&#8242; in existance) and pad yourself on the back ;)<br />
4. Edit /etc/cups/printers.conf with your favourite editor.<br />
5. You&#8217;ll find the first printer which looks like this:<br />
<code><br />
&lt;Printer Kyocera_FS-1030D_USB_1&gt;<br />
Info Kyocera FS-1030D<br />
Location Local Printer<br />
DeviceURI usb://Kyocera/FS-1030D<br />
State Idle<br />
StateTime 1231879830<br />
Accepting Yes<br />
Shared Yes<br />
JobSheets none none<br />
QuotaPeriod 0<br />
PageLimit 0<br />
KLimit 0<br />
OpPolicy default<br />
ErrorPolicy retry-job<br />
</Printer><br />
</code><br />
Leave it like this!! (Otherwise, CUPS web interface will harass you with newly found printers.)</p>
<p>6. Right under the first printer you&#8217;ll find the second printer (and the third, the fourth, [...]) named &lt;Printer Kyocera_FS-1030D_USB_2&gt; for example. THERE (and on possibly other following identical printers) change the following line<br />
<code><br />
DeviceURI usb://Kyocera/FS-1030D<br />
</code><br />
to<br />
<code><br />
DeviceURI file:/dev/usblp1<br />
</code><br />
The other printers below need their equivalent usb device link. You could to a<br />
<code><br />
# echo usblp1 > /dev/usblp1<br />
</code><br />
which will actually print the word &#8216;usblp1&#8242; on the printer. If you do so with all of your printers, you&#8217;ll know the device link ;)</p>
<p>Ok, we are not quite there, yet. I found a strange behaviour of CUPS, when you switch the printers off over night and turn them on again the next morning. Somehow, having this configuration, CUPS simply quits without following any shutdown procedures. No log entries, no good bye letter, nothing.</p>
<p>In order to detect and overcome this situation, this little script monitors the cups daemon and restarts it if necessary:</p>
<p><code><br />
#!/bin/bash<br />
#<br />
# cupsMon.sh -- A Monitor for CUPS<br />
#<br />
# @author Henning Weiler<br />
# @version 1.0<br />
#</p>
<p>if [ -r /var/run/cups/cupsd.pid ]; then<br />
  CUPSPID=$(cat /var/run/cups/cupsd.pid)</p>
<p>  if ps --pid $CUPSPID | grep "cupsd" >/dev/null; then<br />
    exit 0<br />
  else<br />
    rm -f /var/run/cups/cupsd.pid /var/run/cups/cups.sock<br />
    /etc/init.d/cupsys start<br />
  fi<br />
else<br />
  /etc/init.d/cupsys start<br />
fi<br />
</code><br />
I put it in my root home directory and gave it a little &#8216;chmod +x&#8217;.</p>
<p>In your /etc/crontab add the following line:<br />
<code><br />
9 * * * * root /root/cupsMon.sh >> /dev/null<br />
</code><br />
This will run the monitor every 9 minutes. I did not want to run it every minute, since switching on multiple printers may take a while.</p>
<p>If you have any questions or concerns, please comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.henningweiler.de/2009/01/20/cups-and-multiple-identical-printers/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

