<?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>jansipke.nl &#187; Networking</title>
	<atom:link href="http://www.jansipke.nl/category/networking/feed" rel="self" type="application/rss+xml" />
	<link>http://www.jansipke.nl</link>
	<description>Technology Blog</description>
	<lastBuildDate>Tue, 10 Jan 2012 09:20:42 +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>Programming the Arduino ethernet shield</title>
		<link>http://www.jansipke.nl/programming-the-arduino-ethernet-shield</link>
		<comments>http://www.jansipke.nl/programming-the-arduino-ethernet-shield#comments</comments>
		<pubDate>Wed, 08 Sep 2010 20:04:18 +0000</pubDate>
		<dc:creator>jansipke</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Arduino]]></category>

		<guid isPermaLink="false">http://www.jansipke.nl/?p=1097</guid>
		<description><![CDATA[The Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. It features an IDE that allows you to program the Arduino using a standard USB cable. Several shields exist that extend the functionality of the standard Arduino platform. In the picture above the Arduino is shown on the left and [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.jansipke.nl/wp-content/uploads/arduino.png"><img class="alignnone size-full wp-image-1099" title="arduino" src="http://www.jansipke.nl/wp-content/uploads/arduino.png" alt="" width="400" height="150" /></a>The <a href="http://arduino.cc/">Arduino</a> is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. It features an <a href="http://arduino.cc/en/Main/Software">IDE</a> that allows you to program the Arduino using a standard USB cable. Several shields exist that extend the functionality of the standard Arduino platform. In the picture above the Arduino is shown on the left and the ethernet shield is shown on the right.</p>
<p>The ethernet shield adds IP communication, acting as a client or as a server. The most well-known protocols are supported right out of the box, including TCP, UDP and ICMP. Several enthousiasts have added support for even more protocols, such as DHCP and NTP.</p>
<p>Creating programs for the Arduino with the ethernet shield is simple:</p>
<blockquote>
<pre>#include 

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 10, 0, 0, 177 };
byte server[] = { 64, 233, 187, 99 }; // Google

Client client(server, 80);

void setup()
{
   Ethernet.begin(mac, ip);
   Serial.begin(9600);

   delay(1000);

   Serial.println("connecting...");

   if (client.connect()) {
      Serial.println("connected");
      client.println("GET /search?q=arduino HTTP/1.0");
      client.println();
   } else {
      Serial.println("connection failed");
   }
}

void loop()
{
   if (client.available()) {
      char c = client.read();
      Serial.print(c);
   }

   if (!client.connected()) {
      Serial.println();
      Serial.println("disconnecting.");
      client.stop();
      for(;;)
         ;
   }
}
</pre>
</blockquote>
<p>Every Arduino program has at least two parts: a <em>setup()</em> function and a <em>loop()</em> function. The Arduino IDE creates an actual proper C program around these two functions before it uploads the complete program to the Arduino.</p>
<p><a href="http://www.jansipke.nl/wp-content/uploads/serial-monitor.png"><img class="alignnone size-full wp-image-1110" title="serial-monitor" src="http://www.jansipke.nl/wp-content/uploads/serial-monitor.png" alt="" width="203" height="107" /></a>The Arduino IDE contains a serial monitor, which allows you to send strings to the Arduino program or receive strings from it. The example program above shows how the <em>Serial</em> class works. In the <em>setup() </em>function, the serial communication is started at 9600 baud. In the <em>loop()</em> function, data is sent over the serial line with the method <em>Serial.print()</em>. If the serial line is actually connected, the program on the Arduino will halt until the serial monitor is opened. If the serial line is not connected, e.g. when you are done debugging, the program will run normally.</p>
<p>The ethernet library contains the <em>Ethernet</em> class. In the <em>setup()</em> function, the ethernet stack is started with <em>Ethernet.begin(mac, ip)</em>. The <em>mac</em> and <em>ip</em> parameters are both byte arrays. If only these two parameters are present and the IP address has the form <em>a.b.c.d</em>, the gateway is assumed to be <em>a.b.c.1</em> and the subnetmask is assumed to be <em>255.255.255.0</em>. There are other constructors that take one or two extra parameters for people with different network setups.</p>
<p>After ethernet initialization, the class <em>Client</em> is used to create a TCP connection to the supplied server IP address and port number. The <em>Client.connect()</em> method tries to connect to the server and a call to <em>Client.println()</em> sends data over the TCP connection to the server. The <em>Client.available()</em> method tells if the server has sent data over the TCP connection to our client. If it has, a call to <em>Client.read()</em> gives these bytes.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jansipke.nl/programming-the-arduino-ethernet-shield/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using XenServer in a routed IP network</title>
		<link>http://www.jansipke.nl/using-xenserver-in-a-routed-ip-network</link>
		<comments>http://www.jansipke.nl/using-xenserver-in-a-routed-ip-network#comments</comments>
		<pubDate>Sun, 28 Mar 2010 11:19:10 +0000</pubDate>
		<dc:creator>jansipke</dc:creator>
				<category><![CDATA[Cloud computing]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[XenServer]]></category>

		<guid isPermaLink="false">http://www.jansipke.nl/?p=931</guid>
		<description><![CDATA[Hetzner is a hosting company in Germany where you can rent dedicated root servers per month. Using their KVM-over-IP setup, it is possible to install operating systems that are not available by default, such as XenServer by Citrix. With the machine, you get four public IP addresses. One of these addresses is given to you [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.jansipke.nl/wp-content/uploads/xenserver.png"><img class="alignnone size-full wp-image-940" title="xenserver" src="http://www.jansipke.nl/wp-content/uploads/xenserver.png" alt="" width="327" height="61" /></a><br />
<a href="http://www.hetzner.de/">Hetzner</a> is a hosting company in Germany where you can rent dedicated root servers per month. Using their KVM-over-IP setup, it is possible to install operating systems that are not available by default, such as <a href="http://www.xensource.com/">XenServer</a> by <a href="http://www.citrix.com/">Citrix</a>. With the machine, you get four public IP addresses. One of these addresses is given to you when the machine is assigned to you, the other three are assigned to you on request.</p>
<p>There is a problem with the public IP addresses Hetzner gives you. Within the Hetzner network, there is a hard connection between the MAC address of your machine and the IP addresses you have been given. This is a problem for virtual machines that are bridged onto the network by the host machine. These virtual machines have their own MAC address and the Hetzner network will drop packets from these unknown MAC addresses.</p>
<p>There is a solution to this problem: have the host machine route IP packets from the virtual machines to the network and vice versa. We will use the following addresses in the example below:</p>
<table>
<tbody>
<tr>
<td>IP addresses</td>
<td>188.40.109.204 (host), 188.40.109.250 (VM)</td>
</tr>
<tr>
<td>Netmask</td>
<td>255.255.255.192</td>
</tr>
<tr>
<td>Gateway</td>
<td>188.40.109.193 (host)</td>
</tr>
<tr>
<td>DNS</td>
<td>213.133.100.100</td>
</tr>
</tbody>
</table>
<p>We start with the configuration of the host machine (running XenServer). The first file is the configuration file of eth0: /etc/sysconfig/network-scripts/ifcfg-eth0</p>
<blockquote>
<pre>XEMANAGED=yes
DEVICE=eth0
ONBOOT=no
TYPE=Ethernet
HWADDR=40:61:86:be:ce:88 (replace with MAC address of host)
BRIDGE=xenbr0
</pre>
</blockquote>
<p>Notice that this file does not contain any IP configuration. The second file is the configuration file of xenbr0: /etc/sysconfig/network-scripts/ifcfg-xenbr0</p>
<blockquote>
<pre>XEMANAGED=yes
DEVICE=xenbr0
ONBOOT=no
TYPE=Bridge
DELAY=0
STP=off
PIFDEV=eth0
BOOTPROTO=none
IPADDR=188.40.109.204 (replace with IP address of host)
NETMASK=255.255.255.192
GATEWAY=188.40.109.193 (replace with gateway of host)
DNS1=213.133.100.100
DNS2=213.133.99.99
DNS3=213.133.98.98
</pre>
</blockquote>
<p>Now we need to enable IP forwarding on the host machine. We start with the sysctl configuration file: /etc/sysctl.conf</p>
<blockquote>
<pre>net.ipv4.ip_forward=1
net.ipv4.conf.all.send_redirects=0
net.ipv4.conf.default.send_redirects=0
net.ipv4.conf.lo.send_redirects=0
net.ipv4.conf.xenbr0.send_redirects=0
</pre>
</blockquote>
<p>The first line tells the machine to perform IP forwarding. The four lines after that tell the machine to disable sending ICMP redirects. The last file we need to edit is the firewall configuration file: /etc/sysconfig/iptables. Add this text below the line -A RH-Firewall-1-INPUT -i lo -j ACCEPT:</p>
<blockquote>
<pre>-A RH-Firewall-1-INPUT -i xenbr0 -o xenbr0 -j ACCEPT
</pre>
</blockquote>
<p>Now reboot the machine and continue with the IP configuration of the virtual machine running on XenServer. There is only one file we need to edit here, which is the configuration file of eth0: /etc/sysconfig/network-scripts/ifcfg-eth0</p>
<blockquote>
<pre>DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
HWADDR=8e:35:1e:3b:12:aa (replace with MAC address of VM)
IPADDR=188.40.109.250 (replace with IP address of VM)
NETMASK=255.255.255.192
GATEWAY=188.40.109.204 (replace with IP address of host)
</pre>
</blockquote>
<p>The gateway in this configuration is crucial: it needs to be the IP address of the host itself, not the gateway of the host.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jansipke.nl/using-xenserver-in-a-routed-ip-network/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Enable SSL in Apache</title>
		<link>http://www.jansipke.nl/enable-ssl-in-apache</link>
		<comments>http://www.jansipke.nl/enable-ssl-in-apache#comments</comments>
		<pubDate>Tue, 27 Oct 2009 12:44:50 +0000</pubDate>
		<dc:creator>jansipke</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[SSL]]></category>

		<guid isPermaLink="false">http://www.jansipke.nl/?p=585</guid>
		<description><![CDATA[To enable SSL in Apache, we need to perform some steps. We start by generating a key for our server: openssl genrsa -out server.key 4096 Then we generate a Certificate Signing Request (CSR) based on this key: openssl req -new -key server.key -out server.csr Make sure that you enter a valid value for Common Name [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-599" title="apache" src="http://www.jansipke.nl/wp-content/uploads/apache.gif" alt="apache" width="125" height="60" /></p>
<p>To enable SSL in Apache, we need to perform some steps.</p>
<p>We start by generating a key for our server:</p>
<blockquote>
<pre>openssl genrsa -out server.key 4096</pre>
</blockquote>
<p>Then we generate a Certificate Signing Request (CSR) based on this key:</p>
<blockquote>
<pre>openssl req -new -key server.key -out server.csr</pre>
</blockquote>
<p>Make sure that you enter a valid value for Common Name (CN). It is vital that you enter the Fully Qualified Domain Name (FQDN) or IP address of your server here.</p>
<p>If we want a legitimate SSL certificate for Apache, we need to take this file to a Certificate Authority (CA) and have them generate a certificate. However, if you want a certificate to play around with, it is enough to sign it yourself:</p>
<blockquote>
<pre>openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt</pre>
</blockquote>
<p>In either case, we can now continue to create an SSL directory for Apache:</p>
<blockquote>
<pre>mkdir /etc/apache2/ssl</pre>
</blockquote>
<p>Move the necessary files to this directory:</p>
<blockquote>
<pre>mv server.key /etc/apache2/ssl
mv server.crt /etc/apache2/ssl</pre>
</blockquote>
<p>Now tell Apache to use SSL and these brand new files by editing /etc/apache2/sites-enabled/000-default:</p>
<blockquote>
<pre>SSLEngine On
SSLCertificateFile /etc/apache2/ssl/server.crt
SSLCertificateKeyFile /etc/apache2/ssl/server.key</pre>
</blockquote>
<p>And now start Apache:</p>
<blockquote>
<pre>/etc/init.d/apache2 start</pre>
</blockquote>
<p>Check if it works by connecting to https://yourservername. If you use a self-signed certificate, your browser will warn you that, although the connection is encrypted, it is a self-signed certificate and you shouldn&#8217;t trust the website.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jansipke.nl/enable-ssl-in-apache/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configuring Postfix to use a smarthost</title>
		<link>http://www.jansipke.nl/configuring-postfix-to-use-a-smarthost</link>
		<comments>http://www.jansipke.nl/configuring-postfix-to-use-a-smarthost#comments</comments>
		<pubDate>Thu, 14 May 2009 10:40:11 +0000</pubDate>
		<dc:creator>jansipke</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[Postfix]]></category>
		<category><![CDATA[SMTP]]></category>

		<guid isPermaLink="false">http://www.jansipke.nl/?p=549</guid>
		<description><![CDATA[Some companies and ISP&#8217;s do not allow you to send mail from your machine directly, but force you to use their smarthost. In the Postfix SMTP server we can accomplish this by editing the file /etc/postfix/main.cf: relayhost = smarthost.example.org We also have to tell Postfix to which domains it may send mail. We do this [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-606" title="postfix" src="http://www.jansipke.nl/wp-content/uploads/postfix.gif" alt="postfix" width="85" height="62" /></p>
<p>Some companies and ISP&#8217;s do not allow you to send mail from your machine directly, but force you to use their smarthost. In the Postfix SMTP server we can accomplish this by editing the file /etc/postfix/main.cf:</p>
<blockquote>
<pre>relayhost = smarthost.example.org</pre>
</blockquote>
<p>We also have to tell Postfix to which domains it may send mail. We do this by adding:</p>
<blockquote>
<pre>relay_domains = example.org</pre>
</blockquote>
<p>These two lines together allow your Postfix installation to send mail to everybody@example.org through the smarthost smarthost.example.org.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jansipke.nl/configuring-postfix-to-use-a-smarthost/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Ganglia on CentOS</title>
		<link>http://www.jansipke.nl/installing-ganglia-on-centos</link>
		<comments>http://www.jansipke.nl/installing-ganglia-on-centos#comments</comments>
		<pubDate>Mon, 20 Apr 2009 18:15:08 +0000</pubDate>
		<dc:creator>jansipke</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Ganglia]]></category>
		<category><![CDATA[Monitoring]]></category>

		<guid isPermaLink="false">http://www.jansipke.nl/?p=538</guid>
		<description><![CDATA[In this article we will install the Ganglia monitoring system on a set of machines running CentOS. There are two kinds of machines involved: The meta node: one machine that receives all measurements and presents it to a client through a website. The monitoring nodes: machines that run only the monitoring daemon and send the [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-615" title="ganglia" src="http://www.jansipke.nl/wp-content/uploads/ganglia.gif" alt="ganglia" width="149" height="60" /></p>
<p>In this article we will install the <a href="http://ganglia.info/">Ganglia</a> monitoring system on a set of machines running CentOS. There are two kinds of machines involved:</p>
<ul>
<li>The meta node: one machine that receives all measurements and presents it to a client through a website.</li>
<li>The monitoring nodes: machines that run only the monitoring daemon and send the measurements to the meta node.</li>
</ul>
<p><strong>Meta node</strong></p>
<p>For this example we assume the meta node has the IP address 192.168.1.253. We start by installing the necessary software:</p>
<blockquote>
<pre>rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
yum install rrdtool ganglia ganglia-gmetad ganglia-gmond ganglia-web httpd php apr apr-util</pre>
</blockquote>
<p>If you want to monitor the meta node as well as the monitoring nodes, edit the gmond configuration file /etc/gmond.conf:</p>
<blockquote>
<pre>cluster {
  name = "cluster1"
  owner = "owner1"
  latlong = "unspecified"
  url = "unspecified"
}

udp_send_channel {
  host = 192.168.1.253
  port = 8649
  ttl = 1
}

udp_recv_channel {
  port = 8649
}</pre>
</blockquote>
<p>Start the gmond service and make sure it starts at boot:</p>
<blockquote>
<pre>chkconfig gmond on
service gmond start</pre>
</blockquote>
<p>Edit the gmetad configuration file /etc/gmetad.conf:</p>
<blockquote>
<pre>data_source "my cluster" 192.168.1.253:8649</pre>
</blockquote>
<p>Start the gmetad service and make sure it starts at boot:</p>
<blockquote>
<pre>chkconfig gmetad on
service gmetad start</pre>
</blockquote>
<p>Enable the http daemon, to be able to see the pretty monitoring pictures:</p>
<blockquote>
<pre>chkconfig httpd on
service httpd start</pre>
</blockquote>
<p><strong>Monitoring nodes</strong></p>
<p>On all the monitoring nodes start by installing the necessary software:</p>
<blockquote>
<pre>rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
yum install ganglia-gmond</pre>
</blockquote>
<p>Edit the gmond configuration file /etc/gmond.conf. You can use an exact replica of the gmond configuration file shown for the meta node.<br />
Start the gmond service and make sure it starts at boot:</p>
<blockquote>
<pre>chkconfig gmond on
service gmond start</pre>
</blockquote>
<p>If you would like to emit your own measurements (called metrics in Ganglia) and view them on the website, call the gmetric program:</p>
<blockquote>
<pre>gmetric --name mymetricname --value mymetricvalue --type string</pre>
</blockquote>
<p>To use the output of a program you wrote as a metric, simply call it like this, making sure to use backticks (`) instead of quotes (&#8216;):</p>
<blockquote>
<pre>gmetric --name mymetricname --value `/home/user/mymetricprogram` --type string</pre>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.jansipke.nl/installing-ganglia-on-centos/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Network configuration on OpenSolaris</title>
		<link>http://www.jansipke.nl/network-configuration-on-opensolaris</link>
		<comments>http://www.jansipke.nl/network-configuration-on-opensolaris#comments</comments>
		<pubDate>Fri, 01 Aug 2008 17:41:27 +0000</pubDate>
		<dc:creator>jansipke</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[Bonding]]></category>
		<category><![CDATA[OpenSolaris]]></category>
		<category><![CDATA[Static IP]]></category>

		<guid isPermaLink="false">http://www.jansipke.nl/?p=131</guid>
		<description><![CDATA[Static IP address Assigning a static IP address on OpenSolaris is accomplished by editing the hostname files in the directory /etc. For example, assign a static IP address to interface bge0 by editing /etc/hostname.bge0: 192.168.0.123 Set the netmask by editing the file /etc/inet/netmasks: 192.168.0.0 255.255.255.0 Set the default gateway by editing the file /etc/defaultrouter: 192.168.0.1 [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-625" title="network" src="http://www.jansipke.nl/wp-content/uploads/network.gif" alt="network" width="60" height="60" /></p>
<p><strong>Static IP address</strong></p>
<p>Assigning a static IP address on OpenSolaris is accomplished by editing the hostname files in the directory /etc. For example, assign a static IP address to interface bge0 by editing /etc/hostname.bge0:</p>
<blockquote>
<pre>192.168.0.123</pre>
</blockquote>
<p>Set the netmask by editing the file /etc/inet/netmasks:</p>
<blockquote>
<pre>192.168.0.0 255.255.255.0</pre>
</blockquote>
<p>Set the default gateway by editing the file /etc/defaultrouter:</p>
<blockquote>
<pre>192.168.0.1</pre>
</blockquote>
<p><strong>Network interface bonding</strong></p>
<p>In this example, 10.0.0.1 is the interface of the bond, 10.0.0.2 and 10.0.0.3 are test addresses. Start by editing /etc/hostname.e1000g0:</p>
<blockquote>
<pre>10.0.0.2 netmask + broadcast + group production
deprecated addif 10.0.0.1 netmask + broadcast + failover up</pre>
</blockquote>
<p>Then edit /etc/hostname.e1000g1:</p>
<blockquote>
<pre>10.0.0.3 netmask + broadcast + group production
deprecated + failover standby up</pre>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.jansipke.nl/network-configuration-on-opensolaris/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Network configuration on CentOS</title>
		<link>http://www.jansipke.nl/network-configuration-on-centos</link>
		<comments>http://www.jansipke.nl/network-configuration-on-centos#comments</comments>
		<pubDate>Fri, 01 Aug 2008 17:21:19 +0000</pubDate>
		<dc:creator>jansipke</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[Bonding]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Static IP]]></category>

		<guid isPermaLink="false">http://www.jansipke.nl/?p=126</guid>
		<description><![CDATA[Static IP address Assigning a static IP address on CentOS is accomplished by editing the files in the directory /etc/sysconfig/network-scripts. For example, assign a static IP address to interface eth0 by editing /etc/sysconfig/network-scripts/ifcfg-eth0: DEVICE=eth0 BOOTPROTO=none IPADDR=192.168.0.123 NETMASK=255.255.255.0 GATEWAY=192.168.0.1 ONBOOT=yes Network interface bonding To achieve higher bandwidth and/or reliability, network interfaces can be bonded. First, edit [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-625" title="network" src="http://www.jansipke.nl/wp-content/uploads/network.gif" alt="network" width="60" height="60" /></p>
<p><strong>Static IP address</strong></p>
<p>Assigning a static IP address on CentOS is accomplished by editing the files in the directory /etc/sysconfig/network-scripts. For example, assign a static IP address to interface eth0 by editing /etc/sysconfig/network-scripts/ifcfg-eth0:</p>
<blockquote>
<pre>DEVICE=eth0
BOOTPROTO=none
IPADDR=192.168.0.123
NETMASK=255.255.255.0
GATEWAY=192.168.0.1
ONBOOT=yes</pre>
</blockquote>
<p><strong>Network interface bonding</strong></p>
<p>To achieve higher bandwidth and/or reliability, network interfaces can be bonded. First, edit the file /etc/sysconfig/network-scripts/ifcfg-bond0:</p>
<blockquote>
<pre>DEVICE=bond0
BOOTPROTO=none
IPADDR=10.0.0.1
NETMASK=255.255.255.0
ONBOOT=yes</pre>
</blockquote>
<p>After that, you need to edit the network interfaces that are part of this bond, e.g. eth1 and eth2. Let&#8217;s start with /etc/sysconfig/network-scripts/ifcfg-eth1:</p>
<blockquote>
<pre>DEVICE=eth1
BOOTPROTO=none
MASTER=bond0
SLAVE=yes
ONBOOT=yes</pre>
</blockquote>
<p>Then edit /etc/sysconfig/network-scripts/ifcfg-eth2:</p>
<blockquote>
<pre>DEVICE=eth2
BOOTPROTO=none
MASTER=bond0
SLAVE=yes
ONBOOT=yes</pre>
</blockquote>
<p>The last file to edit is /etc/modprobe.conf:</p>
<blockquote>
<pre>alias bond0 bonding
options bond0 mode=active-backup miimon=100</pre>
</blockquote>
<p>The mode value in this last file can be one of several:</p>
<ul>
<li>balance-rr</li>
<li>active-backup</li>
<li>balance-xor</li>
<li>802.3ad</li>
<li>balance-tlb</li>
<li>balance-alb</li>
</ul>
<p>In the active-backup mode shown in the example, only one slave in the bond is active. A different slave becomes  active if, and only if, the active slave fails. The bond&#8217;s MAC address is externally  visible on only one port (network interface) to avoid confusing the switch.</p>
<p>The option miimon (media-independent interface monitoring) defines how often, in milliseconds, link monitoring occurs.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jansipke.nl/network-configuration-on-centos/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enabling NTP daemon on CentOS</title>
		<link>http://www.jansipke.nl/enabling-ntp-daemon-on-centos</link>
		<comments>http://www.jansipke.nl/enabling-ntp-daemon-on-centos#comments</comments>
		<pubDate>Fri, 01 Aug 2008 17:16:31 +0000</pubDate>
		<dc:creator>jansipke</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[NTP]]></category>

		<guid isPermaLink="false">http://www.jansipke.nl/?p=124</guid>
		<description><![CDATA[Here are the steps to take to enable the Network Time Protocol (NTP) daemon on CentOS. Change the timeserver value to one that is close to you. yum install system-config-date ntpdate nl.pool.ntp.org service ntpd start chkconfig ntpd on]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-628" title="clock" src="http://www.jansipke.nl/wp-content/uploads/clock.gif" alt="clock" width="70" height="70" /></p>
<p>Here are the steps to take to enable the Network Time Protocol (NTP) daemon on CentOS. Change the timeserver value to one that is close to you.</p>
<blockquote>
<pre>yum install system-config-date
ntpdate nl.pool.ntp.org
service ntpd start
chkconfig ntpd on</pre>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.jansipke.nl/enabling-ntp-daemon-on-centos/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Samba file sharing</title>
		<link>http://www.jansipke.nl/samba-file-sharing</link>
		<comments>http://www.jansipke.nl/samba-file-sharing#comments</comments>
		<pubDate>Wed, 01 Jan 2003 19:39:43 +0000</pubDate>
		<dc:creator>jansipke</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[OpenBSD]]></category>
		<category><![CDATA[Samba]]></category>

		<guid isPermaLink="false">http://www.jansipke.nl/?p=99</guid>
		<description><![CDATA[Samba is a file and print server for Windows-based clients using TCP/IP as the underlying transport protocol. In fact, it can support any SMB/CIFS-enabled client. One of Samba&#8217;s big strengths is that you can use it to blend your mix of Windows and Unix machines together without requiring a separate Windows NT/2000/2003 Server. On OpenBSD, [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-667" title="samba" src="http://www.jansipke.nl/wp-content/uploads/samba.gif" alt="samba" width="83" height="40" /></p>
<p>Samba is a file and print server for Windows-based clients using TCP/IP as the underlying transport protocol. In fact, it can support any SMB/CIFS-enabled client. One of Samba&#8217;s big strengths is that you can use it to blend your mix of Windows and Unix machines together without requiring a separate Windows NT/2000/2003 Server.</p>
<p>On OpenBSD, the Samba configuration file is /etc/samba/smb.conf.    There are some changes we want to make to the original file.    Assume we want to run Samba for machines located on our LAN, 192.168.0.0./24 and this machine has the IP address 192.168.0.1.</p>
<blockquote>
<pre>hosts allow = 192.168.0.0./24 127.0.0.1
interfaces = 192.168.0.1

socket options = TCP_NODELAY
encrypt passwords = yes</pre>
</blockquote>
<p>Now we have to add a directory we want to share.    Assume we have a directory /data that we want to make public and writeable to everyone who can login to Samba.</p>
<blockquote>
<pre>[data]
    comment = Data
    path = /data
    read only = no
    public = yes</pre>
</blockquote>
<p>Now we have to set the password for a user to be able to login to Samba.</p>
<blockquote>
<pre>/usr/local/bin/smbpasswd username</pre>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.jansipke.nl/samba-file-sharing/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Network Time Protocol (NTP)</title>
		<link>http://www.jansipke.nl/network-time-protocol-ntp</link>
		<comments>http://www.jansipke.nl/network-time-protocol-ntp#comments</comments>
		<pubDate>Wed, 01 Jan 2003 19:35:48 +0000</pubDate>
		<dc:creator>jansipke</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[NTP]]></category>
		<category><![CDATA[OpenBSD]]></category>

		<guid isPermaLink="false">http://www.jansipke.nl/?p=91</guid>
		<description><![CDATA[The Network Time Protocol (NTP) is used to synchronize the time of a computer client or server to another server or reference time source, such as a radio or satellite receiver or modem. It provides accuracies typically within a millisecond on LANs and up to a few tens of milliseconds on WANs relative to Coordinated [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-628" title="clock" src="http://www.jansipke.nl/wp-content/uploads/clock.gif" alt="clock" width="70" height="70" /></p>
<p>The Network Time Protocol (NTP) is used to synchronize the time of a computer client or server to another server or reference time source, such as a radio or satellite receiver or modem. It provides accuracies typically within a millisecond on LANs and up to a few tens of milliseconds on WANs relative to Coordinated Universal Time (UTC) via a Global Positioning Service (GPS) receiver, for example. Typical NTP configurations utilize multiple redundant servers and diverse network paths in order to achieve high accuracy and reliability.</p>
<p>The NTP subnet in early 2003 includes well over a hundred public primary (stratum 1) servers synchronized directly to UTC by radio, satellite or modem and located in every continent of the globe, including Antarctica. Normally, client workstations and servers with a relatively small number of clients do not synchronize to primary servers. There are well over a hundred public secondary (stratum 2) servers synchronized to the primary servers and providing synchronization to a total well over 100,000 clients and servers in the Internet.</p>
<p>There are two programs that are used here: ntpd and ntpdate. The ntpd program operates by exchanging messages with one or more configured servers at designated poll intervals. When started, whether for the first or subsequent times, the program requires several exahanges from the majority of these servers so the signal processing and mitigation algorithms can accumulate and groom the data and set the clock. The ntpdate program can be run manually as necessary to set the host clock, or it can be run from the host startup script to set the clock at boot time. This is useful in some cases to set the clock initially before starting the NTP daemon ntpd. It is also possible to run ntpdate from a cron script. However, it is important to note that ntpdate with contrived cron scripts is no substitute for the NTP daemon, which uses sophisticated algorithms to maximize accuracy and reliability while minimizing resource use.</p>
<p>On OpenBSD, the NTP software is not installed by default, so we will have to do this first.</p>
<blockquote>
<pre>cd /usr/ports/net/ntp
make install</pre>
</blockquote>
<p>Now we have to edit the configuration file /etc/ntp.conf.    This file contains the names of servers we want to synchronize to and the networks of clients we allow access to this server.</p>
<blockquote>
<pre>server ntp.example.com prefer
server ntp.example.org
server ntp.example.net

restrict 192.168.0.0 mask 255.255.255.0 nomodify nopeer
restrict 10.0.0.0 mask 255.255.255.0 nomodify nopeer</pre>
</blockquote>
<p>OpenBSD starts ntpd automatically if it can find the daemon at /usr/local/sbin/ntpd.    However, it does not call ntpdate at startup.    So if you want that to happen, edit rc.conf.local.</p>
<blockquote>
<pre>ntpdate_flags="ntp.example.com"</pre>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.jansipke.nl/network-time-protocol-ntp/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

