Using tsocks to access external-networks which have only one machine accessible with public-world addressible machine - ssh

We have a set of machines in a datacenter. Only one of the machines is accessible from the internet-world. If we need to talk to any other machine in the datacenter we would need to login to this internet-visible machine.
We have a monitoring web-tool which monitors all the servers. For this to work I needed the browser to be in the same lan as datacenter. I made this possible by using dynamic-forwarding a port from my local machine to the world visible machine and set this port as the proxy on my browser .. this worked fine.
Now I wanted to use some command-line tools which needed to talk to all the machines in the datacenter. The only way I could make that work was to login to world-visible machine and run my commands from there.
After looking around on the web, I discovered(could be wrongly) that I can use tsocks to achieve the goal of running my command line tools on my local machine as-if they are running in the datacenter network. However, I am having trouble getting them work. I am attaching the tsocks.conf file I created
local = 192.168.81.0/255.255.255.0
local = 0.0.0.0/255.255.255.255
path {
reaches = 192.168.5.0/255.255.255.0
server = 0.0.0.0
server_port = 8080
server_type = 5
}
path {
reaches = 10.125.4.0/255.255.255.0
server = 0.0.0.0
server_port = 8081
server_type = 5
}
path {
reaches = 10.110.80.0/255.255.255.0
server = 0.0.0.0
server_port = 8082
server_type = 5
}
I have all the three server_ports mentioned above dynamically-forwarded using ssh and I am able to use each of them as a proxy for my browser with no trouble to access machines on each of the three datacenters but doing
. tsocks -on
and pinging one of the machines does not give me any response.. It does not look like my set up is working... can somebody help?

Sorry for the wrong question. Everything was working fine. I was trying to ping a server in the network which was configured not to respond to pings at all. Other operations such as ssh work fine. So the proxy was setup properly. just the way I was testing was wrong.
Thanks,
Sunil.

Related

WAMP SSL - LOCALHOST and connection problem from another VM

I set up 2 VMS connected to each others , ping is working on both machine.
After that , I set up a WAMP serveur on machine 1 and managed to configure SSL on it. It's working on local host as described on this tutorial.
https://zuziko.com/tutorials/how-to-enable-https-ssl-on-wamp-server/
Now my problem is i need to be able to connect from the browser of VM 2 on the wamp server with SSL.
That's where i have a problem.
From Vm2 when i connect to VM 1 ( 192.168.56.10:8080) it's working
when i connect to 192.168.56.10:443 i have a bad request.
I am missing something .. can someone point me out where to look ?
thank you very much
enter image description here

webrtc app show my Turn server broken, but it works

I have my stun / turn server running on local pc (CoTurn). It is tested on "https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/" and works. I have a domain name and configured the modem with public ip. I configured apache2 to make the site visible to the world. I have active and valid letsencript certificates. Everything works in short. But the test application starts the connection (the external pc communicates with the local via socket.io) but then the video is not seen and the console returns the error: ICE failed, your TURN server appears to be broken, see about:webrtc for more details.
The link of the application that I use as a test, because with my original I had no comparisons to make. First time with socket.io. But socket.io send and receive messages so these not appear a problem for now.
https://github.com/anoek/webrtc-group-chat-example
P.S.:
Ok. Server is behind the nat. My app (but linked app too) work very fine on local network (sorry I checked this point first before). These with my turn/stun server, than with public stun/turns google servers. This evidently indicates a bad setting of apache2 server or/and turn server. Where could I find a guide about it?
My server situation: myServerIpLocal-xxx.xxx.xxx.xxx -> nat/router/modem WithPublicIpStatic-xx.xx.xx.xx. I can see my sites from all the world, but turn server not work outside the local network. Inside local network work ok.
these my turn config:
listening-port=3478
tls-listening-port=5349
alt-listening-port=3479
alt-tls-listening-port=5350
listening-ip=xxx.xxx.xxx.xxx /*mylocal ip*/
relay-ip=xxx.xxx.xxx.xxx /*mylocal ip*/
external-ip=xx.xx.xx.xx /*my public ip on nat/ruter/modem */
min-port=49152
max-port=65535
verbose
fingerprint
userdb=/var/lib/turn/turndb
realm=mysite.com
cert=/etc/ssl/certificate.pem
pkey=/etc/ssl/private.key
dh-file=/etc/turn/dhparam.pem
no-stdout-log
log-file=/myhome/.turn/turn.log
lt-cred-mech
user=myusername:mypasswd
# Turn OFF the CLI support.
# By default it is always ON.
# See also options cli-ip and cli-port.
#
no-cli
#Local system IP address to be used for CLI server endpoint. Default value
# is 127.0.0.1.
#
cli-ip=127.0.1.1
# CLI server port. Default is 5766.
#
cli-port=5766
# CLI access password. Default is empty (no password).
#
cli-password=logen
no-sslv3
no-tlsv1
my old code on turn.conf:
lt-cred-mech
user=myusername:mypasswd
but turn work only locally .... probabily because I use:
sudo turnserver -L myPublicIp -o -a myrealm
at every coturn start command ....
actually I try not use the command "turnserver" and I try to use onlu sudo coturn start .....
basically in my turn.conf file I change these:
lt-cred-mech
user=mypasswd:myusername /***** mind the gap ;) *****/
these because my index.js file debug never see my external connection as authrized user ..... magically at these time my app perform webrtc multiple connection with every pc and mobile .... inside and outside my lan .... (I try connect my appa from phone in barcelona spain to other one in london with good result).
May be coturn wiki need to update?
Finally I would like to thank the serverfault and super-user guys who rejected my question. Since I had to make arrangements, I was able to acquire new and interesting information on this subject.
regards

