Perhaps not correctly titled the question. The problem: in the local network there are IP cameras with local addresses from the range 192.168.0.0; there is a server (Ubuntu Server), with two interfaces - one local on the same subnet, the other on the Internet looks. Cameras for HTTP issue a picture. On the server also raised the site. Actually on this site should be pictures from cameras. Post pictures from the stream is not a problem. The question is how to deal with the addresses of the cameras?

If to use links to a flow

http://admin@192.168.0.25/image/jpeg.cgi 

get nonsense, because local address.

  • Maybe portforwarding through iptables and different ports for each camera on the external interface? - Alexey Kotov

3 answers 3

So you have an external address, make a script that will parse the request from the outside, for example http://external_ip(host)/25 , and issue a picture from the camera to it (since the server knows both networks, it will be able to upload a picture and send her in ext.) You can still think with .htaccess (mod_rewrite) so that it passes the necessary link to the script, and the script will only deal with getting the picture.

The second option is to configure the http-server in proxy mode and point it to the necessary resources, but this option is almost the same as the first: simply the link will be resolved by different "instances".

    If I understand correctly, then you need to use NAT.
    192.168.0.25 - is the address of one of the cameras?

    • Yes, this is the camera address. As far as I understand, NAT is not suitable - only one address with one port 80 will be visible from the outside. And how to understand where the camera is unclear. - Alexey Kotov

    Fits, your link just looks like:
    http: // admin @ external server ip : port / image / jpeg.cgi
    The port will be set using NAT

    • Then portforwarding - Alexey Kotov