Technical: No-IP – Creating new Account and Usage on Linux Host

Technical: No-IP – Creating new Account and Usage on Linux Host

Introduction

I have a new IP Address; world reachable IP courtesy of Comcast. And, I need to put it to use.  Since it is a Dynamic IP Address, it might change ever so often.  And, so I need to link it to a FQDN that will not change.

Chose to go with NoIp.Com

NoIp.Com — New Account

Connected to NoIp and created a new account.  All I need are :

  • username
  • password
  • email address

Good!

NoIp.Com — Provision new host

Once NoIp.com account is created, they sent me an email address to validate liveness.  Did so.

And, now went forward with adding a new host.

noip.com -- Add a host

Once host is in place, let us go configure our Linux Host.

NoIp.Com — Provision new host

Download Linux Client

Download Linux Client from https://www.noip.com/downloads.php?page=linux



wget https://www.noip.com/client/linux/noip-duc-linux.tar.gz \
      -O /tmp/noip-duc-linux.tar.gz

noip.com - dynamic client for Linux - wget

Prepare & Install

Prepare and install noip..

Steps:

  • change to /tmp folder where we saved downloaded binary
  • Use tar to extract files
  • Change to extracted folder
  • Make Install

  cd /tmp
  tar xf noip-duc-linux.tar.gz 
  cd noip-2.1.9-1/
  make install

But, errored due to missing gcc:

gcc - command not found

Something about missing gcc.

True to form.  first attempt at preparing and installation failed.

Help on installing gcc on Linux Host

Googled for help on installing gcc on linux host.

Out of the Google hits that came up, I think I chose the first few links, but really should have looked further down.

RHEL / CentOS Linux Install Core Development Tools Automake, Gcc (C/C++), Perl, Python & Debuggers

http://www.cyberciti.biz/faq/centos-linux-install-gcc-c-c-compiler/

I trust cyberciti as I have used them a few times while trying to learn Linux.  Like they say on the streets, they have Street Creditbility.  No Insider trading here, meant to stay Main Street.

Install gcc

So courtesy of cybercity.biz, installed gcc via


# yum groupinstall 'Development Tools'

Prepare & Install (successful)

Prepare and install noip..


  cd /tmp
  tar xf noip-duc-linux.tar.gz 
  cd noip-2.1.9-1/
  make install

Screen Shot:

noip.com - installed and configured

Screen Shot (Textual):

[dadeniji@rachel noip-2.1.9-1]$ pwd
/tmp/noip-2.1.9-1
[dadeniji@rachel noip-2.1.9-1]$ sudo make install
[sudo] password for dadeniji: 
if [ ! -d /usr/local/bin ]; then mkdir -p /usr/local/bin;fi
if [ ! -d /usr/local/etc ]; then mkdir -p /usr/local/etc;fi
cp noip2 /usr/local/bin/noip2
/usr/local/bin/noip2 -C -c /tmp/no-ip2.conf

Auto configuration for Linux client of no-ip.com.

Please enter the login/email string for no-ip.com  johnson
Please enter the password for user 'johnson'  ********

Only one host [eph-rachel.no-ip.org] is registered to this account.
It will be used.
Please enter an update interval:[30]  
Do you wish to run something at successful update?[N] (y/N)  N

New configuration file '/tmp/no-ip2.conf' created.

mv /tmp/no-ip2.conf /usr/local/etc/no-ip2.conf
[dadeniji@rachel noip-2.1.9-1]$ 

So everything is good.

Like Steve Winwood, back in the HighLife again.

Validate

From a different host, preferably outside of your network, test your new FQDN.


ping rachel.no-ip.org

We got a good ping, but the IP Address we returned is not the one expected.  We are getting the IP Address of our gateway; that was the address being fed to no-ip when we first created the host record.

Let us go see if we can correct that.

On Linux Host, Run No-Ip Client

On your Linux host, please go run No-Ip Client.

/usr/local/bin/noip2

But, failed with error message…


Can't locate configuration file /usr/local/etc/no-ip2.conf. (Try -c). 
Ending!

 

On Linux Host, Configure No-Ip Client

Though the make command’s output lead me to believe that our No-Ip Client is fully configured, that does not appear to be case.

Let us again try to configure.

/usr/local/bin/noip2 -c

got an error message.


Auto configuration for Linux client of no-ip.com.

