LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-02-2015, 02:07 PM   #1
EPS
Member
 
Registered: Feb 2008
Posts: 44

Rep: Reputation: 0
I Cannot make my device talk to my server


I am new to networking, so there are a many things that I do not understand.

I have set up an old pc as a server and have installed Ubuntu 12.04 server.
I have a router connecting it to the internet.
I have devices connected to it locally.
I can ping all the following IP's
127.0.0.1 ( I Don't know what this is. )
127.0.1.1 ( this is my PC server hostname "Server1")
192.168.1.1 ( my routers IP )
192.168.1.20 ( this is the device I want to connected to my PC server )
192.168.1.50 ( the fixed IP that I have assigned to my PC Server in the router)

From my laptop, plugged into the router, I can putty into my server ok.

From my laptop I can access the device and set the following info:
URL: IP:PORT
username
pwd

and or the Networking menu, where I can either tick the DHCP box,
or enter values for: IP address; Netmask ; Gateway IP and DNS IP

I have tried all sorts of combinations. Nothing works.
The device does not recognise my PC server.
Where am I going wrong ?
any ideas ?

Last edited by EPS; 01-03-2015 at 05:18 AM.
 
Old 01-02-2015, 02:44 PM   #2
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,869

Rep: Reputation: 162Reputation: 162
How do you configure the device, statis or dynamic IP?
 
Old 01-02-2015, 03:10 PM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,926

Rep: Reputation: 6000Reputation: 6000Reputation: 6000Reputation: 6000Reputation: 6000Reputation: 6000Reputation: 6000Reputation: 6000Reputation: 6000Reputation: 6000Reputation: 6000
What is your device and what do you mean by talk to the server?
 
Old 01-02-2015, 04:00 PM   #4
EPS
Member
 
Registered: Feb 2008
Posts: 44

Original Poster
Rep: Reputation: 0
My ISP gives me a dynamic IP, but behind the router I have assigned Static IP's to each device,
In the router I have assigned 192.168.1.20 to the device I want to connect to, (its a camera I bought 2nd hand in Bangkok, but without any documentation).
and I have assigned
192.168.1.50 to the PC box that I have running as my server.

I have learned that 127.0.0.1 is Localhost, when I type in #localhost.localdomain and 127.0.1.1 is the IP shown as my PC box.

This confuses me, as apparently I have two IP's for the same piece of equipment. ( should I not have allocated an IP to it in the router ?

I have been reading about ports and port forwarding, but not really fully understanding this.
Do I need to assign a port number ( as part of the IP address )for each device even if it is within my own LAN, ie behind my router ? and what does port forwarding mean ? Do I do this in the router or in my server-PC box.
 
Old 01-02-2015, 11:08 PM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,926

Rep: Reputation: 6000Reputation: 6000Reputation: 6000Reputation: 6000Reputation: 6000Reputation: 6000Reputation: 6000Reputation: 6000Reputation: 6000Reputation: 6000Reputation: 6000
Basically 127.0.0.1 (localhost or local loopback device) is a virtual IP address exists on all network capable devices to access network services from itself. The physical network adapter is assigned an IP address like 192.168.1.50 either as a static or via a DHCP server.

A good analogy is that the IP address / port number is like a street address / apartment number. There are 65536 available ports and the port number is defined by the service i.e. some defaults are web server is 80 and ssh server 22.

Basically port forwarding is translating an IP address/port to a new destination. An example is if you want to access a web server on your local network from the internet. You would set up port forwarding for port 80 on the router to the IP address of your server.

So you can access the IP camera from your laptop. Without knowing anything about the camera is a bit difficult to provide help. One type of camera will send pictures based upon a time interval or movement to a ftp server. You would need to configure a ftp server on your computer.
 
Old 01-03-2015, 05:15 AM   #6
EPS
Member
 
Registered: Feb 2008
Posts: 44

Original Poster
Rep: Reputation: 0
Thanks Michaelk,
I appreciate your taking time to offer me some help.
For my own understanding can I ask you to clarify in my mind what I need to do.
You say that I need to Port Forward port 80 to the IP of my Server.

So I log into my router, go to port forwarding.
There I see a mask showing WAN Interface: PVC0 ... PVC9
and a table of data that needs to be filled:

Service name: -( user Defined )
External Start Port:
External End Port:
Server IP Address:
Protokol - ( all )
Open Start Port:
Open End Port:

So, do I just choose a number, say "5432", as the port I want to forward, and just enter it everywhere into the table ?
using 192.168.1.50 as the IP address for my server, ( ie the IP address that I allocated to it in my router )
Or do I need to enter my own IP address from my ISP. ( which is 86.25.vw.xyz )
 
Old 01-03-2015, 07:12 AM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,926

Rep: Reputation: 6000Reputation: 6000Reputation: 6000Reputation: 6000Reputation: 6000Reputation: 6000Reputation: 6000Reputation: 6000Reputation: 6000Reputation: 6000Reputation: 6000
Port forwarding at the router would only be required if you were trying to access the camera from the internet. I was just trying to provide a basic explanation of what port forwarding does.

The port number is set by the service i.e. in this case your camera.
 
Old 01-03-2015, 08:14 AM   #8
EPS
Member
 
Registered: Feb 2008
Posts: 44

Original Poster
Rep: Reputation: 0
Ok, got that, so I do not need to bother with port forwarding.
One last Q if I can trouble you a bit more:

Is there a way for me to find out which port within my LAN that the Device is on ?
thx,
-e
 
Old 01-03-2015, 08:44 AM   #9
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,926

Rep: Reputation: 6000Reputation: 6000Reputation: 6000Reputation: 6000Reputation: 6000Reputation: 6000Reputation: 6000Reputation: 6000Reputation: 6000Reputation: 6000Reputation: 6000
The following will show all the open ports on your device.

nmap -v -sT 192.168.1.20 (The IP address of your camera)
 
Old 01-03-2015, 09:54 AM   #10
EPS
Member
 
Registered: Feb 2008
Posts: 44

Original Poster
Rep: Reputation: 0
That worked, Michaelk. I got this back:

discovered open ports:
22 ssh
80 http
139 netbios-ssn
445 Microsoft ds
3333 dec notes
9000 cslistener

So the device is there and available.
I think I have learned a wee bit more now, so I will try a few things out.
There is no data to lose on my PC-box server, so the worst that can happen is that I need to reinstall Ubuntu, and throw camera in the bin.
I appreciate all your replies,
thanks,
-E
 
Old 01-03-2015, 10:31 AM   #11
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,926

Rep: Reputation: 6000Reputation: 6000Reputation: 6000Reputation: 6000Reputation: 6000Reputation: 6000Reputation: 6000Reputation: 6000Reputation: 6000Reputation: 6000Reputation: 6000
Did you verify the IP address used in the nmap command was that of the camera?

Port 139 and 445 is used by Microsoft's file and printer sharing networking protocol CIFS/SMBFS (samba in the linux world). You should be able to access files saved by mounting a share on the server.

I believe you have already used the camera's web setup pages (port 80 httpd). 3333 and 9000 are open but I can not say what service is using it. What is reported in the output is what ever is saved in the /etc/services file.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
possible to use a modem (rj-11) to talk to a serial device? /dev/random Linux - Hardware 3 02-21-2013 02:55 PM
Device Drivers explained in hardware talk. theKbStockpiler Linux - General 3 01-29-2012 12:17 PM
talk to device on ttyACM0 using C programming v333k Programming 9 04-07-2009 12:05 PM
device mapper / multipath creating extra device, won't let me talk to the one i want chakkerz Linux - Server 1 03-16-2008 05:52 PM
How to make talk work ajaz_javeed Linux - Software 1 02-01-2007 04:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration