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 Credibility.  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 procedure 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

Technical: Linux\CentOS – Network – Full Qualified Domain Name on Comcast Home Network \ In-house DNS Server

Technical: Linux\CentOS – Network – Full Qualified Domain Name on Comcast Home Network \ In-house DNS Server

Introduction

I have a little home Network behind my Wireless Access Point.  But, lately one of the boxes that I need to access has being up and down.  And, I really need it to be up.

Quick Analysis

I am bit disinclined to do heavy network troubleshooting. I just need need things up; reliably and running.

What is wrong?

  • Is it a Comcast problem; btw Comcast is my ISP
  • Is it just this old LinkSys Home Router – I have it fronting the internal network; acting as a DHCP host, distributing IPs and forwarding network packets based on Port Forwarding – Traffic Cop, the good one – Looks at Port# and sends it over to specific machines
  • Is it my Linux box (CentOS)
  • It it an on \ off again Software Firewall on the Linux box

Usually, it wouldn’t bother me.  But, I really need to learn.

Comcast Network (thinking….)

I know I am entitled to 5 IPs from Comcast; and I have a spare one.

So for this one host that I need to communicate with, I will like to bypass the LinkSys Router and connect directly to the network switch that is connected to the Cable Modem

Comcast Network (Connected)

Once that connection is made, I have a good world reachable IP Address.  Hopefully, it will stay up and available.

Fully Qualified Domain Name

As the host is a box that will be running Hadoop, I know I need really good and firm FQDN.

What is the Network Domain Info

What is Comcast DHCP giving out?

Checked /etc/resolv.conf and have this entries:

Entry Value
domain hsd1.ca.comcast.net
search hsd1.ca.comcast.net
nameserver 75.75.75.75
nameserver 75.75.76.76

What do we want it to be?

I really do not care much about the details.  But, I need to be able to control my destiny; which means having my own domain data:

Here is what we came up with:

Entry Value
domain labdomain.org
search labdomain.org
nameserver 24.6.75.90 (labdomain.org DNS Server)

DNS Server Changes

Create A and “Reverse Lookup” entries for our linux host.

Our DNS Server happens to be a Windows based, and we will just use a GUI to make the changes.

DNS - A Entry

Linux Node DNS Changes

On the linux node, update /etc/resolv.conf with our updated DNS entries.

# Generated by NetworkManager
domain labDomain.org
search labDomain.org
nameserver 24.6.75.90

Explanation:

  • Our domain name is labDomain.org
  • Our DNS Suffix is labDomain.org
  • In our case, as we getting an IP from Comcast and a home grown network domain, we need to ensure that we choose our own DNS Server (that is also reachable over the Net).

Work Arounds

In case you do not have a good DNS Server or limited network addresses, please consider using a third party Dynamic DNS Provider.

My favorite used to be http://dyn.com/dns/, but it seems that they are pulling back on free FQDNs.

Though, I have yet to try noip.com, I have being hearing good things about it.