Can't create config file (/usr/local/etc/no-ip2.conf)
Permission denied
Re-run noip, adding '-c configfilename' as a parameter.

I really don’t want to specify a configuration file name, as I will like to use the default.

Because of the permission denied heresy, tried again with sudo:


sudo /usr/local/bin/noip2 -c

 

Here we go!

Textual Output:



[dadeniji@rachel ~]$ sudo /usr/local/bin/noip2 -S
[sudo] password for dadeniji:
No noip2 processes active.

Configuration data from /usr/local/etc/no-ip2.conf.

Account dadeniji
configured for:
host rachel.no-ip.org
Updating every 30 minutes via /dev/eth0 with NAT enabled.

Screen shot:

no-ip -- configuration

Validate (v2)

let us try validating again.

Pinged and I am still getting old IP Address.

Launch no-ip client

sudo /usr/local/bin/noip2

Please be sure to launch as sudo, otherwise you will get the earlier error message:


Can't locate configuration file /usr/local/etc/no-ip2.conf. (Try -c). 
Ending!

Validate (v3)


ping rachel.no-ip.org

ping worked!

Configure Dynamic DNS Client to run on start-up

 

Introduction

Once you feel comfortable with your DNS Client, please configure it to run on system start-up.

Thanks Goodness

I am thinking how do I get this thing to auto-start.

I guess that is why folks write instructions.  Here is a good one in the package’s README.FIRST:

README.FIRST

If you want it to run automatically when the machine is booted, then place the following script in your startup directory.

(/etc/init.d/rcX.d or /sbin/init.d/rcX.d or ???)

Where the ‘X’ in rcX.d is the value obtained by running the
following command

grep initdefault /etc/inittab | awk -F: ‘{print $2}’

Killproc can be downloaded from ftp://ftp.suse.com/pub/projects/init
Alternatively, you can uncomment the line after #! /bin/sh

If you have a recent RedHat version, you may want to use the startup script supplied by another user. It’s in this package called redhat.noip.sh

It may need some modification for your system.

There is a startup script for Debian called debian.noip2.sh.
It also has been supplied by another user and is rumored to fail in some situations.

Another user has supplied a proceedure to follow for MAc OS X auto startup.

It’s called mac.osx.startup. Mac users may wish to read that file.

Here are some sample start-up files:

  • debian.noip2.sh (Debian)
  • gentoo.noip2.sh (Gentoo)
  • redhat.noip.sh

So it seems we have a version for Debian, Gentoo, and RedHat.

As our Linux is CentOS, we will go with RedHAT.

Kill existing processes (Prepare Script)

Prepare Script that will kill all running no-ip processes:



#!/bin/sh

for i in  `sudo /usr/local/bin/noip2 -S 2>&1 | grep Process | awk '{print $2} | tr -d ','`

do

    echo "Killing process $i ..."
    sudo /usr/local/bin/noip2 -K $i 

done 

echo "Done"

we will call the script  processKill.sh

Kill existing processes (Execute Script)

sudo sh ./processKill.sh

Start Daemon (Manually)

redhat.noip.sh

sudo sh ./redhat.noip.sh start

 

Output:

no-ip redhad-noip

Everything looks good…let us validate via ps


ps -aux 2> /dev/null | grep "noip" | grep -v "grep"

Output:

 no-ip redhat | ps

Stop Daemon

redhat.noip.sh


sudo sh ./redhat.noip.sh stop

 

Output:

no-ip - service - stop

Everything looks good…let us validate via ps


ps -aux 2> /dev/null | grep "noip" | grep -v "grep"

Output:

no-ip redhat | ps (stopped)

Stage Script

Stage the script.

As we previously shared, our OS is CentOS and we will go with the RedHAT version.  The script’s name is redhat.noip.sh.  Let us copy it over to  /etc/init.d


sudo cp /tmp/noip-2.1.9-1/redhat.noip.sh /etc/init.d

Schedule Script

Schedule script.


sudo chkconfig --level 345 redhat.noip.sh on 

Validate Schedule

Validate Schedule.


chkconfig | grep "noip" 

Output:

noip -- chkconfig -- noip

Our NoIP service is running in all pertinent runlevels; those are runlevel 3,4,5.

References

 

References – Linux – gcc – Install

References – Noip – Installation

References – CentOS – Script

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s