<?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>marius &#187; IP</title>
	<atom:link href="http://devilx.net/tag/ip/feed/" rel="self" type="application/rss+xml" />
	<link>http://devilx.net</link>
	<description></description>
	<lastBuildDate>Wed, 25 Jan 2012 07:42:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Amazon EC2: How to Setup an Instance and Bundle it</title>
		<link>http://devilx.net/2009/11/01/amazon-ec2-how-to-setup-an-instance-and-bundle-it/</link>
		<comments>http://devilx.net/2009/11/01/amazon-ec2-how-to-setup-an-instance-and-bundle-it/#comments</comments>
		<pubDate>Sun, 01 Nov 2009 16:25:46 +0000</pubDate>
		<dc:creator>Marius</dc:creator>
				<category><![CDATA[Linux and stuff ...]]></category>
		<category><![CDATA[New & Cool]]></category>
		<category><![CDATA[World Wide Web]]></category>
		<category><![CDATA[Amazon]]></category>
		<category><![CDATA[AMI]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[Bucket]]></category>
		<category><![CDATA[Bundle]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[EBS]]></category>
		<category><![CDATA[EC2]]></category>
		<category><![CDATA[Elastic]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[HTTPS]]></category>
		<category><![CDATA[Instance]]></category>
		<category><![CDATA[IP]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[S3]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.devilx.net/?p=1033</guid>
		<description><![CDATA[I know, that there are several documentations concerning Amazon&#8217;s Elastic Cloud Computing, though I&#8217;d like to describe some very first steps for using their infrastructure to build (Linux-) instances that fulfill your needs. Let&#8217;s not beat around the bush and &#8230; <a href="http://devilx.net/2009/11/01/amazon-ec2-how-to-setup-an-instance-and-bundle-it/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I know, that there are several documentations concerning Amazon&#8217;s Elastic Cloud Computing, though I&#8217;d like to describe some very first steps for using their infrastructure to build (Linux-) instances that fulfill your needs. Let&#8217;s not beat around the bush and start-over by setting up the very first instance.</p>
<p>The first thing needed is a client computer running any kind of the supported OSs by the Amazon API tools and of course the tools themselves. After you&#8217;ve installed those and configured all credentials the right way, we can create a new pair of SSH keys for our new project. Due to the location I&#8217;m currently in, I&#8217;ve chosen to use Amazon Instances in the western EU. Execute the following line on your command-line:</p>
<blockquote><p>ec2-add-keypair &#8211;region eu-west-1 test-keypair</p></blockquote>
<p>The result should look something like this:</p>
<blockquote><p>[Deprecated] Xalan: org.apache.xml.res.XMLErrorResources_en_US<br />
KEYPAIR	test-keypair	e1:1a:d1:a1:a1:1c:10:a1:b1:d1:cb:11:11:1a:11:11:f1:11:ae:fe<br />
&#8212;&#8211;BEGIN RSA PRIVATE KEY&#8212;&#8211;<br />
XXX<br />
&#8212;&#8211;END RSA PRIVATE KEY&#8212;&#8211;</p></blockquote>
<p>You can now copy the lines from <i>BEGIN&#8230;</i> until <i>END&#8230;</i> (including those two) into a file which you&#8217;ll be using as SSH-key for connecting to your instance. Don&#8217;t forget to <i>chmod 600</i> it!</p>
<p>Next, let&#8217;s see what base-images for creating our instance we could you &#8211; first, provided by Amazon themselves:</p>
<blockquote><p>
ec2-describe-images &#8211;region eu-west-1 -o &#8216;amazon&#8217;
</p></blockquote>
<p>The list is contained of several different OSs and versions, although in our current project we can&#8217;t make use of any of those. Therefor, we&#8217;re now searching for a perfectly fitting, really good operating system:</p>
<blockquote><p>
ec2-describe-images &#8211;region eu-west-1 -a | grep -i debian
</p></blockquote>
<p>And yet, we receive another list with several different versions of the Debian Linux distribution. After we&#8217;ve picked the one we&#8217;d like to run, we should check what instances are currently up and running:</p>
<blockquote><p>
ec2-describe-instances &#8211;region eu-west-1
</p></blockquote>
<p>If you&#8217;re using Amazon&#8217;s EC2 for the first time, there shouldn&#8217;t be any items listed. We can now start our very first instance, by copying the instance&#8217;s identifier (in the second column, a string starting with ami-<id>) and pasting it into our command:</p>
<blockquote><p>
ec2-run-instances &#8211;region eu-west-1 -k test-keypair -g &#8216;http/s&#8217; -g &#8216;ssh&#8217; ami-b8446fcc
</p></blockquote>
<p>In this command, we tell Amazon to start up a new instance that&#8217;s built on top of the ami-b8446fcc-image, using the key-pair we just created before and using some custom built firewall-rules named &#8220;http/s&#8221; (which allows us to connect to port 80 and 443) and &#8220;ssh&#8221; (port 22).</p>
<p>We need to wait a few seconds, until the instance comes up. We can use the describe-instances command from above to check the instance&#8217;s status:</p>
<blockquote><p>
ec2-describe-instances &#8211;region eu-west-1
</p></blockquote>
<p>As soon as it&#8217;s up and running, the &#8220;pending&#8221; column should have been replaced by a dynamically allocated hostname and the status &#8220;running&#8221;. Keep in mind, that this hostname/ip is dynamically allocated! If you want a fixed IP, you need to allocate and assign an Elastic IP &#8211; I&#8217;ll show you later how to do so.<br />
If our firewall rules worked out, we can now connect using SSH:</p>
<blockquote><p>
ssh -i ~/Library/EC2/id_rsa-test-keypair root@ec2-11-111-11-111.eu-west-1.compute.amazonaws.com
</p></blockquote>
<p>By default, Amazon sets up a Small Instance, that provides around 10 GB of hard drive, an Dual-Core AMD Opteron 2218 with 2600 MHz and around 1.7 GB of RAM. Small instances, in comparison to the bigger ones, also still provide a real swap-partition which is limited to 895 MB. Here, you could run into problems when installing some Oracle for example, since the DB would like to have 1 GB or more Swap-space. If 895 MB should not be enough, the only way to enlarge it seems to be to use a file within your file-system for that. Either, by placing it somewhere into / or by using /mnt for that. /mnt is a special mount in Amazon instances which provides you 147 GB of additional <i>volatile</i> storage. Amazon doesn&#8217;t guarantee in any way the storage to be stable/solid or even backed up &#8211; and usually /mnt is only used for bundling your instance. You might now think <i>&#8220;so, where could I place my data, if / is only providing me 10 GB of space and /mnt should not be used for storing sensitive data?&#8221;</i> &#8211; well, there&#8217;s a third possibility named Elastic Block Storage. An EBS is being displayed to your instance as regular block-device (/dev/sdb, &#8230;) that&#8217;s format- and mountable. There, sensitive data could be stored, by bind-mounting the directories you&#8217;d like to have your data in. I&#8217;m not going to explain how this works, else I&#8217;ll never finish writing this brief documentation.</p>
<p>However, since we&#8217;re connected to the instance now, we can set it up the way we want it, with whatever software we need on it. I&#8217;ve assumed, that most people would set it up as regular LAMP-instance, therefor I&#8217;ve also added the firewall-rule for HTTP/HTTPS. After we finished installing the software we need, there&#8217;s one more package that should be plugged into the system: The Amazon AMI Tools. Simply wget them from http://s3.amazonaws.com/ec2-downloads/ec2-ami-tools.zip and unzip the package. Those tools make use of Ruby, so ensure having it installed on your instance. Also, you need to have the private key (pk-<id>.pem) and the certificate (cert-<id>.pem) you created the instance with somewhere within your instance&#8217;s filesystem, for later use.</p>
<p>Before we bundle up our system now, let&#8217;s come back to the topic we had before: The hostname/IP. Amazon allocates some dynamic address, unless you tell them to give you a fixed (called Elastic) IP. You can do that by simply executing:</p>
<blockquote><p>
ec2-allocate-address &#8211;region eu-west-1
</p></blockquote>
<p>&#8230; within your client&#8217;s command-line (where the Amazon API Tools have been installed &#8211; not on the instance!). As result you&#8217;ll get some IP address that has now being allocated by Amazon for you. The IP isn&#8217;t bound to any instance yet &#8211; it&#8217;s just allocated for you to be able to use it. ATTENTION: You pay for Elastic IPs as long as you do not assign them to an instance. Yes, that&#8217;s right. Amazon charges you for every allocated but unused IP hourly. By that, they want to prevent people &#8220;collecting&#8221; addresses, I guess. To assign the address you just received to your instance, simply run:</p>
<blockquote><p>
ec2-associate-address &#8211;region eu-west-1 -i i-11e11b1e 79.125.11.11
</p></blockquote>
<p>The i-<id> is your actual instance&#8217;s ID, where the last, dot-separated number is the IP you&#8217;ve received. And yes, those are fake numbers &#8211; so don&#8217;t even try. <img src='http://devilx.net/wp-content/plugins/smilies-themer/Riceballs/wink.png' alt=';]' class='wp-smiley' /> </p>
<p>Now it could take a bit for Amazon to reconfigure the instance, but as soon as it finished, you should be able to re-connect to the instance using the IP you just assigned to it.</p>
<p>As last task for today, let&#8217;s bundle up the image the way we have it now. Bundling an image allows you more than just eating up your credit card&#8217;s limit by dumping your S3 buckets. On the one hand, with bundles you can recover machines that crashed or lost data within a few blinks and on the other, you can created new instances out of a bundle (talking about &#8220;scalability&#8221;).</p>
<p>For bundling, we use the AMI tools we installed. First of all, let&#8217;s create a directory for the bundle:</p>
<blockquote><p>
mkdir /mnt/myimage
</p></blockquote>
<p>After that, run the bundle-vol-tool:</p>
<blockquote><p>
ec2-bundle-vol -k pk-<id>.pem -c cert-<id>.pem -s <bundle size in MB, e.g. 5000> -u <user-id, without dashes> -d /mnt/myimage/
</p></blockquote>
<p>This command takes several parameters for the private key, the certificate, the size of the resulting bundle in MB and your User-ID (without dashes). The User-ID can be found within your Account Information on Amazon&#8217;s EC2 site. The command should ask you, what architecture you&#8217;d like to bundle the system for &#8211; i386 should work out perfectly for what we&#8217;re doing. The following procedure could take some time, since the tool collections every peace of the system and builds a bundle into the directory we specified. As soon as the tool finished, we can upload our bundle to our S3-bucket:</p>
<blockquote><p>
ec2-upload-bundle &#8211;location EU -b <some unique bucket name>  -m /mnt/myimage/image.manifest.xml -a <access-key> -s <secret-key>
</p></blockquote>
<p>Again, we need to specify some credentials (our access-key and the secret-key) for the upload to work. Also, we need to pick a globally unique bucket-name for uploading the bundle, what shouldn&#8217;t be that hard as long as you don&#8217;t try stuff like &#8220;linux&#8221; or other common words. The bundle will then be uploaded to your (private) bucket, so you have it for later use.</p>
<p>From within the web-interface you could now simply create new instances out of the uploaded bundle, without even knowing how the actual system was set up or having the Amazon API tools installed on your client.</p>
<p>Cool stuff, enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://devilx.net/2009/11/01/amazon-ec2-how-to-setup-an-instance-and-bundle-it/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Let&#8217;s Broadcast to the World!</title>
		<link>http://devilx.net/2009/01/07/lets-broadcast-to-the-world/</link>
		<comments>http://devilx.net/2009/01/07/lets-broadcast-to-the-world/#comments</comments>
		<pubDate>Wed, 07 Jan 2009 01:14:39 +0000</pubDate>
		<dc:creator>Marius</dc:creator>
				<category><![CDATA[Life itself]]></category>
		<category><![CDATA[World Wide Web]]></category>
		<category><![CDATA[Administrator]]></category>
		<category><![CDATA[Ethernet]]></category>
		<category><![CDATA[Gateway]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Hobby]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[IP]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Sloppy]]></category>
		<category><![CDATA[Subway]]></category>
		<category><![CDATA[Traffic]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[Webcam]]></category>

		<guid isPermaLink="false">http://www.devilx.net/?p=732</guid>
		<description><![CDATA[Some time ago, I got interested in these tiny little cams with direct Ethernet connection, that contain a lightweight webserver that streams the actual picture to the network the cam&#8217;s connected to. I was holding such a cam in the &#8230; <a href="http://devilx.net/2009/01/07/lets-broadcast-to-the-world/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div id="attachment_734" class="wp-caption alignleft" style="width: 250px"></p>
<div style="text-align: auto;"><a href="http://www.devilx.net/wp-content/uploads/2009/01/webcamera.png"><img class="size-full wp-image-734" title="Who's watching you?" src="http://www.devilx.net/wp-content/uploads/2009/01/webcamera.png" alt="Who's watching you?" width="240" height="408" /></a></div>
<p><p class="wp-caption-text">Who&#39;s watching you?</p></div>
<p>Some time ago, I got interested in these tiny little cams with direct Ethernet connection, that contain a lightweight webserver that streams the actual picture to the network the cam&#8217;s connected to. I was holding such a cam in the hands at work, some while ago, and recently I was wondering myself, how expensive these would actually be. Not that I would really want to purchase one, just for informing myself. So, I opened Google and entered the manufactures name followed by some other keywords. The first links Google showed me were the links to the actual products, but while flying over Google&#8217;s first page of results I found some link directed to an IP address and ending with an .shtml file. The structure of the URL looked similar like the one I&#8217;ve seen from the cams we have at work&#8230; call it boredom, but I followed the link and &#8211; I was surprised &#8211; I landed on such a cam&#8217;s video server which streamed me the picture of the traffic on some highway. I got the idea to enter the site&#8217;s title into Google and search for more links similar to this one. And what should I say&#8230; after around one hour of search I&#8217;ve already found seven sites containing the live-pictures of webcams which in my opinion seem not to be intended for public-viewing. Or at least, I don&#8217;t know why someone should want the internet to watch his bar&#8217;s guests or his co-workers to be visible on the world wide web.</p>
<p>I&#8217;m really astonished about some administrator&#8217;s sloppiness on such things. Especially, because it&#8217;s not them who are visible on the internet, but the people around them. On some webcams I really got the impression, that the administrators of these webcams thought, that it would be good for them to be able to access the webcams from anywhere, and to make this possible just use &#8220;security by obscurity&#8221;. The webcams where all only accessible directly by entering the server&#8217;s (or gateway&#8217;s, dunno) IP-address and had no security at all, for accessing the live-stream.</p>
<p>However, I think, I kinda found some new hobby for long nights. And you should think twice when you see a camera connected to the network somewhere &#8211; you might be visible to the whole internet. Oh, this reminds me of the local <a title="Subway Sandwiches" href="http://www.subway-sandwiches.de/" target="_blank">Subway</a>, where three cameras are hanging in the corners, but no sign indicates that the place is getting filmed. Hm&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://devilx.net/2009/01/07/lets-broadcast-to-the-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>strongS/WAN over NAT-T with IKEv2 (Pt. 2, a.k.a. &#8220;The Roadwarrior Setup&#8221;)</title>
		<link>http://devilx.net/2008/10/08/strongswan-over-nat-t-with-ikev2-pt-2-aka-the-roadwarrior-setup/</link>
		<comments>http://devilx.net/2008/10/08/strongswan-over-nat-t-with-ikev2-pt-2-aka-the-roadwarrior-setup/#comments</comments>
		<pubDate>Wed, 08 Oct 2008 12:41:54 +0000</pubDate>
		<dc:creator>Marius</dc:creator>
				<category><![CDATA[Linux and stuff ...]]></category>
		<category><![CDATA[New & Cool]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[BSD]]></category>
		<category><![CDATA[Cool]]></category>
		<category><![CDATA[DHCP]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[IKE]]></category>
		<category><![CDATA[IKEv2]]></category>
		<category><![CDATA[IP]]></category>
		<category><![CDATA[IPsec]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[NAT]]></category>
		<category><![CDATA[NAT-T]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[OpenSource]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[strongS/WAN]]></category>
		<category><![CDATA[VPN]]></category>

		<guid isPermaLink="false">http://www.devilx.net/?p=565</guid>
		<description><![CDATA[Some days ago I showed up a specific scenario and described how a strongS/WAN configuration for this could look like. Now, I would like to add additional information on how the scenario can be tuned so that even &#8220;Roadwarriors&#8221; could &#8230; <a href="http://devilx.net/2008/10/08/strongswan-over-nat-t-with-ikev2-pt-2-aka-the-roadwarrior-setup/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Some days ago I <a title="strongS/WAN over NAT-T with IKEv2" href="http://devilx.net/?p=558" target="_self">showed up a specific scenario and described</a> how a strongS/WAN configuration for this could look like. Now, I would like to add additional information on how the scenario can be tuned so that even &#8220;Roadwarriors&#8221; could connect from any network infrastructure, indifferent whether they&#8217;re directly on a public IP or share their public IP with others, behind another NAT network. Let&#8217;s take a look at the client config:<br />
<code><span id="more-565"></span><br />
config setup<br />
plutostart=no</code></p>
<p><code> </code></p>
<p><code>conn nat-t<br />
ikelifetime=60m<br />
keylife=20m<br />
rekeymargin=3m<br />
keyingtries=1<br />
keyexchange=ikev2<br />
authby=secret<br />
left=192.168.10.193<br />
leftsubnet=10.1.0.0/24<br />
leftfirewall=yes<br />
right=%defaultroute<br />
rightid=client@example.com<br />
rightsourceip=10.100.0.2<br />
auto=add<br />
</code><br />
We added a new virtual IP (rightsourceip) for the client. The network of this IP will be defined on the server&#8217;s configuration. We need this for the whole scenario to work out, even if the client/Roadwarrior is behind a NAT. As rightid (client-id) we use the client&#8217;s e-mail address.<br />
Server config:<br />
<code><br />
config setup<br />
plutostart=no</code></p>
<p><code> </code></p>
<p><code>conn nat-t<br />
ikelifetime=60m<br />
keylife=20m<br />
rekeymargin=3m<br />
keyingtries=1<br />
keyexchange=ikev2<br />
authby=secret<br />
left=10.1.0.4<br />
leftsubnet=10.1.0.0/24<br />
leftid=192.168.10.193<br />
leftfirewall=yes<br />
right=%any<br />
rightid=client@example.com<br />
rightsubnetwithin=10.100.0.0/24<br />
auto=add<br />
</code></p>
<p>Here, we also defined the client&#8217;s e-mail address as rightid, defined that the right side could be anything (&#8220;%any&#8221;) and told the server to serve the virtual network 10.100.0.0/24 for the right side. By that, the configuration can be applied to different clients and the actual IP configuration is provided on the client&#8217;s side. Yet, I did not find out whether there&#8217;s a possibility to set up some DHCP server and provide connecting clients a dynamic address automatically.<br />
However, this setup now also works with Roadwarriors that are behind NATs, what means that the actual setup could look like this:</p>
<p>[roadwarrior]&#8212;-[nat]&#8212;internet&#8212;[nat]&#8212;[server]&#8212;network</p>
<p>Isn&#8217;t this cool? <img src='http://devilx.net/wp-content/plugins/smilies-themer/Riceballs/wink.png' alt=';-)' class='wp-smiley' /> <br />
Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://devilx.net/2008/10/08/strongswan-over-nat-t-with-ikev2-pt-2-aka-the-roadwarrior-setup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