Accessing localhost outside of server

I am new to node.js and am trying to get into the hang of actually using it. I am very familiar with JavaScript so the language itself is self-explanatory but the use of Node.js is quite different from the browser implementation.
I have my own remote virtual server and have installed Node and the Package Manager and everything works as expected. I am not exactly a server extraordinaire and have limited experience with the Terminal and Apache Configurations.
I can run my server using:
nodejs index.js
Which gives me: listening on *:3300 as expected.
I can then access my localhost from the terminal using: curl http://localhost:3300/ which gives me the response I expect.
Given that the website that links to my server is https://example.com, how do I allow this link to access: http://localhost:3300/ so that I can actually use my node server in production? For example, http://localhost:3300/ runs a Socket Server that I would like to use using Socket.io on https://example.com/chat.html with the JavaScript:
var socket = io.connect('http://localhost:3300/', {transports: ['websocket'], upgrade: false});
Ok, this question has nothing to do with nodeJS.
localhost is a hostname that means this computer. it's equivalent to 127.0.0.1 or whatever IP address you can refer to your computer.
After the double colon (:) you enter the port number.
So if you want to make an HTTP call to a web-server running on your server, you have to know what is the IP address of your server, or the domain name, and then you call it with the port number where the server is running.
For Instance, you would call https://example.com:3300/chat.html to make an HTTP call to a server running on example.com with port 3300.
Keep in mind, that you have to make sure with your firewall configuration, that the specific port is open for incoming HTTP requests.

Install Apache server on 4G Network

I have installed XAMPP to run Apache server on windows,So the Apache server run great on LAN (Local Area Network ).
But i need to run the server ,so the public can access it from WAN
(Wide Area Network) .
I have forward HTTP port 80 on 4G portable router ,but no device can access the Apache server from Public (WAN)
** I have tried DDNS solutions also with no success.
The issue is most likely the 4g network itself. It seems they don't allow servers to wait on their network.

Apache home server connects to domain inside network and not out

Hello i have an old windows xp pc im trying to turn into a server for hobbyist purposes. I downloaded and installed the apache xampp 1.8 distribution. Once installed and tested that the localhost worked, I connected my domain to my servers ip. So my problem is when i tried to connect to my site on my pc on the same network, they all were able to load the domain/site inside the network successfully but when i have a pc thats outside the network try it fails. Any ideas?. thanks.
You have used a private IP instead of public IP so it does not get resolved to your server. You have to use a public IP (if you have a static IP from your provider you have to setup port forwarding on your router.) If you get the IP from DHCPD server you will need to use dynamic DNS and port forwarding.
More info on private networks: http://en.wikipedia.org/wiki/Private_network