Installing IP Cameras or How I started monitoring my cats

Ophir Harpaz
Extend
Published in
6 min readJul 29, 2017

--

In short: How to install and setup a network camera that is reachable from outside your private network.

Intro

I was never the one to handle connections, cables and routers, until I decided to start watching my two cats while at work (hopefully my boss isn’t reading this).

The two monsters, Xor and Malloc

My boyfriend insisted that I did the whole setup and configuration by myself, which resulted in me leaving behind my hardwareophobia. In this post I intend to write on how I made the cameras start capturing video and enabled remote access to the video with an easy-to-remember domain name.

A Minimal Setup

There are many vendors of IP cameras, and there is a small chance that you and I have the same model. Some of the information in this post is model-specific (and can be easily adjusted to other models) and some is general and should help you in setting up your own network cameras.

My cameras posing.

Network cameras need both power and network connectivity. So first, I plugged in a power cable to the camera. At this point, the camera started turning upside down, round and round and basically did its restart procedure. Next, I grabbed a network cable from our cable-inventory and connected one point to the camera and the other to the router. The camera was now working and capturing.

To be able to watch the picture, I had to connect to the camera using a designated interface. A software named P2P ID Finder was provided by the vendor on a CD which came with the cameras. This software finds IP cameras on the network to which the computer is connected. It allows you to change the IP address of the camera, its name, port number, username and password etc.

Notice that the camera and the router have to be on the same network. If your router’s IP address is 192.168.1.1 with a subnet mask 255.255.255.0, the camera’s IP address must start with 192.168.1.x. If you see a camera whose network settings do not match to those of your router — change the camera’s settings accordingly. If any of these settings cannot be changed for some reason — try factory-resetting the camera using the tiny reset button (usually located at the bottom of the camera, next to a RESET label).

The main display of P2P ID Finder shows the computer network settings, a list of connected cameras and information regarding each camera. The General tab displays the network settings of the selected camera, and the Video Preview tab allows you to watch the live video and change credentials.

P2P ID Finder

At this point, I could open my browser, type in the camera’s IP and see a landing page created by the vendor. This was a good sign.

Wait, what just happened here?

A new member (or host) — the camera — was added to my private network (LAN). It was assigned an IP (something like 192.168.1.100), a port number (80) and a subnet mask (something like 255.255.255.0) to identify the communication to this new device in the network. Such addresses (192.168.x.x) cannot be accessed from outside the private network. So, after all this hard work, I could finally watch my cats… from home. That was practically useless.

Forward to Port Forwarding

The routers we have at home almost always have routable addresses. This means that if you know your router’s external IP address, you can connect to it from anywhere outside the private network. Just figure out your router’s external IP using a “what’s my IP” google search.

Google’s result for “what’s my IP” query

OK, so now we can connect to our router, which is the gateway to our private network. But how do we reach the camera located behind the router? The router needs to know that when a user asks for the camera using a specific port number, this user needs to reach the camera ‘service’. So, I chose port 82 as my camera port, and kindly asked my router to route all requests sent to this port to the camera.

I found the internal IP of my router, browsed to it, typed in the username and the password (usually initialized to admin and admin) and entered a configuration page titled Forwarding. There, I set up the following:

Router, router on the wall

Note that the camera itself has to be configured with this port number too. Scroll up a little in this post to the P2P ID Finder screenshot to see how it can be done via this software.

Having accomplished that, I memorized my router’s external IP and typed it in my browser at work, with the port number I chose (say, 100.101.102.103:82). For the first time, I could watch my veteran cat attack the younger one when I was not there. Raarr!

When I came back home from this productive day at work, the power fell and came back on. When such disasters happen, the router receives a new IP from the Internet Service Provider (or ISP). Moreover, routers may randomly get a new IP from the ISP every time they restart. I started to check my IP every morning before I brushed my teeth, until I got acquainted with the concept of DDNS (or Dynamic Domain Name System).

Don’t Do Numbers, Sister! or: DDNS

DNS servers map names that we can remember (like google.com) to IPs that we can, but don’t want to remember. DDNS makes sure that whenever the IP of some host changes — the DNS server will know about it. It will keep pointing at the correct address when asked for a domain. So basically, all I needed now was some DDNS service that will map a domain name (e.g. cats.ddns-provider.com) to my constantly-changing router’s IP address.

Now, for the catch. Many routers work only with one DDNS service named dyn. Dyn costs money. I don’t like paying money. One option was to sign up to an alternative DDNS service called no-IP, register to a domain name and download a software. This would update a DNS server every time my router’s IP changed. The other option was to check which router my boyfriend had bought. I found out that he got exactly the one which works not only with dyn, but also with no-IP. Great success!

Now, all that was left to do was sign up to no-IP, choose a domain name with my cats’ names in it and put my account details in the router’s DDNS configuration page.

The address malloxor.ddns.net:82 now went directly to my camera’s page. I just needed to put in the credentials and voila! My cats were there in front of my eyes. Meow.

Yo Malloc, I feel like someone’s watching me.

--

--

Ophir Harpaz
Extend
Writer for

@ophirharpaz on Twitter. Security researcher at Guardicore. Reverse engineering enthusiast. Author of https://begin.re.