LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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 11-19-2007, 06:31 AM   #1
kool_kid
Member
 
Registered: Sep 2004
Location: Dubai, UAE
Distribution: RHL
Posts: 350

Rep: Reputation: 30
single ip with multiple ports .....possible??


Hiya

My company got cctv camera's, now there want to assign single ip to about 10 camera but the they want to have access each camera with its port number

example:
cam1 ip >10.0.0.50:80
cam2 ip >10.0.0.50:81
cam3 ip > 10.0.0.50:82

the ip i have chosen is just an example one i want to focus on port number rather than ips.


There is an option to get this done through Router(Netlink router) im eager whether it is possible to do the same using Linux Box (making it as a router)??.
 
Old 11-19-2007, 06:32 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,379

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
what's possible depends on what this camera is... are they networked? usb? we can't really help if you don't actually tell us about what these things are. there's certainly no reason you can run multiple web services on different ports, apache can do that without thinking...
 
Old 11-19-2007, 07:33 AM   #3
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,990

Rep: Reputation: 67
Assuming that the cameras are each connected to the same network, with separate network cards each, then that's not directly possible.

Each IP address on the network relates to one network interface controller (NIC), being one network card. Each NIC can have several IP addresses.

You would have to assign each network card its own IP address, and then set up 10.0.0.50 as a NAT-ing router. You can then redirect ports on the router to point to the various cameras.

e.g. let's say camera 1 is at 10.0.0.1 and camera 2 is at 10.0.0.2, and the router (any old linux box would do) is at 10.0.0.50 as in your example. You can then set up port redirection to forward port 10.0.0.50:80 to 10.0.0.1:80, and 10.0.0.50:81 to 10.0.0.2:80.

You could even set up the cameras on a separate subnet if the number space becomes a problem. The router would just need two IPs , say 10.0.0.50 and 10.0.1.50, and routing table entries to direct both subnets to the card. (Or change the netmask to 255.255.127.0 so the router thinks of it as one subnet, but that can get very confusing).
 
Old 11-19-2007, 08:37 AM   #4
kool_kid
Member
 
Registered: Sep 2004
Location: Dubai, UAE
Distribution: RHL
Posts: 350

Original Poster
Rep: Reputation: 30
okay here is exactly what i, i just confirmed it lol,

there are camera's and these camera's will in LAN through a switch. Now ppl from other part of the world should be able access all the camera whenever they want (sort of a website kinda service u may think of). So how to achieve this using linux box?

Last edited by kool_kid; 11-19-2007 at 08:53 AM.
 
Old 11-19-2007, 09:19 AM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,379

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
so these systems already have their own ip address? this sort of translation..?

1.2.3.4:80 --> 1.2.3.7:80
1.2.3.4:81 --> 1.2.3.8:80
1.2.3.4:82 --> 1.2.3.9:80
1.2.3.4:83 --> 1.2.3.10:80

on the linux box (1.2.3.4) this shoudl just be:
iptables -t nat -A PREROUTING -p tcp --dport 80 -i eth0 -j DNAT --to 1.2.3.7:80
iptables -t nat -A PREROUTING -p tcp --dport 80 -i eth0 -j DNAT --to 1.2.3.8:80
iptables -t nat -A PREROUTING -p tcp --dport 80 -i eth0 -j DNAT --to 1.2.3.9:80
iptables -t nat -A PREROUTING -p tcp --dport 80 -i eth0 -j DNAT --to 1.2.3.10:80
 
Old 11-19-2007, 09:56 AM   #6
kool_kid
Member
 
Registered: Sep 2004
Location: Dubai, UAE
Distribution: RHL
Posts: 350

Original Poster
Rep: Reputation: 30
so if any1 wants to check the camera he should issue the ip http://1.2.3.4:80 in the web browser and he will get access to it, am i right?
 
  


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
Multiple writer Single reader adi22pal Linux - Software 5 10-10-2006 07:28 PM
multiple domains on a single m/c for sendmail p_test Linux - Networking 1 04-26-2006 12:45 PM
single IP multiple services mchitrakar Linux - Networking 4 06-02-2004 07:58 PM
Single IP Multiple Domain H.K.Shahid Linux - Networking 1 09-06-2003 02:08 PM
multiple OS on single HDD darkangel Linux - General 7 08-31-2002 01:35 PM


All times are GMT -5. The time now is 11:28 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration