<?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>Hack Admin &#187; Network</title>
	<atom:link href="http://www.hackadmin.com/category/network/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.hackadmin.com</link>
	<description></description>
	<lastBuildDate>Tue, 16 Mar 2010 21:31:57 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>IP Failover For Web Cluster</title>
		<link>http://www.hackadmin.com/2010/02/22/ip-failover-for-web-cluster/</link>
		<comments>http://www.hackadmin.com/2010/02/22/ip-failover-for-web-cluster/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 00:38:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Aashish]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[TCP/IP]]></category>
		<category><![CDATA[cluster]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[centos]]></category>

		<guid isPermaLink="false">http://www.hackadmin.com/?p=258</guid>
		<description><![CDATA[keepalived provides a strong and robust health checking for LVS clusters. It nginx implements a framework of health checking on multiple layers for server failover, and VRRPv2 stack to handle director failover. How do I install and configure Keepalived for reverse proxy server such as nginx or lighttpd?]]></description>
			<content:encoded><![CDATA[<p>Article by <a href="http://www.hackadmin.com/aashish/">Aashish</a></p>
<p>keepalived provides a strong and robust health checking for LVS clusters. It nginx implements a framework of health checking on multiple layers for server failover, and VRRPv2 stack to handle director failover. How do I install and configure Keepalived for reverse proxy server such as nginx or lighttpd?</p>
<p><span id="more-258"></span><br />
If your are using a LVS director to loadbalance a server pool in a production environment, you may want to have a robust solution for healthcheck &amp; failover. This will also work with reverse proxy server such as nginx.</p>
<p>lb0 &#8211; Linux box directly connected to the Internet via eth1. This is master load balancer.<br />
lb1 &#8211; Linux box directly connected to the Internet via eth1. This is backup load balancer. This will become active if master networking failed.</p>
<p>202.54.1.1 &#8211; This ip moves between lb0 and lb1 server. It is called virtual IP address and it is managed by keepalived.<br />
eth0 is connected to LAN and all other backend software such as Apache, MySQL and so on.</p>
<p><strong>You need to install the following softwares on both lb0 and lb1:<br />
</strong><br />
keepalived for IP failover.<br />
iptables to filter traffic<br />
nginx or lighttpd revers proxy server.</p>
<p><strong>DNS settings should be as follows:</strong></p>
<p><a href="http://hackadmin.in/" target="_blank">hackadmin.in</a> &#8211; Our sample domain name.<br />
<a href="http://lb0.hackadmin.in/" target="_blank">lb0.hackadmin.in</a> &#8211; 202.54.1.11 (real ip assigned to eth1)<br />
<a href="http://lb1.hackadmin.in/" target="_blank">lb1.hackadmin.in</a> &#8211; 202.54.1.12 (real ip assigned to eth1)<br />
<a href="../" target="_blank">www.hackadmin.com</a> &#8211; 202.54.1.1 (VIP for web server) do not assign this IP to any interface.</p>
<p><strong>Install Keepalived</strong></p>
<p>Visit <a href="http://keepalived.org/" target="_blank">keepalived.org</a> to grab latest source code. You can use the wget command to download the same (you need to install keepalived on both lb0 and lb1):</p>
<p># cd /opt</p>
<p># wget <a href="http://www.keepalived.org/software/keepalived-1.1.19.tar.gz" target="_blank">http://www.keepalived.org/software/keepalived-1.1.19.tar.gz</a></p>
<p>#  tar -zxvf keepalived-1.1.19.tar.gz</p>
<p># cd keepalived-1.1.19</p>
<p><strong>Install Kernel Headers</strong></p>
<p>You need to install the following packages:</p>
<p>Kernel-headers &#8211; includes the C header files that specify the interface between the Linux kernel and userspace libraries and programs. The header files define structures and constants that are needed for building most standard programs and are also needed for rebuilding the glibc package.<br />
kernel-devel &#8211; this package provides kernel headers and makefiles sufficient to build modules against the kernel package.</p>
<p>Make sure kernel-headers and kernel-devel packages are installed. If not type the following install the same:<br />
<strong><br />
Compile keepalived</strong></p>
<p><strong>Type the following command:</strong><br />
# ./configure &#8211;with-kernel-dir=/lib/</p>
<div id=":1j0">modules/$(uname -r)/build</p>
<p>Sample outputs:</p>
<p>checking for gcc&#8230; gcc<br />
checking for C compiler default output file name&#8230; a.out<br />
checking whether the C compiler works&#8230; yes<br />
checking whether we are cross compiling&#8230; no<br />
checking for suffix of executables&#8230;<br />
checking for suffix of object files&#8230; o<br />
&#8230;<br />
&#8230;..<br />
..<br />
config.status: creating keepalived/check/Makefile<br />
config.status: creating keepalived/libipvs-2.6/Makefile</p>
<p><strong>Keepalived configuration</strong><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
Keepalived version       : 1.1.19<br />
Compiler                 : gcc<br />
Compiler flags           : -g -O2<br />
Extra Lib                : -lpopt -lssl -lcrypto<br />
Use IPVS Framework       : Yes<br />
IPVS sync daemon support : Yes<br />
Use VRRP Framework       : Yes<br />
Use Debug flags          : No</p>
<p><strong>Compile and install the same:</strong><br />
# make &amp;&amp; make install</p>
<p><strong>Create Required Softlinks</strong></p>
<p>Type the following commands to create service and run it at RHEL / CentOS run level #3 :<br />
# cd /etc/sysconfig<br />
# ln -s /usr/local/etc/sysconfig/keepalived .<br />
# cd /etc/rc3.d/<br />
# ln -s /usr/local/etc/rc.d/init.d/keepalived S100keepalived<br />
# cd /etc/init.d/<br />
# ln -s /usr/local/etc/rc.d/init.d/keepalived .<br />
<strong><br />
Configuration</strong></p>
<p>Your main configuration directory is located at /usr/local/etc/keepalived and configuration file name is keepalived.conf. First, make backup of existing configuration:<br />
# cd /usr/local/etc/keepalived<br />
# cp keepalived.conf keepalived.conf.bak<br />
Edit keepalived.conf as follows on lb0:</p>
<p>vrrp_instance VI_1 {<br />
interface eth0<br />
state MASTER<br />
virtual_router_id 51<br />
priority 101<br />
authentication {<br />
auth_type PASS<br />
auth_pass Add-Your-Password-Here<br />
}<br />
virtual_ipaddress {<br />
<a href="http://202.54.1.1/29" target="_blank">202.54.1.1/29</a> dev eth1<br />
}<br />
}</p>
<p>Edit keepalived.conf as follows on lb1 (note priority set to 100 i.e. backup load balancer):</p>
<p>vrrp_instance VI_1 {<br />
interface eth0<br />
state MASTER<br />
virtual_router_id 51<br />
priority 100<br />
authentication {<br />
auth_type PASS<br />
auth_pass Add-Your-Password-Here<br />
}<br />
virtual_ipaddress {<br />
<a href="http://202.54.1.1/29" target="_blank">202.54.1.1/29</a> dev eth1<br />
}<br />
}</p>
<p>Save and close the file. Finally start keepalived on both lb0 and lb1 as follows:<br />
# /etc/init.d/keepalived start</p>
<p>Verify: Keepalived Working Or Not</p>
<p>/var/log/messages will keep track of VIP:<br />
# tail -f /var/log/messages<br />
Sample outputs:</p>
<p>Feb 21 04:06:15 lb0 Keepalived_vrrp: Netlink reflector reports IP 202.54.1.1 added<br />
Feb 21 04:06:20 lb0 Keepalived_vrrp: VRRP_Instance(VI_1) Sending gratuitous ARPs on eth1 for 202.54.1.1</p>
<p>Verify that VIP assigned to eth1:<br />
# ip addr show eth1<br />
<strong>Sample outputs:</strong></p>
<p>3: eth1:  mtu 1500 qdisc pfifo_fast qlen 10000<br />
link/ether 00:30:48:30:30:a3 brd ff:ff:ff:ff:ff:ff<br />
inet <a href="http://202.54.1.11/29" target="_blank">202.54.1.11/29</a> brd 202.54.1.254 scope global eth1<br />
inet <a href="http://202.54.1.1/29" target="_blank">202.54.1.1/29</a> scope global secondary eth1</p>
<p><strong>ping failover test</strong></p>
<p>Open UNIX / Linux / OS X desktop terminal and type the following command to ping to VIP:<br />
# ping 202.54.1.1<br />
Login to lb0 and halt the server or take down networking:<br />
# halt<br />
Within seconds VIP should move from lb0 to lb1 and you should not see any drops in ping. On lb1 you should get the following in /var/log/messages:</p>
<p>Feb 21 04:10:07 lb1 Keepalived_vrrp: VRRP_Instance(VI_1) forcing a new MASTER election<br />
Feb 21 04:10:08 lb1 Keepalived_vrrp: VRRP_Instance(VI_1) Transition to MASTER STATE<br />
Feb 21 04:10:09 lb1 Keepalived_vrrp: VRRP_Instance(VI_1) Entering MASTER STATE<br />
Feb 21 04:10:09 lb1 Keepalived_vrrp: VRRP_Instance(VI_1) setting protocol VIPs.<br />
Feb 21 04:10:09 lb1 Keepalived_healthcheckers: Netlink reflector reports IP 202.54.1.1 added<br />
Feb 21 04:10:09 lb1 Keepalived_vrrp: VRRP_Instance(VI_1) Sending gratuitous ARPs on eth1 for 202.54.1.1</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.hackadmin.com/2010/02/22/ip-failover-for-web-cluster/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Dell Switches, Digi Console Servers and Linux Serial Ports</title>
		<link>http://www.hackadmin.com/2009/07/04/dell-switches-digi-console-servers-and-linux-serial-ports/</link>
		<comments>http://www.hackadmin.com/2009/07/04/dell-switches-digi-console-servers-and-linux-serial-ports/#comments</comments>
		<pubDate>Sat, 04 Jul 2009 13:56:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[Workaround]]></category>
		<category><![CDATA[console server]]></category>
		<category><![CDATA[Dell]]></category>
		<category><![CDATA[dell 6000 series]]></category>
		<category><![CDATA[Dell 6224]]></category>
		<category><![CDATA[Digi]]></category>
		<category><![CDATA[digi passport]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Linux Console]]></category>
		<category><![CDATA[serial port]]></category>
		<category><![CDATA[switch]]></category>

		<guid isPermaLink="false">http://www.hackadmin.com/?p=99</guid>
		<description><![CDATA[What a day&#8230;  So we have a fancy new(new to us) Dell 6000 series switch, a 6224 actually.  As it turns out, our typical remote serial solution won&#8217;t work with this switch.  Normally we&#8217;ll connect the console port of these switches to a Digi Passport Server.  The network has 2 entry [...]]]></description>
			<content:encoded><![CDATA[<p>What a day&#8230;  So we have a fancy new(new to us) Dell 6000 series switch, a 6224 actually.  As it turns out, our typical remote serial solution won&#8217;t work with this switch.  Normally we&#8217;ll connect the console port of these switches to a Digi Passport Server.  The network has 2 entry points, so if we need to work on any device that may cause an outage at either entry point, we have options to maintain connectivity.</p>
<p><span id="more-99"></span><br />
At any rate, this sweet little 6000 series switch works fine connected to a PC, but through the Digi we get no love.  What does Dell say?  Dell says it should be exactly like all of our 5000 series switches and there should be no change in Digi pinouts, they also said, if it doesn&#8217;t work now, it never will.  Whatever that means..  Well this of course creates a dilemma, we need to modify this thing and it is definitely going to drop the network.</p>
<p>So the short term solution is using a linux box that is connected to one of our entry points.  Basically we just plugged the Dell console cable into the serial port of this server.  After that you can just use screen from a terminal window to make it all go.</p>
<p>Once you have the Dell console cable connected, open a terminal window to the server that is hooked to the Dell(or whatever device).  If you haven&#8217;t used sceen before, it&#8217;s really quite simple, basically, in your terminal window type the following command:</p>
<p>screen /dev/ttyS0 9600</p>
<p>This opens a console connection to the dell through your serial port at 9600 baud.  Once you are in here, it&#8217;s life as normal, it&#8217;s getting out where you&#8217;ll need to know a little about screen.</p>
<p>The easiest way to bail out of this connection is the following sequence:<br />
CTRL + A<br />
K (SHIFT + K)</p>
<p>This will open a dialog at the bottom of the window asking if you are sure that you want to kill this window.  Answer &#8216;y&#8217; and you are back to your original terminal window.</p>
<p>Dat&#8217;s it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hackadmin.com/2009/07/04/dell-switches-digi-console-servers-and-linux-serial-ports/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Static Routes in CentOS 5.2</title>
		<link>http://www.hackadmin.com/2008/11/04/static-routes-in-centos-52/</link>
		<comments>http://www.hackadmin.com/2008/11/04/static-routes-in-centos-52/#comments</comments>
		<pubDate>Tue, 04 Nov 2008 20:29:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[centos 5.2]]></category>
		<category><![CDATA[gateway]]></category>
		<category><![CDATA[route-etho]]></category>
		<category><![CDATA[static route]]></category>
		<category><![CDATA[static routes]]></category>

		<guid isPermaLink="false">http://www.hackadmin.com/2008/11/04/static-routes-in-centos-52/</guid>
		<description><![CDATA[To add a static route in CentOS 5.2 create a file specific to the interface in /etc/sysconfig/network-scripts.
For example, if you are adding routes where the route&#8217;s gateway will be on the network in use on eth0, you will create the following file:  route-eth0
In the file add the following parameters:
GATEWAY0=192.168.195.2
NETMASK0=255.255.255.0
ADDRESS0=10.0.0.0
For each subsequent route statement increment [...]]]></description>
			<content:encoded><![CDATA[<p>To add a static route in CentOS 5.2 create a file specific to the interface in /etc/sysconfig/network-scripts.</p>
<p><span id="more-15"></span>For example, if you are adding routes where the route&#8217;s gateway will be on the network in use on eth0, you will create the following file:  route-eth0</p>
<p>In the file add the following parameters:</p>
<p><code>GATEWAY0=192.168.195.2<br />
NETMASK0=255.255.255.0<br />
ADDRESS0=10.0.0.0</code></p>
<p>For each subsequent route statement increment the number that is appended to each parameter.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hackadmin.com/2008/11/04/static-routes-in-centos-52/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Test Your Site for Specific SSL Version Support</title>
		<link>http://www.hackadmin.com/2008/06/30/test-your-site-for-specific-ssl-version-support/</link>
		<comments>http://www.hackadmin.com/2008/06/30/test-your-site-for-specific-ssl-version-support/#comments</comments>
		<pubDate>Mon, 30 Jun 2008 21:08:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[pci]]></category>
		<category><![CDATA[pci compliance]]></category>
		<category><![CDATA[SSL]]></category>
		<category><![CDATA[ssl v2]]></category>
		<category><![CDATA[ssl version support]]></category>

		<guid isPermaLink="false">http://www.hackadmin.com/2008/06/30/test-your-site-for-specific-ssl-version-support/</guid>
		<description><![CDATA[Ok, so I had a hell of a time with some PCI compliance stuff.   I was in somebody else&#8217;s config and it was a mess.  Basically what I needed was a tool to test for what versions of SSL the server was allowing.   Instead, I kept mucking with the config trying to get all the [...]]]></description>
			<content:encoded><![CDATA[<p>Ok, so I had a hell of a time with some PCI compliance stuff.   I was in somebody else&#8217;s config and it was a mess.  Basically what I needed was a tool to test for what versions of SSL the server was allowing.   Instead, I kept mucking with the config trying to get all the SSLv2 crap out of it&#8230; and it kept accepting SSLv2 requests.  In order to verify I had failed again, I was waiting for the PCI reports to return (2 or 3 hours).  Not very time efficient.</p>
<p><span id="more-14"></span>At any rate, here&#8217;s what I finally found:</p>
<h3>For Windoze Whores:</h3>
<p><a href="http://support.microsoft.com/kb/284285">http://support.microsoft.com/kb/284285</a></p>
<h3>From the command line:</h3>
<p><code>openssl s_client -host localhost -port 443 -ssl2</code></p>
<p>Of course you can rotate through your protocols and examine the output.</p>
<p>*Sigh*&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hackadmin.com/2008/06/30/test-your-site-for-specific-ssl-version-support/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Net-SNMP Startup Issues and package updates.</title>
		<link>http://www.hackadmin.com/2008/04/16/net-snmp-startup-issues-and-package-updates/</link>
		<comments>http://www.hackadmin.com/2008/04/16/net-snmp-startup-issues-and-package-updates/#comments</comments>
		<pubDate>Wed, 16 Apr 2008 22:57:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Maintenance]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[Repair]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[centos 4.5]]></category>
		<category><![CDATA[error message]]></category>
		<category><![CDATA[net-snmp]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://www.hackadmin.com/2008/04/16/net-snmp-startup-issues-and-package-updates/</guid>
		<description><![CDATA[I ran into an issue the other day installing net-snmp-utils via yum on a CentOS 4.5  box and it just happened to me again.  This time however, I didn&#8217;t install the net-snmp-utils, it was from the original load of net-snmp.  Basically, I typically just do a:
yum -y install net-snmp
Then copy over my [...]]]></description>
			<content:encoded><![CDATA[<p>I ran into an issue the other day installing net-snmp-utils via yum on a CentOS 4.5  box and it just happened to me again.  This time however, I didn&#8217;t install the net-snmp-utils, it was from the original load of net-snmp.  Basically, I typically just do a:</p>
<p>yum -y install net-snmp</p>
<p>Then copy over my default snmpd.conf file and fire it up.</p>
<p>In these instances however, snmpd either refused to start or gave the following error in /var/log/messages:</p>
<p><span id="more-6"></span><code>Apr 16 18:14:35 msx-db01 kernel: audit(1208384075.250:6): avc:  denied  { read } for  pid=27712 comm="snmpd" name="snmpd.conf" dev=sda3 ino=7241736 scontext=root:system_r:snmpd_t tcontext=root:object_r:tmp_t tclass=file<br />
Apr 16 18:14:35 msx-db01 kernel: audit(1208384075.265:7): avc:  denied  { read } for  pid=27712 comm="snmpd" name="snmpd.conf" dev=sda3 ino=7241736 scontext=root:system_r:snmpd_t tcontext=root:object_r:tmp_t tclass=file<br />
Apr 16 18:14:35 msx-db01 snmpd[27712]: Warning: no access control information configured.   It's unlikely this agent can serve any useful purpose in this state.   Run "snmpconf -g basic_setup" to help you configure the snmpd.conf file for this agent.<br />
Apr 16 18:14:35 msx-db01 snmpd[27712]: NET-SNMP version 5.1.2<br />
</code></p>
<p>I tried to use snmpconf as suggested even though I knew my snmpd.conf file was fine.  snmpconf was not on the system so I didn&#8217;t waste any time trying to find out how to get it.</p>
<p>So the fix is to install the net-snmp-libs package, not sure what it updates but it works.</p>
<p><code>yum -y install net-snmp-libs</code></p>
<p>The catch after that is (at least in all 3 of my situations) the following error on the yum install:</p>
<p><code>Transaction Check Error:   file /usr/share/man/man8/ext2online.8.gz from install of e2fsprogs-1.35-12.11.el4_6.1 conflicts with file from package e2fsprogs-1.35-12.4.EL4</code></p>
<p>So, back to the hack admin package manager of choice *yum* :</p>
<p><code>yum update e2fsprogs</code></p>
<p>Once it&#8217;s updated, the net-snmp-libs goes in as expected.</p>
<p>So what&#8217;s the deal with all this?  I dunno, what the hell do utilities for ext2 have to do with my ability to run snmp monitoring?  Who gives a shit and if you know, you&#8217;re probably on the wrong site.  At any rate, my monitoring works and I&#8217;ll leave the rest to the server fairies.</p>
<p>Moral of the story: If your shit works, do you really need to understand it?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hackadmin.com/2008/04/16/net-snmp-startup-issues-and-package-updates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
