<?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>WiredRevolution.com &#187; IP address</title>
	<atom:link href="http://www.wiredrevolution.com/tag/ip-address/feed" rel="self" type="application/rss+xml" />
	<link>http://www.wiredrevolution.com</link>
	<description>A Bit of Linux Wisdom</description>
	<lastBuildDate>Fri, 10 Sep 2010 16:50:39 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to SSH into Ubuntu LiveCD</title>
		<link>http://www.wiredrevolution.com/ubuntu/how-to-ssh-into-ubuntu-livecd</link>
		<comments>http://www.wiredrevolution.com/ubuntu/how-to-ssh-into-ubuntu-livecd#comments</comments>
		<pubDate>Tue, 16 Dec 2008 14:08:44 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[8.10]]></category>
		<category><![CDATA[apt-get]]></category>
		<category><![CDATA[aptitude]]></category>
		<category><![CDATA[ifconfig]]></category>
		<category><![CDATA[inet addr]]></category>
		<category><![CDATA[intrepid]]></category>
		<category><![CDATA[IP address]]></category>
		<category><![CDATA[livecd]]></category>
		<category><![CDATA[openssh_server]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://www.wiredrevolution.com/?p=865</guid>
		<description><![CDATA[<img src="http://www.wiredrevolution.com/wp-content/uploads/ubuntu_icon.png" width="80" height="78" alt="" title="ubuntu" /><br/>The ability to remotely SSH into a machine running an Ubuntu LiveCD can come in handy in many situations. The LiveCD supports a large variety of hardware and can be used to troubleshoot system problems on a machine where you have limited or no access. A user with limited skills can easily setup remote access [...]


Related posts<ol><li><a href='http://www.wiredrevolution.com/ubuntu/installing-ubuntu-910-on-the-dell-zino-hd' rel='bookmark' title='Permanent Link: Installing Ubuntu 9.10 on the Dell Zino HD'>Installing Ubuntu 9.10 on the Dell Zino HD</a> <small>The Dell Inspiron Zino HD is the perfect machine if...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<img src="http://www.wiredrevolution.com/wp-content/uploads/ubuntu_icon.png" width="80" height="78" alt="" title="ubuntu" /><br/><p>The ability to remotely <strong>SSH</strong> into a machine running an <strong>Ubuntu</strong> <strong>LiveCD</strong> can come in handy in many situations. The LiveCD supports a large variety of hardware and can be used to troubleshoot system problems on a machine where you have limited or no access. A user with limited skills can easily setup remote access and allow a trusted friend to troubleshoot the system from another location.</p>
<p>The first thing to start the process is to open a <strong>terminal</strong>. Follow these menus:</p>
<p><strong>Applications -> Accessories -> Terminal</strong></p>
<p>In the terminal install the <strong>ssh server</strong> on your LiveCD system.</p>
<pre>
$ sudo apt-get install openssh-server
</pre>
<p>The server is started automatically after installing. </p>
<p>To login remotely, you’ll need to set the password for the default ubuntu user.</p>
<pre>
$ sudo passwd ubuntu
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
</pre>
<p>You should now be able to login to the system running the LiveCD. But first you need to <a href="/system-administration/find-your-ip-address-with-ifconfig">find the IP address</a> of the machine so you can connect to it.</p>
<p>The <strong>ifconfig</strong> command will list your network interfaces and along with it your IP address.</p>
<pre>
$ ifconfig
</pre>
<pre>
eth0      ...
          <strong>inet addr:192.168.1.1</strong>  Bcast:192.168.2.255  Mask:255.255.255.0
          ...
</pre>
<p>The <strong>inet addr</strong> entry is your IP address which you need to log into the LiveCD system. As you an see above the IP address begins with &#8220;<strong>192.168</strong>&#8221; which indicates that the IP address is only valid on the local network. It was an address assigned to the machine by the router.  This is fine if you plan on logging in from another machine on this local network.</p>
<p>If you need to access the machine from outside your local network you have a couple of options.  The first is to remove any router between you and the Internet. This should give you a valid IP address which is accessible from outside your local network. You may also be able to access your router&#8217;s administration panel and tell it to pass SSH traffic to the IP address of the LiveCD system.  You will then use the router&#8217;s IP address instead for the next step.</p>
<p>If your IP address already begins with something other than &#8220;<strong>192.168</strong>&#8221; then you are safe as well. You should be able to access the LiveCD system from any location, local or not.</p>
<p>Using the IP address from the previous step you can now log into the LiveCD system as the ubuntu user. Use the password you created earler.</p>
<pre>
$ ssh ubuntu@&lt;IP Address&gt;
</pre>


<p>Related posts<ol><li><a href='http://www.wiredrevolution.com/ubuntu/installing-ubuntu-910-on-the-dell-zino-hd' rel='bookmark' title='Permanent Link: Installing Ubuntu 9.10 on the Dell Zino HD'>Installing Ubuntu 9.10 on the Dell Zino HD</a> <small>The Dell Inspiron Zino HD is the perfect machine if...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.wiredrevolution.com/ubuntu/how-to-ssh-into-ubuntu-livecd/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Find IP address from remote end of a TCP socket</title>
		<link>http://www.wiredrevolution.com/c/find-ip-address-from-remote-end-of-a-tcp-socket</link>
		<comments>http://www.wiredrevolution.com/c/find-ip-address-from-remote-end-of-a-tcp-socket#comments</comments>
		<pubDate>Fri, 31 Oct 2008 12:49:34 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[C]]></category>
		<category><![CDATA[getpeername]]></category>
		<category><![CDATA[inet_ntoa]]></category>
		<category><![CDATA[IP address]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[sockaddr]]></category>
		<category><![CDATA[sockaddr_in]]></category>
		<category><![CDATA[socket]]></category>
		<category><![CDATA[TCP]]></category>

		<guid isPermaLink="false">http://www.wiredrevolution.com/?p=560</guid>
		<description><![CDATA[<img src="http://www.wiredrevolution.com/wp-content/uploads/c_icon.png" width="80" height="80" alt="" title="C" /><br/>In C or C++ it is fairly simple to find the IP address of the remote end of a TCP socket.
The following example shows how to do this using the getpeername() and inet_ntoa() system calls.

int sockfd;
int len;
char * hostip;
struct sockaddr_in sin;

len = sizeof(sin);

if (0 != getpeername(sockfd, (struct sockaddr *) &#038;sin, &#038;len))
     [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<img src="http://www.wiredrevolution.com/wp-content/uploads/c_icon.png" width="80" height="80" alt="" title="C" /><br/><p>In C or C++ it is fairly simple to find the IP address of the remote end of a TCP socket.</p>
<p>The following example shows how to do this using the <strong>getpeername</strong>() and <strong>inet_ntoa</strong>() system calls.</p>
<pre>
int sockfd;
int len;
char * hostip;
struct sockaddr_in sin;

len = sizeof(sin);

if (0 != getpeername(sockfd, (struct sockaddr *) &#038;sin, &#038;len))
        perror("getpeername");
}

hostip = inet_ntoa(sin.sin_addr);

printf("client IP: %s\n", hostip);
</pre>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.wiredrevolution.com/c/find-ip-address-from-remote-end-of-a-tcp-socket/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Find your IP address with ifconfig</title>
		<link>http://www.wiredrevolution.com/system-administration/find-your-ip-address-with-ifconfig</link>
		<comments>http://www.wiredrevolution.com/system-administration/find-your-ip-address-with-ifconfig#comments</comments>
		<pubDate>Thu, 30 Oct 2008 10:48:07 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[system administration]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[ifconfig]]></category>
		<category><![CDATA[inet addr]]></category>
		<category><![CDATA[IP address]]></category>

		<guid isPermaLink="false">http://www.wiredrevolution.com/?p=544</guid>
		<description><![CDATA[<img src="http://www.wiredrevolution.com/wp-content/uploads/sysadmin_icon.png" width="80" height="94" alt="" title="system administration" /><br/>You can find the IP address of your system at the command line by using the ifconfig command.  The ifconfig command will show you information on all your network interfaces.  If no arguments are given ifconfig displays the status of the currently active interfaces.
You have to run this command as root or use [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<img src="http://www.wiredrevolution.com/wp-content/uploads/sysadmin_icon.png" width="80" height="94" alt="" title="system administration" /><br/><p>You can find the IP address of your system at the command line by using the <strong>ifconfig</strong> command.  The ifconfig command will show you information on all your network interfaces.  If no arguments are given ifconfig displays the status of the currently active interfaces.</p>
<p>You have to run this command as root or <a href="/commands/submit-commands-as-root-with-sudo">use sudo</a>.</p>
<pre>
# ifconfig
</pre>
<pre>
wlan0     Link encap:Ethernet  HWaddr a1:b2:c3:d4:e5:f6
          <strong>inet addr:192.168.2.11</strong>  Bcast:192.168.2.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1492  Metric:1
          RX packets:4007 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4246 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:3292271 (3.1 MiB)  TX bytes:994922 (971.6 KiB)
</pre>
<p>Your IP address is displayed in the <strong>inet addr</strong> field.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.wiredrevolution.com/system-administration/find-your-ip-address-with-ifconfig/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Display hostname and IP address in C</title>
		<link>http://www.wiredrevolution.com/c/display-hostname-and-ip-address-in-c</link>
		<comments>http://www.wiredrevolution.com/c/display-hostname-and-ip-address-in-c#comments</comments>
		<pubDate>Sat, 18 Oct 2008 12:54:53 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[C]]></category>
		<category><![CDATA[gethostbyname]]></category>
		<category><![CDATA[gethostname]]></category>
		<category><![CDATA[hostent]]></category>
		<category><![CDATA[hostname]]></category>
		<category><![CDATA[inet_ntoa]]></category>
		<category><![CDATA[IP address]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.wiredrevolution.com/?p=394</guid>
		<description><![CDATA[<img src="http://www.wiredrevolution.com/wp-content/uploads/c_icon.png" width="80" height="80" alt="" title="C" /><br/>Here is a good way to determine the hostname and IP address of the local machine in C.
You first have to grab the hostname with gethostname().

char hostbuf[256];
gethostname(hostbuf,sizeof(hostbuf));

Take the hostname and use it to grab the hostent struct with gethostbyname().

struct hostent *hostentry;
hostentry = gethostbyname(hostbuf);

Finally you have to take the hostent that is returned and pull out [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<img src="http://www.wiredrevolution.com/wp-content/uploads/c_icon.png" width="80" height="80" alt="" title="C" /><br/><p>Here is a good way to determine the hostname and IP address of the local machine in C.</p>
<p>You first have to grab the hostname with <strong>gethostname</strong>().</p>
<pre>
char hostbuf[256];
gethostname(hostbuf,sizeof(hostbuf));
</pre>
<p>Take the hostname and use it to grab the hostent struct with <strong>gethostbyname</strong>().</p>
<pre>
struct hostent *hostentry;
hostentry = gethostbyname(hostbuf);
</pre>
<p>Finally you have to take the hostent that is returned and pull out the IP address.  It is in network byte order, so you have to convert it to a string with <strong>inet_ntoa</strong>().</p>
<pre>
char * ipbuf;
ipbuf = inet_ntoa(*((struct in_addr *)hostentry->h_addr_list[0]));
</pre>
<p>Put all this together into a working programs.</p>
<pre>
#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;errno.h&gt;
#include &lt;netdb.h&gt;
#include &lt;sys/types.h&gt;
#include &lt;sys/socket.h&gt;
#include &lt;netinet/in.h&gt;
#include &lt;arpa/inet.h&gt;

int main()
{
        char hostbuf[256];
        char * ipbuf;
        struct hostent *hostentry;
        int ret;

        ret = gethostname(hostbuf,sizeof(hostbuf));

        if(-1 == ret){
                perror("gethostname");
                exit(1);
        }

        hostentry = gethostbyname(hostbuf);

        if(NULL == hostentry){
                perror("gethostbyname");
                exit(1);
        }

        ipbuf = inet_ntoa(*((struct in_addr *)hostentry->h_addr_list[0]));

        if(NULL == ipbuf){
                perror("inet_ntoa");
                exit(1);
        }

        printf("Hostname: %s Host IP: %s\n", hostbuf, ipbuf);

        return 0;
}
</pre>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.wiredrevolution.com/c/display-hostname-and-ip-address-in-c/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
