<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Jesin's Blog</title>
	
	<link>http://jesin.tk</link>
	<description>Welcome to the Portal of Technology</description>
	<lastBuildDate>Sat, 14 Jan 2012 07:48:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/jesinsblog" /><feedburner:info uri="jesinsblog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>jesinsblog</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>How to recover a Cisco device password</title>
		<link>http://feedproxy.google.com/~r/jesinsblog/~3/8DBNxP6mmAo/</link>
		<comments>http://jesin.tk/how-to-recover-a-cisco-device-password/#comments</comments>
		<pubDate>Sat, 14 Jan 2012 07:48:38 +0000</pubDate>
		<dc:creator>A.Jesin</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[cisco]]></category>

		<guid isPermaLink="false">http://jesin.tk/?p=1389</guid>
		<description><![CDATA[Even if you forget your Cisco device (read router or switch) password you can recover it by following the steps outlined in this article. This includes enable passwords, secret passwords, telnet, SSH and console passwords. This process involves changing the configuration register of your Cisco device so that it ignores the NVRAM contents and loads [...]]]></description>
			<content:encoded><![CDATA[<p>Even if you forget your Cisco device (read router or switch) password you can recover it by following the steps outlined in this article. This includes enable passwords, secret passwords, telnet, SSH and console passwords. This process involves changing the configuration register of your Cisco device so that it ignores the NVRAM contents and loads the default configuration. For this process you have to get into the ROM monitor mode so you need to have serial console access to the Cisco switch/router.<span id="more-1389"></span></p>
<h2>Enter into ROM monitor mode</h2>
<p>When the router boots interrupt the boot sequence by pressing [CTRL] + [BREAK] and you should see something like this</p>
<p><code class="source-code">Self decompressing the image :<br />
##############<br />
monitor: command "boot" aborted due to user interrupt<br />
rommon 1 &gt;</code></p>
<p>Now we&#8217;re inside the ROM monitor mode.</p>
<h2>Change the configuration register</h2>
<p>Change the configuration register to 0&#215;2142 so that the device ignores the NVRAM contents and reboot it.</p>
<p><code class="source-code">rommon 1 &gt; confreg 0x2142<br />
rommon 2 &gt; reset</code></p>
<h2>Copy the startup configuration</h2>
<p>After the device reboots the running configuration doesn&#8217;t have anything but the bare minimal settings. Now you should copy the startup configuration so that you can modify the password in it.</p>
<p><code class="source-code">Router&gt;enable<br />
Router#copy startup-config running-config</code></p>
<h2>Reset the required password</h2>
<p>Enter the command to reset the password you forgot. If you used local authentication</p>
<p><code class="source-code">R0(config)#username jesin secret passwd</code></p>
<p>The above command will reset the password of the user &#8220;jesin&#8221;, if such a user doesn&#8217;t exist a new user is created by that name.</p>
<h3>To reset an enable password or secret</h3>
<p><code class="source-code">R0(config)#enable password newpwd<br />
R0(config)#enable secret newpwd</code></p>
<h3>Reset a console password</h3>
<p><code class="source-code">Router(config)#line console 0<br />
Router(config-line)#password newconsolepw</code></p>
<h3>Reset a telnet password</h3>
<p><code class="source-code">Router(config)#line vty 0 4<br />
Router(config-line)#password newtelnetpw</code></p>
<h2>Save the running configuration</h2>
<p>Make sure the changes made to the passwords are saved in the running configuration</p>
<p><code class="source-code">Router#copy running-config startup-config</code></p>
<h2>Reset the Configuration Register and reload</h2>
<p>Now that the work is over reset the configuration register to its original value</p>
<p><code class="source-code">Router(config)#config-register 0x2102</code></p>
<p>Now reboot the Cisco device.</p>
<img src="http://feeds.feedburner.com/~r/jesinsblog/~4/8DBNxP6mmAo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://jesin.tk/how-to-recover-a-cisco-device-password/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://jesin.tk/how-to-recover-a-cisco-device-password/</feedburner:origLink></item>
		<item>
		<title>How to Configure a Cisco router as a Frame Relay Switch</title>
		<link>http://feedproxy.google.com/~r/jesinsblog/~3/eqBFrfMoGB8/</link>
		<comments>http://jesin.tk/how-to-configure-cisco-router-as-frame-relay-switch/#comments</comments>
		<pubDate>Sun, 18 Dec 2011 08:18:01 +0000</pubDate>
		<dc:creator>A.Jesin</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[cisco]]></category>
		<category><![CDATA[frame relay]]></category>

		<guid isPermaLink="false">http://jesin.tk/?p=1380</guid>
		<description><![CDATA[Frame relay is a WAN technology that uses packet switching methodology for communication. A frame relay switch is required for configuring a frame relay network. The previous article on Configuring Frame Relay on Cisco Packet Tracer explains it on a simulator, in this article I&#8217;ll show how a Cisco router can be used as a [...]]]></description>
			<content:encoded><![CDATA[<p>Frame relay is a WAN technology that uses packet switching methodology for communication. A frame relay switch is required for configuring a frame relay network. The previous article on <a title="How to configure frame relay in Cisco Packet Tracer" href="http://jesin.tk/how-to-configure-frame-relay-in-cisco-packet-tracer/">Configuring Frame Relay on Cisco Packet Tracer</a> explains it on a simulator, in this article I&#8217;ll show how a Cisco router can be used as a frame relay switch. The same hub and spoke topology is used, only the Frame Relay switch router configuration is explained here refer the previous article for the Hub router and spoke routers configuration instructions.<span id="more-1380"></span></p>
<p>The Hub and Spoke network topology is shown below</p>
<div id="attachment_1381" class="wp-caption aligncenter" style="width: 310px"><a href="http://jesin.tk/wp-content/uploads/2011/12/frame-relay-switching-tutorial-topology.png"><img class="size-medium wp-image-1381" title="Hub and Spoke topology" src="http://jesin.tk/wp-content/uploads/2011/12/frame-relay-switching-tutorial-topology-300x129.png" alt="frame relay-switching tutorial topology" width="300" height="129" /></a><p class="wp-caption-text">Only the FrameRelaySwtich configuratiuon will be explained in this article</p></div>
<p>As noted above the Hub and Spoke routers are DTEs and the FrameRelaySwitch Router is DCE. The commands are as follows</p>
<p><code class="source-code">FrameRelaySwitch&gt;enable<br />
FrameRelaySwitch#configure terminal<br />
FrameRelaySwitch(config)#frame-relay switching</code></p>
<p><code class="source-code">FrameRelaySwitch(config)#interface serial 0/0<br />
FrameRelaySwitch(config-if)#encapsulation frame-relay<br />
FrameRelaySwitch(config-if)#frame-relay intf-type dce<br />
FrameRelaySwitch(config-if)#clock rate 56000<br />
FrameRelaySwitch(config-if)#frame-relay route 102 interface serial 0/1 201<br />
FrameRelaySwitch(config-if)#frame-relay route 103 interface serial 0/2 301<br />
FrameRelaySwitch(config-if)#no shutdown<br />
FrameRelaySwitch(config-if)#exit</code></p>
<p><code class="source-code">FrameRelaySwitch(config)#interface serial 0/1<br />
FrameRelaySwitch(config-if)#encapsulation frame-relay<br />
FrameRelaySwitch(config-if)#frame-relay intf-type dce<br />
FrameRelaySwitch(config-if)#clock rate 56000<br />
FrameRelaySwitch(config-if)#frame-relay route 201 interface serial 0/0 102<br />
FrameRelaySwitch(config-if)#no shutdown<br />
FrameRelaySwitch(config-if)#exit</code></p>
<p><code class="source-code">FrameRelaySwitch(config)#interface serial 0/2<br />
FrameRelaySwitch(config-if)#encapsulation frame-relay<br />
FrameRelaySwitch(config-if)#frame-relay intf-type dce<br />
FrameRelaySwitch(config-if)#clock rate 56000<br />
FrameRelaySwitch(config-if)#frame-relay route 301 interface serial 0/0 103<br />
FrameRelaySwitch(config-if)#no shutdown<br />
FrameRelaySwitch(config-if)#exit</code></p>
<p>Now check the frame relay route by typing the following command in the privilege mode</p>
<p><code class="source-code">FrameRelaySwitch#show frame-relay route</code></p>
<p>The following table is displayed</p>
<table width="515">
<tbody>
<tr>
<th class="sectiontableheader">Input Intf</th>
<th class="sectiontableheader">Input Dlci</th>
<th class="sectiontableheader">Output Intf</th>
<th class="sectiontableheader">Output Dlci</th>
<th class="sectiontableheader">Status</th>
</tr>
<tr>
<td class="sectiontableentry0">Serial0/0</td>
<td class="sectiontableentry0">102</td>
<td class="sectiontableentry0">Serial0/1</td>
<td class="sectiontableentry0">201</td>
<td class="sectiontableentry0">active</td>
</tr>
<tr>
<td class="sectiontableentry0">Serial0/0</td>
<td class="sectiontableentry0">103</td>
<td class="sectiontableentry0">Serial0/2</td>
<td class="sectiontableentry0">301</td>
<td class="sectiontableentry0">active</td>
</tr>
<tr>
<td class="sectiontableentry0">Serial0/1</td>
<td class="sectiontableentry0">201</td>
<td class="sectiontableentry0">Serial0/0</td>
<td class="sectiontableentry0">102</td>
<td class="sectiontableentry0">active</td>
</tr>
<tr>
<td class="sectiontableentry0">Serial0/2</td>
<td class="sectiontableentry0">301</td>
<td class="sectiontableentry0">Serial0/0</td>
<td class="sectiontableentry0">103</td>
<td class="sectiontableentry0">active</td>
</tr>
</tbody>
</table>
<p>Initially the status is shown as inactive because the Hub and Spoke routers are yet to be configured, after configuration the status must be active. Configure the Hub and Spoke routers as outlined in the <a title="How to configure frame relay in Cisco Packet Tracer" href="http://jesin.tk/how-to-configure-frame-relay-in-cisco-packet-tracer/">previous article</a>.</p>
<img src="http://feeds.feedburner.com/~r/jesinsblog/~4/eqBFrfMoGB8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://jesin.tk/how-to-configure-cisco-router-as-frame-relay-switch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://jesin.tk/how-to-configure-cisco-router-as-frame-relay-switch/</feedburner:origLink></item>
		<item>
		<title>How to configure frame relay in Cisco Packet Tracer</title>
		<link>http://feedproxy.google.com/~r/jesinsblog/~3/_IXlYw9GJBo/</link>
		<comments>http://jesin.tk/how-to-configure-frame-relay-in-cisco-packet-tracer/#comments</comments>
		<pubDate>Sun, 04 Dec 2011 14:40:03 +0000</pubDate>
		<dc:creator>A.Jesin</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[cisco]]></category>
		<category><![CDATA[frame relay]]></category>

		<guid isPermaLink="false">http://jesin.tk/?p=1368</guid>
		<description><![CDATA[This article will explain frame relay configuration in Cisco Packet Tracer. Frame relay is a WAN technology. Read the Wikipedia article to learn more about Frame Relay. You can also try this on live routers and other network simulators, but the frame relay switch configuration varies. The setup here will use the hub and spoke [...]]]></description>
			<content:encoded><![CDATA[<p>This article will explain frame relay configuration in Cisco Packet Tracer. Frame relay is a WAN technology. Read the <a href="http://en.wikipedia.org/wiki/Frame_Relay" rel="external nofollow" target="_blank">Wikipedia</a> article to learn more about Frame Relay. You can also try this on live routers and other network simulators, but the frame relay switch configuration varies. The setup here will use the <strong>hub and spoke configuration</strong>, Router0 is the hub, Router1 and Router2 are the spokes. <strong>Point-to-Point subinterfaces</strong> are created and PVCs (Permanent Virtual Circuits) are established between Router0 and Router1 and Router0 and Router2. So the Spoke routers communicate via Router0.<span id="more-1368"></span></p>
<p>The topology of this lab is shown below</p>
<p><a href="http://jesin.tk/wp-content/uploads/2011/12/cisco-frame-relay-topology.png"><img class="aligncenter size-medium wp-image-1374" title="Cisco Frame Relay Topology" src="http://jesin.tk/wp-content/uploads/2011/12/cisco-frame-relay-topology-300x133.png" alt="cisco frame relay topology" width="300" height="133" /></a></p>
<p>The DCE end of the serial cable should be connected to the frame relay switch.</p>
<h3>Frame Relay Switch Configuration</h3>
<p>Configure the serial interfaces of the Frame Relay switch as follows</p>
<p><span style="text-decoration: underline;"><strong>Serial0</strong></span></p>
<table>
<tbody>
<tr>
<th class="sectiontableheader" style="padding: 10px;">DLCI</th>
<th class="sectiontableheader" style="padding: 10px;">Name</th>
</tr>
<tr>
<td class="sectiontableentry0">102</td>
<td class="sectiontableentry0">R0-R1</td>
</tr>
<tr>
<td class="sectiontableentry0">103</td>
<td class="sectiontableentry0">R0-R2</td>
</tr>
</tbody>
</table>
<p><span style="text-decoration: underline;"><strong>Serial1</strong></span></p>
<table>
<tbody>
<tr>
<th class="sectiontableheader" style="padding: 10px;">DLCI</th>
<th class="sectiontableheader" style="padding: 10px;">Name</th>
</tr>
<tr>
<td class="sectiontableentry0">201</td>
<td class="sectiontableentry0">R1-R0</td>
</tr>
</tbody>
</table>
<p><span style="text-decoration: underline;"><strong>Serial2</strong></span></p>
<table>
<tbody>
<tr>
<th class="sectiontableheader" style="padding: 10px;">DLCI</th>
<th class="sectiontableheader" style="padding: 10px;">Name</th>
</tr>
<tr>
<td class="sectiontableentry0">301</td>
<td class="sectiontableentry0">R2-R0</td>
</tr>
</tbody>
</table>
<p>Select the frame relay tab and create the following links</p>
<table>
<tbody>
<tr>
<th class="sectiontableheader" style="padding: 10px;">From Port</th>
<th class="sectiontableheader" style="padding: 10px;">Sublink</th>
<th class="sectiontableheader" style="padding: 10px;">To Port</th>
<th class="sectiontableheader" style="padding: 10px;">Sublink</th>
</tr>
<tr>
<td class="sectiontableentry0">Serial0</td>
<td class="sectiontableentry0">R0-R1</td>
<td class="sectiontableentry0">Serial1</td>
<td class="sectiontableentry0">R1-R0</td>
</tr>
<tr>
<td class="sectiontableentry0">Serial0</td>
<td class="sectiontableentry0">R0-R2</td>
<td class="sectiontableentry0">Serial2</td>
<td class="sectiontableentry0">R2-R0</td>
</tr>
</tbody>
</table>
<h3>Configure the routers</h3>
<p>The configuration of each router is shown below</p>
<p><span style="text-decoration: underline;">Router0 (Hub)</span></p>
<p><code class="source-code">R0&gt;enable<br />
R0#configure terminal<br />
R0(config)#interface Serial 2/0<br />
R0(config-if)#no shutdown<br />
R0(config-if)#encapsulation frame-relay<br />
R0(config-if)#exit<br />
R0(config)#interface Serial 2/0.102 point-to-point<br />
R0(config-subif)#ip address 1.1.1.1 255.255.255.252<br />
R0(config-subif)#frame-relay interface-dlci 102<br />
R0(config-subif)#exit<br />
R0(config)#interface Serial 2/0.103 point-to-point<br />
R0(config-subif)#ip address 1.1.1.5 255.255.255.252<br />
R0(config-subif)#frame-relay interface-dlci 103</code></p>
<p><span style="text-decoration: underline;">Router1 (Spoke)</span></p>
<p><code class="source-code">R1&gt;enable<br />
R1#configure terminal<br />
R1(config)#interface Serial 2/0<br />
R1(config-if)#no shutdown<br />
R1(config-if)#encapsulation frame-relay<br />
R1(config-if)#exit<br />
R1(config)#interface Serial 2/0.201 point-to-point<br />
R1(config-subif)#ip address 1.1.1.2 255.255.255.252<br />
R1(config-subif)#frame-relay interface<br />
R1(config-subif)#frame-relay interface-dlci 201</code></p>
<p><span style="text-decoration: underline;">Router2 (Spoke)</span></p>
<p><code class="source-code">R2&gt;enable<br />
R2#configure terminal<br />
R2(config)#interface Serial 2/0<br />
R2(config-if)#no shutdown<br />
R2(config-if)#encapsulation frame-relay<br />
R2(config-if)#exit<br />
R2(config)#interface Serial 2/0.301 point-to-point<br />
R2(config-subif)#ip address 1.1.1.6 255.255.255.252<br />
R2(config-subif)#frame-relay interface-dlci 301</code></p>
<h3>Configure routing on the spoke routers</h3>
<p>Unless routing is configured the spoke routers cannot communicate among themselves. You can use any routing protocols. For this tutorial I will use static routing</p>
<p><span style="text-decoration: underline;">Router1</span></p>
<p><code class="source-code">R1(config)#ip route 1.1.1.4 255.255.255.252 1.1.1.1</code></p>
<p><span style="text-decoration: underline;">Router2</span></p>
<p><code class="source-code">R2(config)#ip route 1.1.1.0 255.255.255.252 1.1.1.5</code></p>
<p>Ping the routers to test connectivity among themselves.</p>
<img src="http://feeds.feedburner.com/~r/jesinsblog/~4/_IXlYw9GJBo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://jesin.tk/how-to-configure-frame-relay-in-cisco-packet-tracer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://jesin.tk/how-to-configure-frame-relay-in-cisco-packet-tracer/</feedburner:origLink></item>
		<item>
		<title>How to configure a Linux PPTP VPN client</title>
		<link>http://feedproxy.google.com/~r/jesinsblog/~3/GMjIvpcfSnw/</link>
		<comments>http://jesin.tk/how-to-configure-a-linux-pptp-vpn-client/#comments</comments>
		<pubDate>Sun, 27 Nov 2011 08:28:13 +0000</pubDate>
		<dc:creator>A.Jesin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[vpn]]></category>

		<guid isPermaLink="false">http://jesin.tk/?p=1363</guid>
		<description><![CDATA[Configuring a VPN client connection is a simple matter of point and click in Windows OSes, but in Linux it is involves installing a package, configuring passwords, VPN server settings and finally routing the traffic destined for the VPN network via the VPN connection. The package named pptp is used on the client side for [...]]]></description>
			<content:encoded><![CDATA[<p>Configuring a VPN client connection is a simple matter of point and click in Windows OSes, but in Linux it is involves installing a package, configuring passwords, VPN server settings and finally routing the traffic destined for the VPN network via the VPN connection. The package named pptp is used on the client side for configuring a connection. To setup a VPN server read <a href="http://jesin.tk/how-to-setup-a-vpn-server-in-windows-server-2008/"> How to setup a VPN Server in Windows Server 2008</a>. This tutorial is for both Debian Linux variants and Red Hat Linux variants.<span id="more-1363"></span></p>
<h3>Fedora/Red Hat/CentOS PPTP Client Installation</h3>
<p>Install the pptp client</p>
<p><code class="source-code">yum install pptp</code></p>
<h3>Debian/Ubuntu PPTP Client Installation</h3>
<p>Use the apt-get command</p>
<p><code class="source-code">apt-get install pptp-linux</code></p>
<h3>Configuring VPN credentials and server settings</h3>
<p>Edit the following file and enter your VPN username and password</p>
<p><code class="source-code">vi /etc/ppp/chap-secrets</code></p>
<p>The syntax of the file is as follows</p>
<p><code class="source-code">DOMAIN\\username      PPTP      vpnpassword     *</code></p>
<p>For example to configure a user named jesin on example.com with pass1 as the password enter</p>
<p><code class="source-code">EXAMPLE\\jesin        PPTP      pass1           *</code></p>
<p>If your VPN network doesn&#8217;t come under a domain replace DOMAIN with your VPNSERVER name.</p>
<p>Next is to configure the VPN server settings. Create and edit a new file under the peers directory</p>
<p><code class="source-code">vi /etc/ppp/peers/vpnconnection1</code></p>
<p>Add content according to the syntax below</p>
<p><code class="source-code">pty "pptp vpn-server-hostname-or-ip-address --nolaunchpppd"<br />
name DOMAIN\\username<br />
remotename PPTP<br />
require-mppe-128<br />
file /etc/ppp/options.pptp<br />
ipparam vpnconnection1</code></p>
<p>Here &#8220;DOMAIN\\username&#8221; is the same as the one entered in the chap-secrets file. The ipparam should contain the name of the newly created file, in this case it is &#8220;vpnconnection1&#8243;</p>
<h3>Adding a route to the routing table</h3>
<p>All traffic for the VPN network should pass through the VPN interface so an entry has to be added to the routing table. To automatically add an entry whenever a VPN connection is established create and edit the following file</p>
<p><code class="source-code">vi /etc/ppp/ip-up.d/vpn1-route</code></p>
<p>Add the following content</p>
<p><code class="source-code">#!/bin/bash<br />
route add -net 10.0.0.0/8 dev ppp0</code></p>
<p>Make the file executable</p>
<p><code class="source-code">chmod +x /etc/ppp/ip-up.d/vpn1-route</code></p>
<h3>Testing the connection</h3>
<p>To connect using the newly created VPN connection use the following command</p>
<p><code class="source-code">pppd call vpnconnection1</code></p>
<p>Take a peek into the messages log file using the following command</p>
<p><code class="source-code">tail -f /var/log/messages</code></p>
<p>you should see something similar to this</p>
<p><code class="source-code">Nov 27 13:46:20 server1 kernel: [ 800.071028] PPP generic driver version 2.4.2<br />
Nov 27 13:46:20 server1 pppd[1083]: pppd 2.4.5 started by root, uid 0<br />
Nov 27 13:46:20 server1 pppd[1083]: Using interface ppp0<br />
Nov 27 13:46:20 server1 pppd[1083]: Connect: ppp0 /dev/pts/0<br />
Nov 27 13:46:25 server1 pppd[1083]: CHAP authentication succeeded<br />
Nov 27 13:46:25 server1 kernel: [ 804.683790] padlock: VIA PadLock Hash Engine not detected.<br />
Nov 27 13:46:25 server1 kernel: [ 804.687408] PPP MPPE Compression module registered<br />
Nov 27 13:46:25 server1 pppd[1083]: MPPE 128-bit stateless compression enabled<br />
Nov 27 13:46:26 server1 pppd[1083]: local IP address 10.0.0.11<br />
Nov 27 13:46:26 server1 pppd[1083]: remote IP address 10.0.0.12</code></p>
<p>Try pinging a system in the VPN network and you should get proper replies.</p>
<h3>Disconnecting the connection</h3>
<p>To disconnect the PPTP VPN connection use the killall command</p>
<p><code class="source-code">killall pppd</code></p>
<img src="http://feeds.feedburner.com/~r/jesinsblog/~4/GMjIvpcfSnw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://jesin.tk/how-to-configure-a-linux-pptp-vpn-client/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://jesin.tk/how-to-configure-a-linux-pptp-vpn-client/</feedburner:origLink></item>
		<item>
		<title>How to setup a VPN Server in Windows Server 2008</title>
		<link>http://feedproxy.google.com/~r/jesinsblog/~3/Aa9tvWB8UWQ/</link>
		<comments>http://jesin.tk/how-to-setup-a-vpn-server-in-windows-server-2008/#comments</comments>
		<pubDate>Sun, 20 Nov 2011 16:01:45 +0000</pubDate>
		<dc:creator>A.Jesin</dc:creator>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[vpn]]></category>
		<category><![CDATA[windows server]]></category>

		<guid isPermaLink="false">http://jesin.tk/?p=1340</guid>
		<description><![CDATA[This article will explain the procedure for setting up a VPN server in Windows Server 2008. The VPN protocol used will be PPTP (Point to Point Tunneling Protocol). The method outlined here uses an environment consisting of an active directory server, a DHCP server, few workstation PCs and a VPN server. Configuration of the VPN [...]]]></description>
			<content:encoded><![CDATA[<p>This article will explain the procedure for setting up a VPN server in Windows Server 2008. The VPN protocol used will be PPTP (Point to Point Tunneling Protocol). The method outlined here uses an environment consisting of an active directory server, a DHCP server, few workstation PCs and a VPN server. Configuration of the VPN server alone is explained in the following steps</p>
<ol>
<li><a href="http://jesin.tk/how-to-setup-a-vpn-server-in-windows-server-2008#step1">Configure IP addresses on the VPN server</a></li>
<li><a href="http://jesin.tk/how-to-setup-a-vpn-server-in-windows-server-2008#step2">Join the VPN server to the domain</a></li>
<li><a href="http://jesin.tk/how-to-setup-a-vpn-server-in-windows-server-2008#step3">Install Network Policy and Access Server Role</a></li>
<li><a href="http://jesin.tk/how-to-setup-a-vpn-server-in-windows-server-2008#step4">Configure Routing and Remote Access</a></li>
<li><a href="http://jesin.tk/how-to-setup-a-vpn-server-in-windows-server-2008#step5">Allow users to login via VPN</a></li>
<li><a href="http://jesin.tk/how-to-setup-a-vpn-server-in-windows-server-2008#step6">Setup a VPN connection on the remote client PC</a></li>
</ol>
<p><span id="more-1340"></span></p>
<p>The network topology used in this setup is shown below</p>
<p><a href="http://jesin.tk/wp-content/uploads/2011/11/win2008_vpn_setup_topology.png"><img class="aligncenter size-medium wp-image-1341" title="Network Topology VPN setup Windows Server 2008" src="http://jesin.tk/wp-content/uploads/2011/11/win2008_vpn_setup_topology-300x129.png" alt="win2008 vpn setup topology" width="300" height="129" /></a></p>
<h2 id="step1">Configure IP addresses on the VPN Server</h2>
<p>The VPN server will have two interfaces, private and public with the following IP configuration</p>
<p>private<br />
IP address &#8211; 10.0.0.1<br />
Subnet Mask &#8211; 255.0.0.0<br />
Preferred DNS &#8211; 10.0.0.2 (Assuming DNS runs on the Active Directory Server)</p>
<p>public<br />
Obtain the public IP information from your ISP (Internet Service Provider)</p>
<h2 id="step2">Join the VPN server to the domain</h2>
<p>Right Click <em>computer -&gt; Properties -&gt; Change Settings -&gt; Change -&gt; Select Domain</em> and enter your domain name you&#8217;ll be asked for credentials enter them also and reboot.</p>
<p><a href="http://jesin.tk/wp-content/uploads/2011/11/join_vpn_server_to_domain.png"><img class="aligncenter size-medium wp-image-1342" title="Joining the VPN server to the domain" src="http://jesin.tk/wp-content/uploads/2011/11/join_vpn_server_to_domain-253x300.png" alt="join vpn server to domain" width="253" height="300" /></a></p>
<h2 id="step3">Install Network Policy and Access Server Role</h2>
<p>Login to the VPN server as the administrator, go to <em>Start -&gt; Administrative Tools -&gt; Server Manager</em>. Click Add Roles and Check &#8220;Network Policy and Access Server&#8221;</p>
<p><a href="http://jesin.tk/wp-content/uploads/2011/11/select_network_policy_and_access_server_role.png"><img class="aligncenter size-medium wp-image-1343" title="select network policy and access server role" src="http://jesin.tk/wp-content/uploads/2011/11/select_network_policy_and_access_server_role-300x223.png" alt="select network policy and access server role" width="300" height="223" /></a></p>
<p>In the role services section check &#8220;Routing and Remote Access&#8221;</p>
<p><a href="http://jesin.tk/wp-content/uploads/2011/11/select_network_policy_and_access_server_role_services.png"><img class="aligncenter size-medium wp-image-1344" title="select network policy and access server role services" src="http://jesin.tk/wp-content/uploads/2011/11/select_network_policy_and_access_server_role_services-300x224.png" alt="select network policy and access server role services" width="300" height="224" /></a></p>
<p>Confirm your selections and install.</p>
<h2 id="step4">Configure Routing and Remote Access</h2>
<p>After installation Go to <em>Start -&gt; Run and type rrasmgmt.msc</em>. In the console that opens right click your server name and click &#8220;Configure and Enable Routing and Remote Access&#8221;</p>
<p><a href="http://jesin.tk/wp-content/uploads/2011/11/configure_rras.png"><img class="aligncenter size-medium wp-image-1345" title="Configure and Enable Routing and Remote Access" src="http://jesin.tk/wp-content/uploads/2011/11/configure_rras-300x223.png" alt="Configure and Enable Routing and Remote Access" width="300" height="223" /></a></p>
<p>In the Wizard that appears click Next and Select Custom Configuration</p>
<p><a href="http://jesin.tk/wp-content/uploads/2011/11/rras_custom_configuration.png"><img class="aligncenter size-medium wp-image-1346" title="rras custom configuration" src="http://jesin.tk/wp-content/uploads/2011/11/rras_custom_configuration-300x246.png" alt="rras custom configuration" width="300" height="246" /></a></p>
<p>Select the Check Box VPN access</p>
<p><a href="http://jesin.tk/wp-content/uploads/2011/11/rras_vpn_access.png"><img class="aligncenter size-medium wp-image-1347" title="rras vpn access" src="http://jesin.tk/wp-content/uploads/2011/11/rras_vpn_access-300x246.png" alt="rras vpn access" width="300" height="246" /></a></p>
<p>Click <em>Next -&gt; Finish</em>. In the message box that appears click &#8220;Start Service&#8221;. If you have a DHCP server configured in the network in the same subnet you can go ahead with the final step.</p>
<p>Networks which have a DHCP server in a different subnet, should have the DHCP relay agent configured. <em>Expand IPv4 -&gt; right click DHCP relay agent</em> and go to <em>properties</em></p>
<p><a href="http://jesin.tk/wp-content/uploads/2011/11/dhcp_relay_agent_properties.png"><img class="aligncenter size-medium wp-image-1348" title="DHCP relay agent properties" src="http://jesin.tk/wp-content/uploads/2011/11/dhcp_relay_agent_properties-250x300.png" alt="dhcp relay agent properties" width="250" height="300" /></a></p>
<p>In the window that appears enter the IP address of the DHCP server. The appropriate DHCP scope should be configured in the DHCP server.</p>
<p>If your network doesn&#8217;t have a DHCP server the VPN server itself can assign IP addresses to VPN clients. Right click your <em>Server name -&gt; properties -&gt; IPv4 tab -&gt; select &#8220;static address pool&#8221; -&gt; click Add</em>. Enter the start and end IP ranges.</p>
<p><a href="http://jesin.tk/wp-content/uploads/2011/11/rras_static_address_pool.png"><img class="aligncenter size-medium wp-image-1349" title="RRAS static address pool" src="http://jesin.tk/wp-content/uploads/2011/11/rras_static_address_pool-230x300.png" alt="RRAS static address pool" width="230" height="300" /></a></p>
<h2 id="step5">Allow users to login via VPN</h2>
<p>On the Active Directory Server go to <em>Start -&gt; Administrative Tools -&gt; Active Directory Users and Computers -&gt; Right Click the properties of an user -&gt; Dial-In tab and click &#8220;Allow access&#8221;</em></p>
<p><a href="http://jesin.tk/wp-content/uploads/2011/11/dialin_permissiion.png"><img class="aligncenter size-medium wp-image-1353" title="dialin permissiion" src="http://jesin.tk/wp-content/uploads/2011/11/dialin_permissiion-240x300.png" alt="dialin permissiion" width="240" height="300" /></a></p>
<h2 id="step6">Setup a VPN connection on the remote client PC</h2>
<p>On the VPN client PC go to <em>start -&gt; Run and type ncpa.cpl</em>, open &#8220;New Connection Wizard&#8221;, in the wizard that appears click next and select &#8220;Connect to the network at my workplace&#8221;</p>
<p><a href="http://jesin.tk/wp-content/uploads/2011/11/vpn_connection_setup.png"><img class="aligncenter size-medium wp-image-1350" title="vpn connection setup step1" src="http://jesin.tk/wp-content/uploads/2011/11/vpn_connection_setup-300x227.png" alt="vpn connection setup step1" width="300" height="227" /></a></p>
<p>In the next step select Virtual Private Network Connection.</p>
<p><a href="http://jesin.tk/wp-content/uploads/2011/11/vpn_connection_setup_step2.png"><img class="aligncenter size-medium wp-image-1351" title="vpn connection setup step2" src="http://jesin.tk/wp-content/uploads/2011/11/vpn_connection_setup_step2-300x228.png" alt="vpn connection setup step2" width="300" height="228" /></a></p>
<p>Enter a company name which is used to name the connection and in the final step enter the IP address of the PUBLIC IP address of the VPN server. After the connection is created enter the username and password of a user in the active directory database and click connect.</p>
<p><a href="http://jesin.tk/wp-content/uploads/2011/11/vpn_connection_credentials.png"><img class="aligncenter size-medium wp-image-1352" title="VPN connection credentials" src="http://jesin.tk/wp-content/uploads/2011/11/vpn_connection_credentials-285x300.png" alt="vpn connection credentials" width="285" height="300" /></a></p>
<img src="http://feeds.feedburner.com/~r/jesinsblog/~4/Aa9tvWB8UWQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://jesin.tk/how-to-setup-a-vpn-server-in-windows-server-2008/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://jesin.tk/how-to-setup-a-vpn-server-in-windows-server-2008/</feedburner:origLink></item>
		<item>
		<title>How to create a horizontal drop down menu in CSS</title>
		<link>http://feedproxy.google.com/~r/jesinsblog/~3/KpJZLS0GK7s/</link>
		<comments>http://jesin.tk/how-to-create-a-horizontal-drop-down-menu-in-css/#comments</comments>
		<pubDate>Wed, 02 Nov 2011 16:41:57 +0000</pubDate>
		<dc:creator>A.Jesin</dc:creator>
				<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>

		<guid isPermaLink="false">http://jesin.tk/?p=1334</guid>
		<description><![CDATA[Its been a long time since I wrote an article in this category (Web Design) so I decided to write an article on creating a horizontal drop down menu purely with HTML and CSS. To create a simple menu see CSS Horizontal Navigation Menu. Since the horizontal drop down menu uses only CSS and HTML [...]]]></description>
			<content:encoded><![CDATA[<p>Its been a long time since I wrote an article in this category (<a href="http://jesin.tk/category/web-design/">Web Design</a>) so I decided to write an article on creating a horizontal drop down menu purely with HTML and CSS. To create a simple menu see <a title="CSS Horizontal Navigation Menu" href="http://jesin.tk/css-horizontal-navigation-menu/">CSS Horizontal Navigation Menu</a>. Since the horizontal drop down menu uses only CSS and HTML it doesn&#8217;t work with Internet Explorer 6. The whole drop down menu concept makes use of the CSS pseudo class :hover, when you place the mouse pointer over a parent menu the CSS &#8220;display&#8221; attribute changes to &#8220;block&#8221; and displays the drop down menu, when you move the mouse pointer away from the menu the &#8220;display&#8221; attribute changes to &#8220;none&#8221; so the drop down menu disappears.<span id="more-1334"></span></p>
<p>Here is the entire code for a horizontal drop down menu</p>
<p><code class="source-code">&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;title&gt;CSS Menu&lt;/title&gt;<br />
&lt;style type="text/css"&gt;<br />
ul#navbar {<br />
list-style-type: none;<br />
margin: 0;<br />
padding: 0;<br />
}<br />
ul#navbar li {<br />
float: left;<br />
border: 1px solid black;<br />
text-align: center;<br />
}<br />
ul#navbar a {<br />
background-color: #CCC;<br />
color: #000;<br />
text-decoration: none;<br />
display: block;<br />
width: 120px;<br />
padding: 4px;<br />
}<br />
ul#navbar a:hover {<br />
background-color: #CFF;<br />
text-decoration: underline;<br />
}<br />
ul#navbar ul {<br />
display: none;<br />
list-style-type: none;<br />
}<br />
ul#navbar li:hover ul {<br />
display: block;<br />
position: absolute;<br />
margin: 0;<br />
padding: 0;<br />
}<br />
ul#navbar li:hover li {<br />
float: none;<br />
}<br />
&lt;/style&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;ul id="navbar"&gt;<br />
&lt;li&gt;&lt;a href="#"&gt;Home&lt;/a&gt;&lt;/li&gt;<br />
&lt;li&gt;&lt;a href="#"&gt;Parent 1&lt;/a&gt;<br />
&lt;ul&gt;<br />
&lt;li&gt;&lt;a href="#"&gt;Child 1&lt;/a&gt;&lt;/li&gt;<br />
&lt;li&gt;&lt;a href="#"&gt;Child 2&lt;/a&gt;&lt;/li&gt;<br />
&lt;li&gt;&lt;a href="#"&gt;Child 3&lt;/a&gt;&lt;/li&gt;<br />
&lt;/ul&gt;&lt;/li&gt;<br />
&lt;li&gt;&lt;a href="#"&gt;Parent 2&lt;/a&gt;<br />
&lt;ul&gt;<br />
&lt;li&gt;&lt;a href="#"&gt;Child 1&lt;/a&gt;&lt;/li&gt;<br />
&lt;li&gt;&lt;a href="#"&gt;Child 2&lt;/a&gt;&lt;/li&gt;<br />
&lt;li&gt;&lt;a href="#"&gt;Child 3&lt;/a&gt;&lt;/li&gt;<br />
&lt;/ul&gt;&lt;/li&gt;<br />
&lt;/ul&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</code></p>
<p>Notice the DOCTYPE declaration at the beginning, without this the code will not work in Internet Explorer. See a live demo</p>
<p><a style="font-size: 20px;" href="http://jesin.tk/wp-content/uploads/2011/11/css-horizontal-drop-down-menu.html">CSS Horizontal drop down menu DEMO</a></p>
<img src="http://feeds.feedburner.com/~r/jesinsblog/~4/KpJZLS0GK7s" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://jesin.tk/how-to-create-a-horizontal-drop-down-menu-in-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://jesin.tk/how-to-create-a-horizontal-drop-down-menu-in-css/</feedburner:origLink></item>
		<item>
		<title>How to setup an unmanaged Debian server</title>
		<link>http://feedproxy.google.com/~r/jesinsblog/~3/eYootjY9CMc/</link>
		<comments>http://jesin.tk/how-to-setup-an-unmanaged-debian-server/#comments</comments>
		<pubDate>Sun, 30 Oct 2011 17:12:47 +0000</pubDate>
		<dc:creator>A.Jesin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://jesin.tk/?p=1326</guid>
		<description><![CDATA[So you&#8217;ve bought a shiny new VPS or dedicated unmanaged server to cut costs on hosting but don&#8217;t know how to begin ? Read this post to make this easirer.  This tutorial will cover the instructions for a basic setup of a Debian unmanaged VPS or dedicated server. The following are covered in this article [...]]]></description>
			<content:encoded><![CDATA[<p>So you&#8217;ve bought a shiny new VPS or dedicated unmanaged server to cut costs on hosting but don&#8217;t know how to begin ? Read this post to make this easirer.  This tutorial will cover the instructions for a basic setup of a Debian unmanaged VPS or dedicated server. The following are covered in this article</p>
<ul>
<li>Configuring the Timezone</li>
<li>Selecting locales</li>
<li>Creating a sudo user</li>
<li>Securing SSH</li>
<li>Adding firewall rules</li>
</ul>
<p>The first task is to update the apt database and check if any installed packages can be upgraded.</p>
<p><code class="source-code">apt-get update &amp;&amp; apt-get upgrade</code></p>
<p><span id="more-1326"></span></p>
<h2>Configuring the Timezone</h2>
<p>The dpkg-reconfigure command is used to reconfigure the timezone</p>
<p><code class="source-code">dpkg-reconfigure tzdata</code></p>
<h2>Selecting locales</h2>
<p>The same dpkg-reconfigure is used to select the locales too.</p>
<p><code class="source-code">dpkg-reconfigure locales</code></p>
<h2>Creating a sudo user</h2>
<p>Using a production server as a root user is the most dangerous thing you can do. So create a normal user and add it to the list of sudoers.</p>
<p><code class="source-code">useradd --shell /bin/bash username<br />
passwd username<br />
visudo</code></p>
<p>Now add the following line to the end of this file</p>
<p><code class="source-code">username ALL=(ALL) ALL</code></p>
<h2>Securing SSH</h2>
<p>To secure SSH the default port 22 has to be changed and root user login via SSH has to be disabled. Open the SSH configuration</p>
<p><code class="source-code">vi /etc/ssh/sshd_config</code></p>
<p>and edit the following</p>
<p><code class="source-code">Port 22</code></p>
<p>change this to any number between 49152 and 65535</p>
<p><code class="source-code">Port 53474</code></p>
<p>Also search for</p>
<p><code class="source-code">PermitRootLogin yes</code></p>
<p>and change this to</p>
<p><code class="source-code">PermitRootLogin no</code></p>
<p>For the changes to take place you have to restart the SSH service. If you&#8217;ve been doing all these things via SSH you should add the exit command so that the current SSH session closes.</p>
<p><code class="source-code">/etc/init.d/ssh restart &amp;&amp; exit</code></p>
<p>Reconnect to the server as the newly created sudo user through the new port.</p>
<p><code class="source-code">ssh username@servername -p 53474</code></p>
<p>Now whenever you want to execute commands as root add the word &#8220;sudo&#8221; to the beginning of the command</p>
<h2>Adding firewall rules</h2>
<p>A server becomes to attack vulnerable if it allows access to all open ports in the system, so configuring the firewall is very crucial. Most new Debian installations have no firewall rules. But it is better to flush all rules. Since you&#8217;re logged in as the sudo user add the word sudo before each command</p>
<p><code class="source-code">sudo iptables -F</code></p>
<p>Now lets add the rules</p>
<p><code class="source-code">sudo iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT<br />
sudo iptables -A INPUT -i lo -j ACCEPT<br />
sudo iptables -A INPUT ! -i lo -d 127.0.0.1/8 -j REJECT<br />
sudo iptables -N MYRULES<br />
sudo iptables -A INPUT -j MYRULES<br />
sudo iptables -A MYRULES -m state --state NEW -p tcp --dport 53474 -j ACCEPT<br />
sudo iptables -A MYRULES -m state --state NEW -p tcp --dport 80 -j ACCEPT<br />
sudo iptables -A MYRULES -m state --state NEW -p tcp --dport 443 -j ACCEPT<br />
sudo iptables -A INPUT -j DROP</code></p>
<p>You can probably replace &#8220;DROP&#8221; in the last line with &#8220;REJECT&#8221; but I personally prefer &#8220;DROP&#8221; because when you reject packets the system sends the rejected packets back which might , but &#8220;DROP&#8221; just ignores the packets. The rules above drop icmp packets also which means you won&#8217;t get any reply if you ping the server. If you want the the server to reply to incoming pings execute the following command also</p>
<p><code class="source-code">sudo iptables -A MYRULES -p icmp -m icmp --icmp-type 8 -j ACCEPT</code></p>
<p>Anymore rules you want to add can be appended to the MYRULES table. Time to save the rules and make sure they load when the server reboots</p>
<p><code class="source-code">iptables-save &gt; /etc/iptables.rules<br />
sudo vi /etc/network/if-pre-up.d/firewall</code></p>
<p>Add the following lines to this file</p>
<p><code class="source-code">#!/bin/bash<br />
/sbin/iptables-restore &lt; /etc/iptables.rules</code></p>
<p>Save the file and make it executable</p>
<p><code class="source-code">sudo chmod +x /etc/network/if-pre-up.d/firewall</code></p>
<h2>Conclusion</h2>
<p>This is just the basic setup guide for a Debian server, expect to see more articles on setting up other flavors of Linux and advanced guides on setting up network services. Here is an interactive shell script coded by me which automates all the processes outlined above.</p>
<p><a href="http://jesin.tk/wp-content/uploads/2011/10/unmanaged-debian-server-basic-setup.zip">Download unmanaged Debian VPS/Dedicated server basic setup script</a></p>
<p>To use this script upload it to your server, login as the root user</p>
<p><code class="source-code">chmod +x /path/to/script/unmanaged-debian-server-basic-setup.sh<br />
/path/to/script/unmanaged-debian-server-basic-setup.sh</code></p>
<p>I tested the script with the following Linux flavors</p>
<ul>
<li><strong>Debian 6 (Squeeze)</strong>: This script works perfectly</li>
<li><strong>Debian 5 (Lenny):</strong> Except setting up locales everything works</li>
<li><strong>Ubuntu 11.04 (Natty Narwhal):</strong> Except locales everything works</li>
</ul>
<p>This script was tested on a Rackspace cloud server and a Virtual Machine in VMware player. It should work on all VPSes and dedicated servers if you&#8217;re facing any problems please write about it in the comment form or <a title="Contact Me" href="http://jesin.tk/contact-me/">contact me</a>.</p>
<img src="http://feeds.feedburner.com/~r/jesinsblog/~4/eYootjY9CMc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://jesin.tk/how-to-setup-an-unmanaged-debian-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://jesin.tk/how-to-setup-an-unmanaged-debian-server/</feedburner:origLink></item>
		<item>
		<title>How to use MSMTP with Gmail, Yahoo and PHP Mail</title>
		<link>http://feedproxy.google.com/~r/jesinsblog/~3/x5YWcttvBuY/</link>
		<comments>http://jesin.tk/how-to-use-msmtp-with-gmail-yahoo-and-php-mail/#comments</comments>
		<pubDate>Mon, 24 Oct 2011 15:56:48 +0000</pubDate>
		<dc:creator>A.Jesin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php.ini]]></category>

		<guid isPermaLink="false">http://jesin.tk/?p=1318</guid>
		<description><![CDATA[This is a three in one tutorial which combines how to use MSMTP to send mails via Gmail and Yahoo servers and how to use MSMTP with PHP Mail() function instead of the default sendmail. Installing msmtp To install msmtp on Red Hat/CentOS/Fedora type of distributions yum install msmtp To install msmtp on Debian/Ubuntu type [...]]]></description>
			<content:encoded><![CDATA[<p>This is a three in one tutorial which combines how to use MSMTP to send mails via Gmail and Yahoo servers and how to use MSMTP with PHP Mail() function instead of the default sendmail.</p>
<h2>Installing msmtp</h2>
<p>To install msmtp on Red Hat/CentOS/Fedora type of distributions</p>
<p><code class="source-code">yum install msmtp</code></p>
<p>To install msmtp on Debian/Ubuntu type of distributions</p>
<p><code class="source-code">apt-get install msmtp</code></p>
<h2>Configuring msmtp with Gmail and Yahoo</h2>
<p>Create or edit the msmtp configuration file in the user&#8217;s home directory. I use VI editor to achieve this</p>
<p><code class="source-code">vi ~/.msmtprc</code></p>
<p>Add the following lines to the file, it configures msmtp for both Gmail and Yahoo</p>
<p><code class="source-code">account yahoo<br />
tls on<br />
tls_starttls off<br />
auth on<br />
host smtp.mail.yahoo.com<br />
user user1<br />
from user1@yahoo.com<br />
password ******</code></p>
<p><code class="source-code">account gmail<br />
tls on<br />
auth on<br />
host smtp.gmail.com<br />
port 587<br />
user user1@gmail.com<br />
from user1@gmail.com<br />
password ******</code></p>
<p>Since the file contains sensitive data like passwords you should assign secure permissions</p>
<p><code class="source-code">chmod 600 ~/.msmtprc</code><br />
<span id="more-1318"></span></p>
<h2>Testing msmtp</h2>
<p>First create a text file containing an email</p>
<p><code class="source-code">vi demo_email</code></p>
<p><code class="source-code">From: Jesin &lt;jesin@example.com&gt;<br />
To: Bob &lt;bob@domain.com&gt;<br />
Subject: Hello World<br />
Email sent using MSMTP</code></p>
<p>To send this email via gmail</p>
<p><code class="source-code">cat demo_email | msmtp -a gmail bob@domain.com</code></p>
<p>To send this email via yahoo</p>
<p><code class="source-code">cat demo_email | msmtp -a yahoo bob@domain.com</code></p>
<h2>Using msmtp with PHP mail()</h2>
<p>Here comes the juicy part of the tutorial how to use msmtp to send email via PHP&#8217;s mail() function. Place the msmtp configuration file in a common place</p>
<p><code class="source-code">cp ~/.msmtprc /etc/msmtprc</code></p>
<p>Change the ownership of the so that username under which the web server process is running can read the file. You should check this with the documentation of your web server software. I&#8217;m specifying the settings for Apache running on Red Hat/CentOS/Fedora</p>
<p><code class="source-code">chown apache /etc/msmtprc<br />
chmod 600/etc/msmtprc</code></p>
<p>For Apache on Debian/Ubuntu</p>
<p><code class="source-code">chown www-data /etc/msmtprc<br />
chmod 600 /etc/msmtprc</code></p>
<p>Edit the php configuration file. The path of the file varies according to the server API (mod_php, fastCGI etc), so view the contents of <em>phpinfo()</em> and look for <em>&#8220;Loaded Configuration file&#8221;</em> and edit it. The following is the location of php.ini in a FastCGI environment</p>
<p><code class="source-code">vi /etc/php5/cgi/php.ini</code></p>
<p>Search and edit the <em>sendmail_path</em></p>
<p><code class="source-code">sendmail_path = "/usr/bin/msmtp -C /etc/msmtprc -a yahoo -t"</code></p>
<p>You can replace <em>yahoo</em> with <em>gmail</em>. Save the file and reload your web server software</p>
<p>Create a php file <em>demo_mail.php</em> with the following contents to test the configuration inside your web server&#8217;s document root</p>
<p><code class="source-code">&lt;?php<br />
mail("bob@domain.com","Hello World","Email sent using PHP via msmtp");<br />
?&gt;</code></p>
<p>Open this file by accessing it via URL and the email should be sent. If the mail is not sent take a look at your web server&#8217;s error log.</p>
<p>Sometimes you might encounter the following errors in your web server&#8217;s error log</p>
<p><code class="source-code">msmtp: /etc/msmtprc: must have no more than user read/write permissions</code></p>
<p>This is because the msmtp configuration file isn&#8217;t chmoded properly and can be read by users other than the owner. So do the following</p>
<p><code class="source-code">chmod 600 /etc/msmtprc</code></p>
<p>If you encounter some other errors post them in the comment form.</p>
<img src="http://feeds.feedburner.com/~r/jesinsblog/~4/x5YWcttvBuY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://jesin.tk/how-to-use-msmtp-with-gmail-yahoo-and-php-mail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://jesin.tk/how-to-use-msmtp-with-gmail-yahoo-and-php-mail/</feedburner:origLink></item>
		<item>
		<title>How to save IPtables rules in Debian</title>
		<link>http://feedproxy.google.com/~r/jesinsblog/~3/EjX-cRh_-CA/</link>
		<comments>http://jesin.tk/how-to-save-iptables-rules-in-debian/#comments</comments>
		<pubDate>Sat, 22 Oct 2011 08:45:29 +0000</pubDate>
		<dc:creator>A.Jesin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[linux system files]]></category>

		<guid isPermaLink="false">http://jesin.tk/?p=1299</guid>
		<description><![CDATA[This article explains how to make IPtables firewall rules sustain a boot in Debian. But this can also be applied on other Debian based OSes like Ubuntu and Knoppix. You show execute all these commands as the root user or use the sudo command to do it. First view the list of rules in IPtables [...]]]></description>
			<content:encoded><![CDATA[<p>This article explains how to make IPtables firewall rules sustain a boot in Debian. But this can also be applied on other Debian based OSes like Ubuntu and Knoppix. You show execute all these commands as the root user or use the sudo command to do it.</p>
<p>First view the list of rules in IPtables</p>
<p><code class="source-code">iptables -L</code></p>
<p>If its a new installation there will be no rules. So add some firewall rules, the following rules will allow HTTP, HTTPS, FTP, SMTP, SSH incoming connections and rejects all other incoming connections including ICMP ping packets.</p>
<p><code class="source-code">iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT<br />
iptables -A INPUT -i lo -j ACCEPT<br />
iptables -A INPUT -m state --state NEW -p tcp --dport 80 -j ACCEPT<br />
iptables -A INPUT -m state --state NEW -p tcp --dport 443 -j ACCEPT<br />
iptables -A INPUT -m state --state NEW -p tcp --dport 21 -j ACCEPT<br />
iptables -A INPUT -m state --state NEW -p tcp --dport 25 -j ACCEPT<br />
iptables -A INPUT -m state --state NEW -p tcp --dport 22 -j ACCEPT<br />
iptables -A INPUT -j REJECT</code></p>
<p>View the firewall rules once more</p>
<p><code class="source-code">iptables -L</code></p>
<p><code class="source-code">Chain INPUT (policy ACCEPT)<br />
target     prot opt source               destination<br />
ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED<br />
ACCEPT     all  --  anywhere             anywhere<br />
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:www<br />
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:https<br />
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:ftp<br />
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:smtp<br />
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:ssh<br />
REJECT     all  --  anywhere             anywhere            reject-with icmp-port-unreachable</code></p>
<p><code class="source-code">Chain FORWARD (policy ACCEPT)<br />
target     prot opt source               destination</code></p>
<p><code class="source-code">Chain OUTPUT (policy ACCEPT)<br />
target     prot opt source               destination</code></p>
<p>Write these rules to a file using the following command.</p>
<p><code class="source-code">iptables-save &gt; /etc/iptables.rules</code></p>
<p>Now each time Debian boots iptables-restore command has to be called with these rules, so create and edit a new file as shown below. This file does NOT exist and you have to create it. I&#8217;m using VI editor to edit it</p>
<p><code class="source-code">vi /etc/network/if-pre-up.d/firewall</code></p>
<p>Add the following text to that file</p>
<p><code class="source-code">#!/bin/bash<br />
/sbin/iptables-restore &lt; /etc/iptables.rules</code></p>
<p>Save the file and grant executable permissions on that file.</p>
<p><code class="source-code">chmod +x /etc/network/if-pre-up.d/firewall</code></p>
<p>Reboot the system and list the iptables rules to check if it has been applied.</p>
<p><code class="source-code">reboot</code></p>
<p>After reboot</p>
<p><code class="source-code">iptables -L</code></p>
<p>IMPORTANT: Whenever you add or delete rules you should overwrite the changes to the iptables.rules file using the following command</p>
<p><code class="source-code">iptables-save &gt; /etc/iptables.rules</code></p>
<img src="http://feeds.feedburner.com/~r/jesinsblog/~4/EjX-cRh_-CA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://jesin.tk/how-to-save-iptables-rules-in-debian/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://jesin.tk/how-to-save-iptables-rules-in-debian/</feedburner:origLink></item>
		<item>
		<title>How to assign a static IP address in Linux</title>
		<link>http://feedproxy.google.com/~r/jesinsblog/~3/QzZwwle_vJg/</link>
		<comments>http://jesin.tk/how-to-assign-a-static-ip-address-in-linux/#comments</comments>
		<pubDate>Mon, 17 Oct 2011 09:51:26 +0000</pubDate>
		<dc:creator>A.Jesin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[linux system files]]></category>

		<guid isPermaLink="false">http://jesin.tk/?p=1295</guid>
		<description><![CDATA[This article explains assigning a static IP to your Linux machine through the command line. If you&#8217;re assigning a public IP address, you should&#8217;ve purchased it from your ISP. Assigning the IP address in Linux requires you to edit the network configuration file. The network interface files are located at different places according the Linux [...]]]></description>
			<content:encoded><![CDATA[<p>This article explains assigning a static IP to your Linux machine through the command line. If you&#8217;re assigning a public IP address, you should&#8217;ve purchased it from your ISP. Assigning the IP address in Linux requires you to edit the network configuration file. The network interface files are located at different places according the Linux OS variant. This article will cover both Red Hat and Debian variants. You need to logged in as the root user to edit these files, or you should have sudo permissions.<span id="more-1295"></span></p>
<h3>Red Hat variants</h3>
<p>Some of the Red Hat variant Linux OSes are CentOS, Fedora, SUSE Linux etc. If you&#8217;re using YUM to install packages then you have a Red Hat based OS. Use the VI editor and edit the following file</p>
<p><code class="source-code">vi /etc/sysconfig/network-scripts/ifcfg-eth0</code></p>
<p>A machine having multiple Ethernet cards will have files named <em>ifcfg-eth1, ifcfg-eth2</em> and so on. Add or edit the following lines</p>
<p><code class="source-code">ONBOOT=yes<br />
BOOTPROTO=none<br />
IPADDR=192.168.0.2<br />
NETMASK=255.255.255.0<br />
GATEWAY=192.168.0.1</code></p>
<p>By default <em>BOOTPROTO</em> is set to dhcp which should be changed, setting <em>ONBOOT</em> to yes will activate this network adapter when Linux boots and the care should be taken when entering the <em>NETMASK</em> value. Because unlike Windows OSes which automatically assign Subnet masks based on the class of the IP address manual assigning is required in Linux. Even though the interface will work if classless <em>NETMASK</em> is entered, the system might have problems in communicating with other network devices as they have a classful subnet mask. Refer to the Wikipedia article on <a rel="external nofollow" href="http://en.wikipedia.org/wiki/Classful_network#Introduction_of_address_classes" target="_blank">Classful network</a> to check in which class your IP address lies.</p>
<h3>Debian variants</h3>
<p>If you use dpkg to install packages then you&#8217;re using a Debian based Linux OS. Using VI editor open the following file.</p>
<p><code class="source-code">vi /etc/network/interfaces</code></p>
<p>If you&#8217;re using DHCP (which is the default) the following is shown</p>
<p><code class="source-code">auto eth0<br />
iface eth0 inet dhcp</code></p>
<p>To assign an IP address statically delete those lines and enter the following</p>
<p><code class="source-code">iface eth0 inet static<br />
address 192.168.0.2<br />
netmask 255.255.255.0<br />
gateway 192.168.0.1</code></p>
<p>Here again you should keep an eye when entering the netmask.</p>
<h3>Assigning the DNS IP addresses</h3>
<p>Assigning DNS addresses is similar in both types of Linux OSes. Edit the following file using the VI editor</p>
<p><code class="source-code">vi /etc/resolv.conf</code></p>
<p>The nameserver keyword is used to mention the DNS service IP address. If more than one DNS IP is to be specified use multiple entries</p>
<p><code class="source-code">nameserver 8.8.8.8<br />
nameserver 8.8.4.4</code></p>
<h3>Restarting the interface and verifying the settings</h3>
<p>For the changes to apply the interface has to be shutdown and brought up</p>
<p><code class="source-code">ifdown eth0<br />
ifup eth0<br />
ifconfig</code></p>
<p>The <em>ifconfig</em> command should display the IP address and netmask assigned by you. Ping different IP addresses to check connectivity. To check the DNS ping a hostname or a domain name</p>
<p><code class="source-code">ping google.com</code></p>
<p>You should get a reply.</p>
<img src="http://feeds.feedburner.com/~r/jesinsblog/~4/QzZwwle_vJg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://jesin.tk/how-to-assign-a-static-ip-address-in-linux/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://jesin.tk/how-to-assign-a-static-ip-address-in-linux/</feedburner:origLink></item>
	</channel>
</rss>

