<?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>Admon Home &#187; Networking</title>
	<atom:link href="http://www.admon.org/networking/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.admon.org</link>
	<description>Linux System Administration</description>
	<lastBuildDate>Wed, 08 Feb 2012 10:24:20 +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>GSLB: How DNS-based one works</title>
		<link>http://www.admon.org/gslb-how-dns-based-one-works/</link>
		<comments>http://www.admon.org/gslb-how-dns-based-one-works/#comments</comments>
		<pubDate>Sun, 11 Dec 2011 02:59:11 +0000</pubDate>
		<dc:creator>joseph</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[citrix]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[gslb]]></category>

		<guid isPermaLink="false">http://www.admon.org/?p=1012</guid>
		<description><![CDATA[GSLB is short for Global Server Load Balancing, and is a tried and tested way of improving the availability and speed of Internet-based services. GSLB enables distribution of traffic across multiple sites, manages disaster recovery, and ensures that applications are consistently accessible. The Citrix NetScaler implementation of GSLB is DNS-based. DNS can be thought of [...]]]></description>
			<content:encoded><![CDATA[<p>GSLB is short for <strong>Global Server Load Balancing</strong>, and is a tried and tested way of improving the availability and speed of Internet-based services. GSLB enables distribution of traffic across multiple sites, manages disaster recovery, and ensures that applications are consistently accessible.<span id="more-1012"></span></p>
<p>The <a title="Citrix NetScaler" href="http://www.citrix.com/NetScaler" target="_blank">Citrix NetScaler</a> implementation of GSLB is DNS-based. DNS can be thought of as the Internet’s ‘Phone Book’, telling computers where different services are located. DNS-based Global Server Load Balancers are by far the most common type of GSLB device.</p>
<p>GSLB directs DNS requests to the best-performing GSLB site in a distributed Internet environment. When a client sends a DNS request, the system determines the best-performing site and returns its IP to the client. In the process of ascertaining the best- performing site, the system performs these intelligent decisions:</p>
<ul>
<li>Directs client requests to the geographically closest GSLB site (geographic and network proximity-based traffic redirection)</li>
<li>Directs client requests to surviving data centers when an outage occurs</li>
<li>Directs client requests to alternate data centers, when a pre-defined traffic load limit is reached</li>
<li>Directs client requests to be distributed among multiple data centers (assigns each user to the GSLB site with lowest latency)</li>
</ul>
<p>The system performs these intelligent decisions using the <a title="MEP" href="http://support.citrix.com/article/CTX121675" target="_blank">Metric Exchange Protocol</a> (MEP), GSLB policies, and GSLB methods supported by the system.</p>
<p><strong>GSLB policies</strong> direct the traffic to a pre-defined target site. <strong>GSLB methods</strong> are algorithms that control how the system load-balances client requests across distributed data centers. The system provides support for creating policies for distributing or redirecting client request.</p>
<p>Multiple sites exchange metrics with each other using the MEP. The system uses this protocol to exchange load, network, and persistence information between GSLB sites. The system also uses this information to perform load balancing between GSLB sites.</p>
<p><strong>GSLB Entity Model</strong></p>
<p><strong></strong>A typical GSLB deployment contains the entities described in the following figure.  <img src="http://community.citrix.com/download/attachments/37847052/GSLB_Architecture.PNG" alt="GSLB Architecture" align="absmiddle" border="0" /></p>
<p>To configure GSLB, you must configure a <strong>GSLB site</strong>. As shown in the figure, a GSLB site is the logical collection of <strong>GSLB vserver</strong>, <strong>GSLB service</strong>, <strong>LB vserver</strong>, <strong>service</strong>, <strong>domain</strong>, and <strong>ADNS service</strong>. It is the central entity in a GSLB deployment, and is represented by a name and an IP address.</p>
<p>To create a <strong>GSLB site</strong>, you must configure load balancing on the system. You must create<strong> GSLB vservers</strong> and GSLB services for each site. You must bind GSLB services to GSLB vservers. You must then create an ADNS service that provides the IP address of the best performing site to the client&#8217;s request.</p>
<p>A <strong>GSLB vserver</strong> is an entity that performs load balancing for the domains bound to it by returning the IP address of the best GSLB service. A GSLB service is a representation of the load balancing/content switching vserver. An LB vserver load balances incoming traffic by identifying the best server, then directs traffic to the corresponding service. It can also load-balance external DNS name servers. Services are entities that represent the servers. The domain is the domain name for which the system is the authoritative DNS server. By creating an ADNS service, the system can be configured as an <a href="http://en.wikipedia.org/wiki/Domain_Name_System" target="_blank">authoritative DNS server</a>.</p>
<p><em>Note: This is a modified version from the article <a title="How GSLB Works" href="http://community.citrix.com/display/ns/How+GSLB+Works" target="_blank">How+GSLB+Works</a>.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.admon.org/gslb-how-dns-based-one-works/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configure network card in promiscuous mode</title>
		<link>http://www.admon.org/configure-network-card-in-promiscuous-mode/</link>
		<comments>http://www.admon.org/configure-network-card-in-promiscuous-mode/#comments</comments>
		<pubDate>Sat, 30 Jul 2011 05:27:00 +0000</pubDate>
		<dc:creator>joseph</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[network card]]></category>
		<category><![CDATA[promiscuous mode]]></category>

		<guid isPermaLink="false">http://www.admon.org/?p=917</guid>
		<description><![CDATA[When running in promiscuous mode, all traffic the network card receives can be read. This configuration is useful for us to do network monitoring, like for a network intrusion detection system. How can I config my network card in promiscuous mode? You can do this easily by one command. It works on both RedHat and [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-thumbnail wp-image-918" title="network" src="http://www.admon.org/wp-content/uploads/2011/07/services_network-150x150.jpg" alt="network" width="150" height="150" /></p>
<p>When running in <a title="ethernet promiscuous mode" href="http://en.wikipedia.org/wiki/Promiscuous_mode" target="_blank">promiscuous mode</a>, all traffic the network card receives can be read. This configuration is useful for us to do network monitoring, like for a network intrusion detection system.<span id="more-917"></span></p>
<p><strong>How can I config my network card in promiscuous mode?</strong></p>
<p>You can do this easily by one command. It works on both RedHat and Debian based distributions. Below is an example:</p>
<pre>root@db1:~# ifconfig eth1 promisc
[2685638.719679] device eth1 entered promiscuous mode
root@db1:~# ifconfig eth1 -promisc
root@db1:~# dmesg | tail -1
[2685655.668037] device eth1 left promiscuous mode</pre>
<p>Then, how can we setup the promiscuous mode in configuration files, so that it takes effect when system boots? As the configuration varies by distribution, here we raise two examples.</p>
<p><strong>Setup promiscuous mode on Redhat / CentOS</strong></p>
<p>To configure a network card in promiscuous mode, you need to put the line <em>PROMISC=yes</em> in its configuration file <em>/etc/sysconfig/network-scripts/ifcfg-ethX.</em></p>
<pre>BOOTPROTO=static
DEVICE=ethX
ONBOOT=yes
TYPE=Ethernet
PROMISC=yes
USERCTL=no</pre>
<p>Don&#8217;t forget to replace ethX to the right device you are using.</p>
<p><strong>Setup promiscuous mode on Ubuntu / Debian</strong></p>
<p>Below is part of an example file of <em>/etc/network/interface</em>:</p>
<pre>auto eth0
iface eth0 inet manual
up ifconfig $IFACE 192.168.1.100 up
up ip link set $IFACE promisc on
down ip link set $IFACE promisc off
down ifconfig $IFACE down</pre>
<p>Again, for any issues, please leave us a comment, or raise a thread at <a title="Linux Forums" href="http://forums.admon.org/forum.php" target="_blank">the support forum</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.admon.org/configure-network-card-in-promiscuous-mode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using VETH instead of VENET in OpenVZ</title>
		<link>http://www.admon.org/using-veth-instead-of-venet-in-openvz/</link>
		<comments>http://www.admon.org/using-veth-instead-of-venet-in-openvz/#comments</comments>
		<pubDate>Thu, 08 Apr 2010 13:42:52 +0000</pubDate>
		<dc:creator>joseph</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[System Tuning]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[openvz]]></category>
		<category><![CDATA[venet]]></category>
		<category><![CDATA[veth]]></category>
		<category><![CDATA[vlan]]></category>

		<guid isPermaLink="false">http://planet.admon.org/?p=586</guid>
		<description><![CDATA[By default OpenVZ is using VENET as network device. It does packet switching based on IP header, which makes it look like a point-to-point connection between VPS and the physical host. An alternative device is Virtual Ethernet device (a.k.a. VETH). Veth is an Ethernet-like device, unlike venet network device, veth device has a MAC address, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://planet.admon.org/wp-content/uploads/2010/04/openvz.png"><img class="size-full wp-image-743 alignleft" title="openvz" src="http://planet.admon.org/wp-content/uploads/2010/04/openvz.png" alt="" width="135" height="135" /></a>By default <a href="http://wiki.openvz.org/Main_Page">OpenVZ</a> is using VENET as network device. It does packet switching based on IP header, which makes it look like a point-to-point connection between VPS and the physical host. An alternative device is <a href="http://wiki.openvz.org/Virtual_Ethernet_device">Virtual Ethernet device</a> (a.k.a. VETH).<br />
<span id="more-586"></span><br />
Veth is an Ethernet-like device, unlike <a href="http://wiki.openvz.org/Venet">venet</a> network device, veth device has a MAC address, therefore it can be used in configurations. When veth is bridged to ethX or other device, the administrator is able to sets up his networking himself, including IPs, gateways etc.</p>
<p>VENet consists of two Ethernet devices &#8212; the one in physical server and another one in virtualized guest. These devices are connected to each other, so if a packet goes into one device it will come out from the other device.</p>
<p>In this post, we&#8217;ll share some tips on how to enable venet. The content is mainly from OpenVZ&#8217;s <a href="http://wiki.openvz.org/Virtual_Ethernet_device#Adding_veth_to_a_CT">official guide</a>.</p>
<p>The commands that we used are listed below with explanations.</p>
<p>Firstly, assuming that we&#8217;re in the physical server, We need to add a new device named eth0</p>
<pre>vzctl set 150 --netif_add eth0,00:12:34:56:78:9A,veth101.0,00:12:34:56:78:9B --save</pre>
<p>The second MAC address is from the mother side, and the first MAC address is self-generated. Click here if you&#8217;re not sure <a href="http://planet.admon.org/howto/generate-mac-address-by-scripts/">how to generate a MAC address</a>.</p>
<p>Then enable forwarding and ARP proxy, and apply some changes in route table:</p>
<pre># cat veth150.sh
ifconfig veth150.0 0
echo 1 &gt; /proc/sys/net/ipv4/conf/veth150.0/forwarding
echo 1 &gt; /proc/sys/net/ipv4/conf/veth150.0/proxy_arp
echo 1 &gt; /proc/sys/net/ipv4/conf/eth0/forwarding
echo 1 &gt; /proc/sys/net/ipv4/conf/eth0/proxy_arp
ip route add 192.168.201.150 dev veth150.0</pre>
<p>Warning: Before making these changes to your system, you&#8217;re suggested to verify what exactly you&#8217;re doing. For example, proxy_arp is problematic in a mixed network.</p>
<p>Secondly, in the VPS we need to config the new device eth0 like this:</p>
<pre>/sbin/ifconfig venet0:0 0
/sbin/ifconfig eth0 0
/sbin/ip addr add 192.168.201.150 dev eth0
/sbin/ip route add default dev eth0</pre>
<p>The IP address <em>192.168.201.150</em> can be in a different network from the physical side, you just need to make sure they are in the same VLAN.</p>
<p>When it&#8217;s tested OK, don&#8217;t forget to modify your network configuration files in <em>/etc/sysconfig/network-scripts/</em> for a permanent change.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.admon.org/using-veth-instead-of-venet-in-openvz/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Failover Firewalls with OpenBSD and CARP</title>
		<link>http://www.admon.org/failover-firewalls-with-openbsd-and-carp/</link>
		<comments>http://www.admon.org/failover-firewalls-with-openbsd-and-carp/#comments</comments>
		<pubDate>Wed, 30 Dec 2009 08:32:26 +0000</pubDate>
		<dc:creator>joseph</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[System Tuning]]></category>
		<category><![CDATA[CARP]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[openbsd]]></category>
		<category><![CDATA[pdf]]></category>

		<guid isPermaLink="false">http://planet.admon.org/?p=502</guid>
		<description><![CDATA[Warning &#8211; this post was original created by Jason Dixon some yrs ago, its copyright is fully held by samag.com. I copied it here for a track record, If there&#8217;s any issue, please let me know. As the pictures in this post had lost already,  it&#8217;s suggested to check its PDF version here. Firewalls are [...]]]></description>
			<content:encoded><![CDATA[<p><em>Warning &#8211; this post was original created by <a href="http://www.dixongroup.net/">Jason Dixon</a> some yrs ago, its copyright is fully held by <a href="http://www.samag.com/">samag.com</a>. </em><em>I copied it here for a track record, If there&#8217;s any </em><em>issue, please <a href="http://www.admon.org/contact/">let me know</a>. As the pictures in this post had lost already,  it&#8217;s suggested to check <a href="http://planet.admon.org/papers/jdixon_firewall_failover.pdf">its PDF version here</a>.<br />
</em></p>
<p><em></em>Firewalls are a required component in commercial and residential computer networks. For many installations, the firewall is a single point of failure between client systems and external resources. It can also become a liability when hardware or applications fail, leaving potential customers unable to reach your servers.<span id="more-502"></span></p>
<p>A properly designed and executed failover configuration for your primary firewall will address many of these concerns. This article introduces a proven method for installing redundant stateful firewalls using native OpenBSD features.</p>
<p>The <a href="http://www.openbsd.org/">OpenBSD project</a> is known for creating a leading secure Unix-like operating system. They have always emphasized software robustness and security, while ensuring their code remains free for all purposes under the BSD license. A number of exciting features have been introduced to OpenBSD due to licensing disagreements. Many BSD users are familiar with the rift between Darren Reed, (the creator of IPFilter) and the OpenBSD developers. A change in the IPFilter license resulted in the rapid development of the OpenBSD PF firewall software. Not only is PF a competitor to expensive proprietary offerings, it is so successful that it has been ported to both FreeBSD and NetBSD distributions.</p>
<p>Within the past two years, OpenBSD recognized the need to support failover between OpenBSD firewalls. The pfsync protocol was completed, which sends state change messages via multicast over the pfsync interface. Using a secure connection (a crossover cable between systems is suggested), pfsync will notify other OpenBSD firewalls of changes to the local state table. If other firewalls are listening for the pfsync packets, they will update their own state tables with these announcements. This feature allows sessions to failover gracefully without losing connectivity or raising alerts in the firewall, providing the basic features required for stateful redundancy. However, the ability to dynamically failover to the stateful partners was still unavailable.</p>
<p><strong>The Birth of CARP</strong></p>
<p>The <a href="http://en.wikipedia.org/wiki/Virtual_Router_Redundancy_Protocol">Virtual Router Redundancy Protocol</a> (VRRP) eliminates the single point of failure in a static network by assigning a virtual gateway between multiple physical routers. This allows two or more routers to cooperate as a dynamic gateway; one will perform as the &#8220;master&#8221;, while the other system waits as a &#8220;backup&#8221;. If the master becomes unavailable, the backup will begin advertising itself as the master, allowing traffic to continue uninterrupted over the new physical path. Unfortunately, although VRRP is an IETF-standard protocol, it is also encumbered by a patent held by its author, Cisco Systems, Inc. They claim to have no intention of asserting patent claims against anyone implementing VRRP, but publicly reserve the right to assert patent claims defensively. OpenBSD needed this functionality to support failover between hosts, but the looming patent issue made VRRP a poor choice.</p>
<p>Based on their dedication to free software, the OpenBSD team went to work on creating a patent-free replacement for VRRP. This was released in the form of the Common Address Redundancy Protocol (CARP) in late 2003. CARP operates at the data-link and network OSI layers, using a virtual MAC and one or more virtual IP addresses. The master router of the CARP group responds to ARP requests for the virtual MAC with the shared IP address, allowing switches to quickly determine to which interface to forward traffic. CARP supports IPv4 and IPv6, load-balancing across the shared group, master preemption, and cryptographic hashing of the data-link announcements. Thanks to PF, pfsync, and CARP, users are now able to deploy truly redundant firewalls using free software and commodity hardware.</p>
<p>Installing OpenBSD is beyond the scope of this article, but should be familiar to NetBSD (and perhaps even Debian Linux) users. The media is available either via CD-ROM purchased from <a href="http://www.openbsd.org/orders.html">the OpenBSD store</a>, or you can install via FTP by downloading one of the boot images. There are no CD-ROM ISO images available for download; CD-ROM and other project merchandise sales are used to support the ongoing development. The installation process usually takes no more than 10-20 minutes to complete, depending on media access and disk speed.</p>
<p>The scenarios presented in this article portray a typical dual-homed connection that you might encounter at any business or residence. Under most circumstances, it is suggested to incorporate a demilitarized-zone (&#8220;DMZ&#8221;) network to segregate inbound traffic to your public servers. This helps keep unwanted intruders out of your LAN. We will utilize a third interface for this example, but it will only carry pfsync notifications. Adding a DMZ is as simple as creating an additional physical and CARP interface for the DMZ.</p>
<p><strong>Basic Configuration</strong></p>
<p>Both systems should be configured to use unique (not shared between CARP group members) IP addresses for the physical interfaces. As of the time of this writing, code has been imported to allow CARP devices to operate without the need for a network interface. However, this code is still under heavy testing at the time of writing and should not be considered production-ready until the OpenBSD 3.7 release (May 2005).</p>
<p><a href="http://planet.admon.org/papers/jdixon_firewall_failover.pdf">Figure 1</a> shows that each firewall has a publicly routable IPv4 address for fxp0, a private RFC1918 address on fxp1, and another private address on fxp2. Each of the routing interfaces can be configured to use multiple CARP interfaces, although we will only be creating a single CARP interface on fxp1 to operate as our LAN gateway. The network settings for each physical device are stored in the /etc/hostname.fxp* files; each CARP interface has its settings stored in the corresponding /etc/hostname.carp* files. Media options are considered optional and will not be shown in the examples below. This will result in the connection duplex auto-negotiating at 100baseTX.</p>
<p>Each CARP interface must be configured with a virtual host ID (vhid) and virtual host IP address. The vhid must be unique among CARP interfaces on the same network segment. The <strong>advbase</strong> and <strong>advskew</strong> parameters are optional and are used to control how frequently a master host sends advertisements. A custom <strong>advskew</strong> setting will result in fewer advertisements, forcing the host into the backup role. The <strong>pass</strong> parameter is recommended as it is used to authenticate CARP advertisements between group members. The commands to manually enable the CARP interfaces are:</p>
<pre>test1# ifconfig carp0 66.77.24.5 netmask 255.255.255.0 vhid 1 pass foo
test1# ifconfig carp1 10.0.0.1 netmask 255.255.255.0 vhid 1 pass bar

test2# ifconfig carp0 66.77.24.5 netmask 255.255.255.0 vhid 1 pass foo
test2# ifconfig carp1 10.0.0.1 netmask 255.255.255.0 vhid 1 pass bar</pre>
<p>To enable the pfsync interface, we only need to pass <strong>ifconfig</strong> the &#8220;up syncif&#8221; keywords and the associated interface. However, in those cases where a dedicated pair of interfaces is not available for crossover connectivity, the <strong>syncpeer</strong> keyword can be used to designate a peer network address. If this is the desired effect, all pfsync traffic should be encrypted across enc0, the OpenBSD IPSec virtual interface. For our purposes, we will simply rely on passing unencrypted messages across the dedicated crossover between fxp2 on each firewall:</p>
<pre>test1# ifconfig pfsync0 syncif fxp2

test2# ifconfig pfsync0 syncif fxp2</pre>
<p>In situations where a preferred master is wanted, preemption can be enabled. We need to raise the <strong>advskew</strong> for the intended backup host. Once that is complete, both systems must enable preemption via the net.inet.carp.preempt sysctl variable. The sysctl changes must be stored permanently in /etc/sysctl.conf, and the <strong>advskew</strong> updates should be made to the hostname.carp* files on the backup host:</p>
<pre>test2# ifconfig carp0 advskew 100
test2# ifconfig carp1 advskew 100
test2# sysctl -w net.inet.carp.preempt=1
net.inet.carp.preempt 0 -&gt; 1

test1# sysctl -w net.inet.carp.preempt=1
net.inet.carp.preempt 0 -&gt; 1</pre>
<p><a href="http://planet.admon.org/papers/jdixon_firewall_failover.pdf">Listing 1</a> reveals the basic PF ruleset that will allow our firewall pair to block unwanted traffic. This example only allows outbound Network Address Translation (NAT) connections bound to the external interface, as well as connections initiated from the firewall itself. We must also allow pfsync traffic on fxp2 and CARP traffic on fxp0 and fxp1. Once the pf.conf has been saved, the new configuration should be tested for syntax errors. A quiet return prompt indicates a successful ruleset parsing:</p>
<pre>test1# pfctl -nf /etc/pf.conf
test1#

test2# pfctl -nf /etc/pf.conf
test2#</pre>
<p>With no errors reported, we can enable the ruleset:</p>
<pre>test1# pfctl -f /etc/pf.conf

test2# pfctl -f /etc/pf.conf</pre>
<p>Please note that all of the aforementioned network settings will need to be preserved in static configuration files. The output of these files can be seen in <a href="http://planet.admon.org/papers/jdixon_firewall_failover.pdf">Listing 2</a></p>
<p>.<strong>Testing the Configuration</strong></p>
<p>Running <strong>tcpdump</strong> on each CARP-enabled physical interface should reveal the master host multicasting its CARP advertisements. A sample capture from the LAN segment is shown below. Note that we want to look for packets matching protocol number 112. Although this is recognized as VRRP on many systems, OpenBSD has updated the /etc/protocols file to reflect this as CARP traffic:</p>
<pre>test1# tcpdump -nvi fxp0 -c3 proto 112
tcpdump: listening on fxp0
20:32:55.110102 carp 10.0.0.2 &gt; 224.0.0.18: CARPv2-advertise 36:
  vhid=1 advbase=1 advskew=0 (DF) [tos 0x10] (ttl 255, id 15586)
20:32:56.120098 carp 10.0.0.2 &gt; 224.0.0.18: CARPv2-advertise 36:
  vhid=1 advbase=1 advskew=0 (DF) [tos 0x10] (ttl 255, id 8283)
20:32:57.130095 carp 10.0.0.2 &gt; 224.0.0.18: CARPv2-advertise 36:
  vhid=1 advbase=1 advskew=0 (DF) [tos 0x10] (ttl 255, id 18372)</pre>
<p>The <strong>ifconfig</strong> command will convey the state of our physical, CARP, and pfsync interfaces. Passing the <strong>-A</strong> parameter to <strong>ifconfig</strong> will also show the state of all address aliases for each of our interfaces:</p>
<pre>test1# ifconfig -A
lo0: flags=8049&lt;UP,LOOPBACK,RUNNING,MULTICAST&gt; mtu 33224
        inet 127.0.0.1 netmask 0xff000000
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x7
fxp0: flags=8943&lt;UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST&gt; mtu 1500
        address: 00:d0:b7:bf:c6:95
        media: Ethernet autoselect (100baseTX full-duplex)
        status: active
        inet 66.77.24.2 netmask 0xffffff00 broadcast 66.77.24.255
        inet6 fe80::202:b3ff:fe0a:ce04%fxp0 prefixlen 64 scopeid 0x1
fxp1: flags=8943&lt;UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST&gt; mtu 1500
        address: 00:02:b3:0a:d1:28
        media: Ethernet autoselect (100baseTX full-duplex)
        status: active
        inet 10.0.0.2 netmask 0xffffff00 broadcast 10.0.0.255
        inet6 fe80::202:b3ff:fe16:a957%fxp1 prefixlen 64 scopeid 0x2
fxp2: flags=8843&lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&gt; mtu 1500
        address: 00:c0:4f:46:8d:ec
        media: Ethernet autoselect (100baseTX full-duplex)
        status: active
        inet 10.255.255.2 netmask 0xffffff00 broadcast 10.255.255.255
        inet6 fe80::2c0:4fff:fe46:9448%fxp2 prefixlen 64 scopeid 0x3
pflog0: flags=141&lt;UP,RUNNING,PROMISC&gt; mtu 33224
pfsync0: flags=41&lt;UP,RUNNING&gt; mtu 1348
        pfsync: syncif: fxp2 syncpeer: 224.0.0.240 maxupd: 128
enc0: flags=0&lt;&gt; mtu 1536
carp0: flags=41&lt;UP,RUNNING&gt; mtu 1500
        carp: MASTER vhid 1 advbase 1 advskew 0
        inet 66.77.24.5 netmask 0xffffff00
carp1: flags=41&lt;UP,RUNNING&gt; mtu 1500
        carp: MASTER vhid 1 advbase 1 advskew 0
        inet 10.0.0.1 netmask 0xffffff00</pre>
<p>The output clearly shows that both carp0 and carp1 on this system are serving as master of the group. Since preemption is enabled, this system will always retain the master role while it is able to advertise itself as available. If a designated &#8220;backup&#8221; firewall has accepted the master role, it will immediately relinquish that responsibility upon receiving advertisements from the system with the lower <strong>advskew</strong>. This behavior can also be monitored using the tcpdump techniques revealed earlier. Tcpdump can also be used to observe the pfsync state messages:</p>
<pre>test1# tcpdump -nvvettti fxp2
Jan 31 21:18:22.135400 0:c0:4f:46:94:48 1:0:5e:0:0:f0 0800 262:
  10.255.255.2 &gt; 224.0.0.240: PFSYNCv2 count 1: INS ST:
 (DF) [tos 0x10] (ttl 255, id 58487)
Jan 31 21:18:23.130035 0:c0:4f:46:94:48 1:0:5e:0:0:f0 0800 302:
  10.255.255.2 &gt; 224.0.0.240: PFSYNCv2 count 3: UPD ST COMP:
 (DF) [tos 0x10] (ttl 255, id 64429)
Jan 31 21:18:25.940527 0:c0:4f:46:94:48 1:0:5e:0:0:f0 0800 70:
  10.255.255.2 &gt; 224.0.0.240: PFSYNCv2 count 2: DEL ST COMP:
        id: 41f3a32500007f5b creatorid: d0491513
        id: 41f3a32500007fe1 creatorid: d0491513
 (DF) [tos 0x10] (ttl 255, id 59638)
^C</pre>
<p>All LAN workstations should be configured to use the internal CARP address as their network gateway. Then if the master firewall becomes unavailable, any existing connections will be immediately resumed by the next possible failover member. Simple tests &#8212; such as Web browsing and ping &#8212; should be performed to verify that clients are able to traverse the gateway.</p>
<p>Once basic connectivity and routing are confirmed, more advanced tests should be initiated to confirm stateful failover capabilities. SCP is an excellent tool for this test. Make sure to use a sufficiently large test file such that it will still be transferring when you unplug the cable. Immediately following the physical disconnect, you may experience a brief 1-2 second delay as the failover occurs. The session should abruptly resume, revealing that the connection has been preserved. After you plug the cable back in, traffic should immediately &#8220;bounce&#8221; to the preemptive master and continue unassumingly. By running <strong>pftop</strong> from the ports collection, you can watch the traffic &#8220;move&#8221; from one machine to the other.</p>
<p><strong>Advanced Configuration</strong></p>
<p>The next design introduces a method for load balancing connections between the redundant pair and a pool of internal servers. To distribute the load across both firewalls, a second CARP interface must be created on each firewall&#8217;s external and internal interfaces. Each firewall will serve as master and one as backup for each CARP interface. The net.inet.carp.arpbalance sysctl variable must also be enabled. An address alias is also being added to support additional services:</p>
<pre>test1# ifconfig carp0 66.77.24.5 netmask 255.255.255.0 vhid 1 pass foo
test1# ifconfig carp0 alias 66.77.24.10 netmask 255.255.255.0 vhid 1 pass foo
test1# ifconfig carp1 66.77.24.5 netmask 255.255.255.0 vhid 2 advskew
  100 pass foo
test1# ifconfig carp1 alias 66.77.24.10 netmask 255.255.255.0 vhid 2
  advskew 100 pass foo
test1# ifconfig carp2 10.0.0.1 netmask 255.255.255.0 vhid 1 pass bar
test1# ifconfig carp3 10.0.0.1 netmask 255.255.255.0 vhid 2 advskew 100
  pass bar
test1# sysctl -w net.inet.carp.arpbalance=1
net.inet.carp.arpbalance: 0 -&gt; 1

test2# ifconfig carp0 66.77.24.5 netmask 255.255.255.0 vhid 1 advskew
  100 pass foo
test2# ifconfig carp0 alias 66.77.24.10 netmask 255.255.255.0 vhid
  1 advskew 100 pass foo
test2# ifconfig carp1 66.77.24.5 netmask 255.255.255.0 vhid 2 pass foo
test2# ifconfig carp1 alias 66.77.24.10 netmask 255.255.255.0 vhid 2 pass foo
test2# ifconfig carp2 10.0.0.1 netmask 255.255.255.0 vhid 1 advskew
  100 pass bar
test2# ifconfig carp3 10.0.0.1 netmask 255.255.255.0 vhid 2 pass bar
test2# sysctl -w net.inet.carp.arpbalance=1
net.inet.carp.arpbalance: 0 -&gt; 1</pre>
<p>Reviewing the output of <strong>ifconfig</strong>, we are able to confirm the presence of the new interfaces and aliases:</p>
<pre>test1# ifconfig -A
lo0: flags=8049&lt;UP,LOOPBACK,RUNNING,MULTICAST&gt; mtu 33224
        inet 127.0.0.1 netmask 0xff000000
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x7
fxp0: flags=8943&lt;UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST&gt; mtu 1500
        address: 00:d0:b7:bf:c6:95
        media: Ethernet autoselect (100baseTX full-duplex)
        status: active
        inet 66.77.24.2 netmask 0xffffff00 broadcast 66.77.24.255
        inet6 fe80::2d0:b7ff:febf:c695%fxp0 prefixlen 64 scopeid 0x1
fxp1: flags=8943&lt;UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST&gt; mtu 1500
        address: 00:02:b3:0a:d1:28
        media: Ethernet autoselect (100baseTX full-duplex)
        status: active
        inet 10.0.0.2 netmask 0xffffff00 broadcast 10.0.0.255
        inet6 fe80::202:b3ff:fe0a:d128%fxp1 prefixlen 64 scopeid 0x2
fxp2: flags=8843&lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&gt; mtu 1500
        address: 00:c0:4f:46:8d:ec
        media: Ethernet autoselect (100baseTX full-duplex)
        status: active
        inet 10.255.255.1 netmask 0xffffff00 broadcast 10.255.255.255
        inet6 fe80::2c0:4fff:fe46:8dec%fxp2 prefixlen 64 scopeid 0x3
pflog0: flags=141&lt;UP,RUNNING,PROMISC&gt; mtu 33224
pfsync0: flags=41&lt;UP,RUNNING&gt; mtu 1348
        pfsync: syncif: fxp2 syncpeer: 224.0.0.240 maxupd: 128
enc0: flags=0&lt;&gt; mtu 1536
carp0: flags=41&lt;UP,RUNNING&gt; mtu 1500
        carp: MASTER vhid 1 advbase 1 advskew 0
        inet 66.77.24.5 netmask 0xffffff00
        inet 66.77.24.10 netmask 0xffffff00
carp1: flags=41&lt;UP,RUNNING&gt; mtu 1500
        carp: BACKUP vhid 2 advbase 1 advskew 100
        inet 66.77.24.5 netmask 0xffffff00
        inet 66.77.24.10 netmask 0xffffff00
carp2: flags=41&lt;UP,RUNNING&gt; mtu 1500
        carp: MASTER vhid 1 advbase 1 advskew 0
        inet 10.0.0.1 netmask 0xffffff00
carp3: flags=41&lt;UP,RUNNING&gt; mtu 1500
        carp: BACKUP vhid 2 advbase 1 advskew 100
        inet 10.0.0.1 netmask 0xffffff00</pre>
<p>The diagram in <a href="http://planet.admon.org/papers/jdixon_firewall_failover.pdf" target="_blank">Figure 2</a> shows that we have added three HTTP servers and one SMTP server. Each of the Web servers has a private IP address, but they all use the same public address via NAT. Outbound connections will cause the source address to be translated; inbound connections will be redirected to one of the destination addresses, mapping packets based on a hash of the source address. This will allow the firewalls to persistently send traffic from one client to the same server. The SMTP server also has a private address, but its traffic is translated via bidirectional mapping (<strong>binat</strong>) to a new external carp interface. The revised pf.conf can be viewed in <a href="http://planet.admon.org/papers/jdixon_firewall_failover.pdf" target="_blank">Listing 3</a>. A compilation of all the revised network settings are detailed in <a href="http://planet.admon.org/papers/jdixon_firewall_failover.pdf" target="_blank">Listing 4</a>.</p>
<p>With arpbalance enabled, incoming packets will be distributed between the two firewalls in a round-robin fashion. New connections are tracked via the <strong>source-hash</strong> option to the rdr translation rule. This ensures that future packets originating from the same client are passed on to the same internal server. Additional load-balancing techniques can be used on the internal HTTP pool by incorporating CARP on each of the pool members. This way, we not only allow traffic to be distributed between all three hosts, but we provide failover capabilities as well, just like that of the firewall pair.</p>
<p><strong>Summary</strong></p>
<p>Through the use of native OpenBSD utilities, we have a high-availability firewall solution based on commodity hardware that competes favorably with commercial offerings costing thousands of dollars more. The practical applications for CARP are limitless, as it can be used anywhere that load-balancing needs exist. It has been ported to userland on Linux kernels 2.4 and 2.6, NetBSD and FreeBSD, making it an ideal redundancy tool no matter what Unix-like system you use. But combine CARP with the enhanced security of OpenBSD, PF and pfsync, and you have a stateful firewall that won&#8217;t let you or your customers down.</p>
<p><strong>Resources</strong></p>
<p>OpenBSD &#8212; <strong>http://www.openbsd.org/</strong></p>
<p>OpenBSD FAQ &#8212; <strong>http://www.openbsd.org/faq/index.html</strong></p>
<p>PF &#8212; <strong>http://www.benzedrine.cx/pf.html</strong></p>
<p>PF User&#8217;s Guide &#8212; <strong>http://www.openbsd.org/faq/pf/index.html</strong></p>
<p>Userland CARP &#8212; <strong>http://www.ucarp.org/</strong></p>
<p>VRRP RFC 3768 &#8212; <strong>http://www.benzedrine.cx/pf.html</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.admon.org/failover-firewalls-with-openbsd-and-carp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Set timezone date and time in Linux</title>
		<link>http://www.admon.org/set-timezone-date-and-time-in-linux/</link>
		<comments>http://www.admon.org/set-timezone-date-and-time-in-linux/#comments</comments>
		<pubDate>Sun, 13 Dec 2009 03:07:53 +0000</pubDate>
		<dc:creator>joseph</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[System Tuning]]></category>
		<category><![CDATA[hwclock]]></category>
		<category><![CDATA[redhat]]></category>
		<category><![CDATA[time]]></category>
		<category><![CDATA[timezone]]></category>

		<guid isPermaLink="false">http://planet.admon.org/?p=491</guid>
		<description><![CDATA[Your computer has two timepieces; a battery-backed one that is always running (a.k.a. the hardware, BIOS, or CMOS clock), and another that is maintained by the operating system currently running, it&#8217;s called system clock. This document explains how to set your system clock, your timezone, and other stuff related to how linux does its time-keeping. [...]]]></description>
			<content:encoded><![CDATA[<p>Your computer has two timepieces; a battery-backed one that is always running (a.k.a. the hardware, BIOS, or CMOS clock), and another that is maintained by the operating system currently running, it&#8217;s called system clock. This document explains how to set your system clock, your timezone, and other stuff related to how linux does its time-keeping.<span id="more-491"></span></p>
<p>The hardware clock is generally only used to set the system clock when your operating system boots, and then from that point until you reboot or turn off your system, the system clock is the one used to keep track of time.</p>
<p>On Linux systems, you have a choice of keeping the hardware clock in <a href="http://geography.about.com/od/timeandtimezones/a/gmtutc.htm">UTC/GMT</a> time or local time. The preferred option is to keep it in UTC. The disadvantage with keeping the hardware clock in UTC is that if you dual boot with an operating system (like DOS) that expects the hardware clock to be set to local time, the time might be wrong in that OS.</p>
<p><strong>Set your timezone</strong></p>
<p>The timezone under Linux is set by a symbolic link from <em>/etc/localtime</em> to a file in the <em>/usr/share/zoneinfo</em> directory that corresponds with what timezone you are in. For example, since I&#8217;m of same timezone as Hong Kong, /etc/localtime is a symlink to <em>/usr/share/zoneinfo/Asia/Hong_Kong</em>. To set this up, run:</p>
<pre>[admon@planet ~]# ls -F /usr/share/zoneinfo/
Africa/      CST6CDT  Etc/     Greenwich  Kwajalein  Navajo     SystemV/   iso3166.tab
America/     Canada/  Europe/  HST        Libya      PRC        Turkey     posix/
Antarctica/  Chile/   Factory  Hongkong   MET        PST8PDT    UCT        posixrules
Arctic/      Cuba     GB       Iceland    MST        Pacific/   US/        right/
Asia/        EET      GB-Eire  Indian/    MST7MDT    Poland     UTC        zone.tab
Atlantic/    EST      GMT      Iran       Mexico/    Portugal   Universal
Australia/   EST5EDT  GMT+0    Israel     Mideast/   ROC        W-SU
Brazil/      Egypt    GMT-0    Jamaica    NZ         ROK        WET
CET          Eire     GMT0     Japan      NZ-CHAT    Singapore  Zulu

[admon@planet ~]# ln -sf /usr/share/zoneinfo/Asia/Hong_Kong /etc/localtime</pre>
<p>Replace your timezone with something like <em>US/Pacific</em> or <em>Europe/Paris</em>. Have a look in the directories under <em>/usr/share/zoneinfo</em> to see what timezones meet your needs.</p>
<p>This assumes that you are running Red Hat (or Redhat  based Linux) . On older systems, you&#8217;ll find that <em>/usr/lib/zoneinfo</em> is used instead of <em>/usr/share/zoneinfo</em>.</p>
<p><strong>Set the system clock</strong></p>
<p>To set the system clock under Linux, use the date command. As an example, to set the current time and date to <em>Sun Dec 13 10:02:00 AM CST 2009</em>, type <em>date 12131002</em> (note that the time is in 24 hour notation).</p>
<pre>[admon@planet ~]# date
Sun Dec 13 10:09:29 CST 2009
[admon@planet ~]# date 12131002
Sun Dec 13 10:02:00 CST 2009</pre>
<p>You can reset system time without date information like this:</p>
<pre>[admon@planet ~]# date -s 10:04
Sun Dec 13 10:04:00 CST 2009</pre>
<p>If you wanted to change the year as well, just type <em>date 121310022009</em>. To set the seconds as well, type <em>date 12131002.30</em> or <em>date 121310022009.30</em>. The following line is an example. When the command runs succesfully, it returns current system time:</p>
<pre>[admon@planet ~]# date 121310212009.30
Sun Dec 13 10:21:30 CST 2009</pre>
<p>An alternative way is to load system date and time from BIOS like this:</p>
<pre>[admon@planet ~]# date
Sun Dec 13 10:02:04 CST 2009
[admon@planet ~]# hwclock --hctosys
[admon@planet ~]# date
Sun Dec 13 10:09:29 CST 2009</pre>
<p><strong>Set the hardware clock</strong></p>
<p>When Linux boots, A initialization script will run the <em>/sbin/hwclock</em> program to copy the current hardware clock time to the system. To set the hardware clock, a common way is to set the system clock first, and then sync the new system time to hardware clock by typing <em>/sbin/hwclock &#8211;systohc</em> (or <em>/sbin/hwclock &#8211;systohc &#8211;utc</em> if you are keeping the hardware clock in UTC).</p>
<pre>[admon@planet ~]# date
Sun Dec 13 10:29:57 CST 2009
[admon@planet ~]# hwclock --systohc
[admon@planet ~]# hwclock
Sun Dec 13 10:30:13 2009  -0.716300 seconds
[admon@planet ~]# date
Sun Dec 13 10:30:13 CST 2009</pre>
<p><strong>Sync local time with a time server</strong><br />
This can be done by an entry in root&#8217;s crontab like this:</p>
<pre>[admon@planet ~]# crontab -l
MAILTO=""
30 4,16 * * * (/usr/sbin/ntpdate -s clock.redhat.com time.nist.gov ntp.admon.org)</pre>
<p>It means your system time will be synced with these time servers every 12 hours. If you have a cluster of machines which must share the same time, it&#8217;s suggested to build your own time server, and get other servers synchronized with it.</p>
<p>Instead of keeping your system time up-to-date with the world, a local time server can be configed to supply delayed time, that means you can keep your system time delayed with the public. It&#8217;s helpful for some specific environment, like if you need some delayed <a href="http://planet.admon.org/howto/tips-for-rebuilding-mysql-replication/">mysql replication servers</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.admon.org/set-timezone-date-and-time-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Postfix: Manage transport mapping table</title>
		<link>http://www.admon.org/postfix-manage-transport-mapping-table/</link>
		<comments>http://www.admon.org/postfix-manage-transport-mapping-table/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 12:40:07 +0000</pubDate>
		<dc:creator>joseph</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[System Tuning]]></category>
		<category><![CDATA[mta]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[sendmail]]></category>

		<guid isPermaLink="false">http://planet.admon.org/?p=482</guid>
		<description><![CDATA[I have some web servers running for productive purpose, and they all have to send out mails. So a problem comes, how can I config mail forwardings for these servers with only internal network to send out mails to the public network? Luckily it&#8217;s easy to implement with the help of either sendmail or postfix, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://planet.admon.org/wp-content/uploads/2009/12/postfix.jpg"><img class="alignleft size-full wp-image-745" title="postfix" src="http://planet.admon.org/wp-content/uploads/2009/12/postfix.jpg" alt="Postfix logo" width="136" height="130" /></a>I have some web servers running for productive purpose, and they all have to send out mails. So a problem comes, how can I config mail forwardings for these servers with only internal network to send out mails to the public network?</p>
<p style="text-align: center;">
<p>Luckily it&#8217;s easy to implement with the help of either sendmail or postfix, the two most common MTAs in Linux world. <span id="more-482"></span>If you&#8217;re using sendmail as your default mail transfer agent, you can <a href="http://www.sendmail.org/m4/masquerading.html">enable forwarding by MAIL_HUB</a>, and all incoming mails would be sent to a centralized hub, then processed there.</p>
<p>Here we show an exmaple based on <a href="http://www.postfix.org/">Postfix</a>.<br />
We use postfix to forward different mails to different smtp servers. To be specific, we forward mails that destinated to our own domains to an internal SMTP server, and relay outbound mails to another server which is able to access external network.<br />
By implementing mail transfer like this, we can also speedup mail transfer.</p>
<p>All we need to do is to adjust postfix&#8217;s transport mapping table, it&#8217;s <strong>/etc/postfix/transport</strong>.</p>
<p>We just need to add two new lines in this file, it&#8217;s like this:</p>
<pre>cards.example.com    :
example.com    :[192.168.19.198]</pre>
<p>It directs mails for cards.example.com to local mail server, and mails for example.com to another mail server 192.168.19.198 which also has external IP address. The <strong>[]</strong> around the hostname is intended to disable MX lookups.</p>
<p>After making changes, use this command to make it take effect:</p>
<pre>$ postmap /etc/postfix/transport</pre>
<p>Then you may need to flush mail queue for the Postfix instance:</p>
<pre>$ postfix flush</pre>
<p>Some other tips may help you as well:</p>
<ul>
<li> To check mail queue list, run: <em>mailq</em></li>
<li> To remove all mail from the queue, run: <em>postsuper -d ALL</em></li>
<li> To remove all mails in the deferred queue, enter: <em>postsuper -d ALL deferred</em></li>
<li> To start/stop postfix instance: <em>postfix start</em> and <em>postfix stop</em></li>
</ul>
<p>It&#8217;s that simple, but much meaningful as you can define other rules in this file.</p>
<p>For any issues, dont forget to raise a ticket at <a href="http://forum.admon.org/mail-instances/">our mail forum</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.admon.org/postfix-manage-transport-mapping-table/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>13th Workshop on High Performance Transaction Systems</title>
		<link>http://www.admon.org/13th-workshop-on-high-performance-transaction-systems/</link>
		<comments>http://www.admon.org/13th-workshop-on-high-performance-transaction-systems/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 06:38:08 +0000</pubDate>
		<dc:creator>joseph</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[System Tuning]]></category>
		<category><![CDATA[high performance]]></category>
		<category><![CDATA[hpts]]></category>

		<guid isPermaLink="false">http://planet.admon.org/?p=456</guid>
		<description><![CDATA[The 13th international workshop on HPTS held at October 25-28, 2009, Pacific Grove, CA. It&#8217;s all about real systems problems for real systems builders! The papers are listed at its official website. These papers are really really very informative, it&#8217;s suggested to have a read! Every two years, HPTS brings together a lively and opinionated [...]]]></description>
			<content:encoded><![CDATA[<p>The 13th international workshop on <a href="http://www.hpts.ws/index.html">HPTS</a> held at October 25-28, 2009, Pacific Grove, CA. It&#8217;s all about real systems problems for real systems builders! <a href="http://www.hpts.ws/agenda.html">The papers are listed</a> at its official website. These papers are really really very informative, it&#8217;s suggested to have a read!</p>
<p>Every two years, HPTS brings together a lively and opinionated group of participants to discuss and debate the pressing topics that affect today&#8217;s systems and their design and implementation.<span id="more-456"></span></p>
<p>I&#8217;ve downloaded <a href="http://planet.admon.org/papers/HPTS/13th.htm">these papers on my website</a>, you can read them on these links as well:</p>
<p><a href="http://planet.admon.org/papers/HPTS/A-Performance-Puzzle:-B-Tree-Insertions-Are-Slow-on-SSDs.pdf">A Performance Puzzle: B Tree Insertions Are Slow on SSDs</a></p>
<p><a href="http://planet.admon.org/papers/HPTS/A-Sea-Change-is-Coming-on-Transaction-Drivers.pdf">A Sea Change is Coming on Transaction Drivers</a></p>
<p><a href="http://planet.admon.org/papers/HPTS/Availability-in-the-Cloud.pdf">Availability in the Cloud</a></p>
<p><a href="http://planet.admon.org/papers/HPTS/Challenges-and-Lessons-from-Growing-an-e-Commerce-Platform-to-Planet-Scale-.pdf">Challenges and Lessons from Growing an e Commerce Platform to Planet Scale </a></p>
<p><a href="http://planet.admon.org/papers/HPTS/Cloud-DB.pdf">Cloud DB</a></p>
<p><a href="http://planet.admon.org/papers/HPTS/Enterprise-Systems-in-the-Cloud.pdf">Enterprise Systems in the Cloud</a></p>
<p><a href="http://planet.admon.org/papers/HPTS/Flash-on-Compute-Servers.pdf">Flash on Compute Servers</a></p>
<p><a href="http://planet.admon.org/papers/HPTS/H-Store:-A-specialized-architecture-for-high-throughput-OLTP-applications.pdf">H Store: A specialized architecture for high throughput OLTP applications</a></p>
<p><a href="http://planet.admon.org/papers/HPTS/Implementing-Search-in-the-Cloud.pdf">Implementing Search in the Cloud</a></p>
<p><a href="http://planet.admon.org/papers/HPTS/Implications-of-Storage-Class-Memories-on-Software-Architectures.pdf">Implications of Storage Class Memories on Software Architectures</a></p>
<p><a href="http://planet.admon.org/papers/HPTS/Lessons-Learned-Dealing-with-Massive-Scale-and-Slow-Networks-in-China.pdf">Lessons Learned Dealing with Massive Scale and Slow Networks in China</a></p>
<p><a href="http://planet.admon.org/papers/HPTS/Look-at-Clouds-from-Both-Sides.pdf">Look at Clouds from Both Sides</a></p>
<p><a href="http://planet.admon.org/papers/HPTS/Memory-Technologies-for-Data-Intensive-Computing.pdf">Memory Technologies for Data Intensive Computing</a></p>
<p><a href="http://planet.admon.org/papers/HPTS/Meter-Automation.pdf">Meter Automation</a></p>
<p><a href="http://planet.admon.org/papers/HPTS/Mobile-Personal-Sensing:-A-new-driver-for-high-performance-transaction-systems.pdf">Mobile Personal Sensing: A new driver for high performance transaction systems</a></p>
<p><a href="http://planet.admon.org/papers/HPTS/RAMCloud:-Scalable-High-Performance-Storage-Entirely-in-DRAM.pdf">RAMCloud: Scalable High Performance Storage Entirely in DRAM</a></p>
<p><a href="http://planet.admon.org/papers/HPTS/Scalable-transaction-execution-on-multicore-platforms.pdf">Scalable transaction execution on multicore platforms</a></p>
<p><a href="http://planet.admon.org/papers/HPTS/Scaling-Out-without-Partitioning.pdf">Scaling Out without Partitioning</a></p>
<p><a href="http://planet.admon.org/papers/HPTS/SciDB:-Unconventional-Choices-for-Scientific-Computing.pdf">SciDB: Unconventional Choices for Scientific Computing</a></p>
<p><a href="http://planet.admon.org/papers/HPTS/Smart-Grid-Challenges.pdf">Smart Grid Challenges</a></p>
<p><a href="http://planet.admon.org/papers/HPTS/Supporting-Large-Scale-Scientific-and-Engineering-Applications-Using-DBMS-Technology.pdf">Supporting Large Scale Scientific and Engineering Applications Using DBMS Technology</a></p>
<p><a href="http://planet.admon.org/papers/HPTS/Systems-Software-for-Multicore-Processors.pdf">Systems Software for Multicore Processors</a></p>
<p><a href="http://planet.admon.org/papers/HPTS/Trustworthy-Accounting.pdf">Trustworthy Accounting</a></p>
<p><a href="http://planet.admon.org/papers/HPTS/Write-Caching-with-Reduced-Durability.pdf">Write Caching with Reduced Durability</a></p>
<p><a href="http://planet.admon.org/papers/HPTS/Xtremely-Large-File-Systems-for-the-small-collaborative-world.pdf">Xtremely Large File Systems for the small collaborative world</a></p>
<p><a href="http://planet.admon.org/papers/HPTS/Zetta-Enterprise-Cloud-Storage-Service.pdf">Zetta Enterprise Cloud Storage Service</a></p>
<p>Note: These are all in PDF format, and total size for these 26 documents are 76MB in total.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.admon.org/13th-workshop-on-high-performance-transaction-systems/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What network issues should be monitored?</title>
		<link>http://www.admon.org/what-network-issues-should-be-monitored/</link>
		<comments>http://www.admon.org/what-network-issues-should-be-monitored/#comments</comments>
		<pubDate>Fri, 11 Sep 2009 17:46:24 +0000</pubDate>
		<dc:creator>joseph</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[System Tuning]]></category>
		<category><![CDATA[arp]]></category>
		<category><![CDATA[ICMP]]></category>
		<category><![CDATA[system monitoring]]></category>

		<guid isPermaLink="false">http://blog.admon.org/?p=178</guid>
		<description><![CDATA[Network is the basis of the communication to your customers, page viewers. without network, computers are of no usage at all, arent they? But most of the guys always pay very little attention to the health of their networks. Generally, there are some type of networks issues should special pay attention: 1, abnormal network traffic, [...]]]></description>
			<content:encoded><![CDATA[<div>
<p>Network is the basis of the communication to your customers, page  viewers. without network, computers are of no usage at all, arent they?  But most of the guys always pay very little attention to the health of  their networks. Generally, there are some type of n<strong>etworks issues  should special pay attention</strong>:<span id="more-178"></span></p>
<p>1, abnormal network traffic, like pink traffic, highload traffic  appeared some time with no clear reason, very low traffic during  business time and so on. these type of issues can all be monitored by  Hostpry, and the alerting messages can be scheduled separately in  business time or non-business time.</p>
<p>2, ethernet card failure. If your fiber is not running at proper stat, you may find some error in dmesg like this:</p>
<p>tg3: eth0: Link is down.<br />
tg3: eth0: Link is up at 1000 Mbps, full duplex.<br />
tg3: eth0: Flow control is on for TX and on for RX.<br />
tg3: eth0: Link is down.<br />
tg3: eth0: Link is up at 1000 Mbps, full duplex.<br />
tg3: eth0: Flow control is on for TX and on for RX.<br />
tg3: eth0: Link is down.<br />
tg3: eth0: Link is up at 1000 Mbps, full duplex.<br />
tg3: eth0: Flow control is on for TX and on for RX.</p>
<p>sometimes, it will cause a highload and sometimes, your  business critical connections would be reset by such issue. when you  find this type of message, it&#8217;s recommended to use a new fibre instead.</p>
<p>3, connection statistics check  Generally, there are three type of traffic need your attention:</p>
<p><strong>SYN packet</strong><em><br />
</em>mostly they are attacks if you face too many SYN packet above the normal ratio.(some network problem may also cause too much SYN packets).</p>
<p><em>$ netstat -an | grep -c SYN_RECV<br />
510</em></p>
<p><strong>Too much Established Connections</strong><br />
It should be treated as attack sometimes, and you need to check your system to make sure whether you are right.</p>
<p>$ netstat -st | grep estab<br />
8436 connections established<br />
265 packets rejects in established connections because of timestamp</p>
<p>The service log, for example apache&#8217;s access_log, sendmail&#8217;s maillog will be the key points for you to prove it.</p>
<p><strong>Abnormal ICMP traffic</strong><br />
Ping of Death is a well-known ICMP Flood Attack. An ICMP attack can come in many forms, and sometimes it has some relation with UDP. ICMP  flood attack can usually be accomplished by broadcasting either a bunch  of  ICMP pings or UDP packets. UDP is widely used in softwares s like Bind, when an UDP cannot find its destination port or destination host,  an ICMP reply will be generated to the source side.<br />
The idea is that the bad guys generate so much data that destinated to  your system( for example, using your IP address to create some faked  packets and broad them, then your real server will be flooded by the  returned ICMP. This will slow you down so much that you can not supply  any service.<br />
Also there are ways to find out such issue as they are slightly recorded by  modern operation systems.</div>
]]></content:encoded>
			<wfw:commentRss>http://www.admon.org/what-network-issues-should-be-monitored/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Common wget usage examples</title>
		<link>http://www.admon.org/common-wget-usage-examples/</link>
		<comments>http://www.admon.org/common-wget-usage-examples/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 13:01:24 +0000</pubDate>
		<dc:creator>joseph</dc:creator>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[wget]]></category>

		<guid isPermaLink="false">http://blog.admon.org/?p=108</guid>
		<description><![CDATA[Wget is one of my favorite tools in Linux/Unix world. Sometimes, you want to download all the rpm, deb, iso, or tgz files and save them into a directory. Sometimes you need to use it to check your web server status. Here are some of my favorite wget usage examples: $ wget -i filename.txt Put [...]]]></description>
			<content:encoded><![CDATA[<div>
<p><a href="http://www.gnu.org/software/wget/" mce_href="http://www.gnu.org/software/wget/">Wget</a> is one of my favorite tools in <b>Linux/Unix </b>world. Sometimes, you want to download all the rpm, deb, iso, or tgz files and save them into a directory. Sometimes you need to use it to <b>check your web server status</b>. Here are some of my favorite wget usage examples:<img class="mceWPmore mceItemNoResize" title="More..." src="http://planet.admon.org/wp-includes/js/tinymce/plugins/wordpress/img/trans.gif" mce_src="http://planet.admon.org/wp-includes/js/tinymce/plugins/wordpress/img/trans.gif" alt=""></p>
<p>$ wget -i filename.txt<br />
Put the URLs in filename.txt and run wget against it to download a list of files automatically.</p>
<p>How to download large files in a bad connection? You can have a try with &#8211;continue option:<br />
$ wget -c <a title="http://www.020i.com/really-big-file.iso" href="http://www.020i.com/really-big-file.iso" mce_href="http://www.020i.com/really-big-file.iso">http://www.020i.com/really-big-file.iso</a><br />
The “-c” option tells wget to continue and retry until downloading completed.</p>
<p>$ wget &#8211;spider <a title="http://www.020i.com/" href="http://www.020i.com/" mce_href="http://www.020i.com/">http://www.020i.com/</a><br />
This command is very useful to check a web server&#8217;s running status. A &#8220;200 OK&#8221; in the output means your web server is ready for request.</p>
<p>$ <b>wget -r -np -nd</b> <a title="http://www.020i.com/files/" href="http://www.020i.com/files/" mce_href="http://www.020i.com/files/">http://www.020i.com/files/</a><br />
This little command is probably the most used variation. It downloads all files in the /files/ directory on 020i.com, without traversing up to parent directories (-np), and without recreating the directory structure on your machine (-nd).</p>
<p>$ wget -r -np -nd &#8211;accept=iso <a title="http://www.020i.com/centos-5/i386/" href="http://www.020i.com/centos-5/i386/" mce_href="http://www.020i.com/centos-5/i386/">http://www.020i.com/centos-5/i386/</a><br />
Adding the -–accept argument with a list of file extensions (comma separated) will grab only these files in the right extensions.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.admon.org/common-wget-usage-examples/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setup OpenVPN in one minute</title>
		<link>http://www.admon.org/setup-openvpn-in-one-minute/</link>
		<comments>http://www.admon.org/setup-openvpn-in-one-minute/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 08:41:21 +0000</pubDate>
		<dc:creator>joseph</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[vpn]]></category>

		<guid isPermaLink="false">http://blog.admon.org/?p=85</guid>
		<description><![CDATA[This article will guide you on creating a client-2-server OpenVPN instance. Our goal is to redirect all client traffic to VPN server. That means VPN server would serve as a gateway for local traffic. It&#8217;s useful to bypass some STUPID National firewalls,or to test IP-restricted applications. The most important part for this installation is openvpn&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>This article will guide you on creating a client-2-server OpenVPN instance. Our goal is to redirect all client traffic to VPN server. That means VPN server would serve as a gateway for local traffic. It&#8217;s useful to bypass some STUPID National firewalls,or to test IP-restricted applications.<span id="more-85"></span></p>
<p>The most important part for this installation is openvpn&#8217;s two config files, one is the server side configuration, and the other is for client side.</p>
<p>This is a server side configuration file:</p>
<pre>
$ cat /usr/local/openvpn/etc/server.conf
# Which local IP address should OpenVPN listen on? (optional)
;local a.b.c.d

port 1194
proto udp
;dev tap
dev tun

;dev-node MyTap

ca /usr/local/openvpn/etc/keys/ca.crt
cert /usr/local/openvpn/etc/keys/server.crt
key /usr/local/openvpn/etc/keys/server.key
dh /usr/local/openvpn/etc/keys/dh1024.pem

server 10.10.10.0 255.255.255.0
ifconfig-pool-persist ipp.txt

;server-bridge 10.10.10.2 255.255.255.0 10.10.10.30 10.10.10.40

;push "route 10.10.10.0 255.255.255.0"
;push "route 192.168.20.0 255.255.255.0"

;client-config-dir ccd
;route 192.168.40.128 255.255.255.248
# First uncomment out these lines:
;client-config-dir ccd
;route 10.9.0.0 255.255.255.252
# Then add this line to ccd/Thelonious:
#   ifconfig-push 10.9.0.1 10.9.0.2

;learn-address ./script
;push "redirect-gateway def1"

# <a title="http://openvpn.net/faq.html#dhcpcaveats" href="http://openvpn.net/faq.html#dhcpcaveats">http://openvpn.net/faq.html#dhcpcaveats</a>
push "dhcp-option DNS 85.17.150.123"
;push "dhcp-option WINS 10.8.0.1"

tls-auth /usr/local/openvpn/etc/keys/ta.key 0
client-to-client
keepalive 10 120

# Select a cryptographic cipher.
# This config item must be copied to the client config file as well.
;cipher BF-CBC        # Blowfish (default)
;cipher AES-128-CBC   # AES
;cipher DES-EDE3-CBC  # Triple-DES

# Enable compression on the VPN link.
# If you enable it here, you must also enable it in the client config file.
comp-lzo

# The maximum number of concurrently connected clients we want to allow.
;max-clients 100

# It's a good idea to reduce the OpenVPN daemon's privileges after initialization.
# You can uncomment this out on non-Windows systems.
user nobody
group nobody

persist-key
persist-tun

status /usr/local/openvpn/logs/openvpn-status.log
log /usr/local/openvpn/logs/openvpn.log
;log-append  openvpn.log

verb 4
;mute 20
</pre>
<p>Here&#8217;s an example of the client side configuration file, it&#8217;s used by windows client:</p>
<pre>$ cat  netherlands.ovpn
client
;dev tap
dev tun
proto udp

remote openvpn.admon.org 1194

;remote-random
;resolv-retry infinite
;nobind
;user nobody
;group nobody

persist-key
persist-tun

;http-proxy-retry # retry on connection failures
;http-proxy [proxy server] [proxy port #]

;mute-replay-warnings

ca ca.crt
cert joseph.crt
key joseph.key
tls-auth ta.key 1

ns-cert-type server
;cipher x
comp-lzo
verb 3
;mute 20
redirect-gateway def1
</pre>
<p>Let&#8217;s start the deploying now. For a typic fresh installation, we need to install both <a href="http://www.oberhumer.com/opensource/lzo/" target="_blank">lzo</a> ( Real-time data compression library ) and <a href="http://www.openvpn.net/" target="_blank">OpenVPN</a>, for the windows client side, we need its windows version, it&#8217;s available here: <a title="http://www.openvpn.se/" href="http://www.openvpn.se/">http://www.openvpn.se/</a></p>
<p>After created the applications, it&#8217;s time to generate key files, I simply listed the commands here:</p>
<pre>
$ openvpn-2.0.9/easy-rsa

$ vi vars
$ . vars
$ ./clean-all

$ ./build-ca
$ ./build-key-server server
$ ./build-dh  #Diffie Hellman parameters
$ openvpn --genkey --secret ta.key
$ ./build-key joseph  #Client key, keys/joseph.*
$ ./build-key client0  #Client0's key files, they're stored in keys/client0.*
</pre>
<p>After finished creating client keys, we may need to modify the client<br />
side configuration file, to make sure it uses correct key file. In the<br />
above example, we&#8217;re using joseph.*. When these key files generated, there&#8217;re two additional modifications, they both are critical:<br />
On OpenVPN server, we need to turn on ip_forward, in order to redirect VPN traffic on localhost.</p>
<pre>$ echo 1 &gt; /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -s 10.10.10.0/255.255.255.0 -o eth0 -j SNAT --to-source 94.94.94.94
</pre>
<p>Now,all the configuratio is finished, let&#8217;s start the OpenVPN server now:</p>
<pre>
/usr/local/openvpn/sbin/openvpn --daemon --config /usr/local/openvpn/etc/server.conf</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.admon.org/setup-openvpn-in-one-minute/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

