How to install peerjs server on windows server with multiple IP addresses - windows

I have installed the peerjs server on my windows server as per github, and successfully get the message:
“Started PeerServer on ::, port: 9000, path: /myapp”.
I then opened port 9000 in the windows firewall, and find the following two entries in the netstat listing:-
TCP 0.0.0.0:9000 vmBCE3892:0 LISTENING
[node.exe]
TCP [::]:9000 vmBCE3892:0 LISTENING
[node.exe]
My server has 2 different IP addresses for 2 different web applications under IIS.
To check peerjs connectivity I used telnet as follows:-
telnet ipaddress 9000
with each IP address, neither would connect.
I cannot see how to tie the peerjs server to one of the ipaddresses or the corresponding domain name.

It seems that my ISP blocks all ports other than 80 & 443, despite them appearing to be available in my firewall. As for the two IP adresses, either would have reached peerjs server had the port been open.

Related

Can't access ec2 instance via fsockopen in PHP pointed at my ec2 public IP and designated port

Before anything else, I have read about 30+ StackOverflow answers and none of them seem to address my particular flavour of this problem. Below I list all the answers I have already tried before asking for more advice.
I am trying to access my ec2 instance via socket in PHP from a different machine via fsockopen, pointed at my ec2 public IP (I have an Elastic fixed IP address 54.68.166.28) and designated port.
Behaviour: I can access the instance and the ChatScript application running inside from within the instance, via the public IP directly on the browser. But if I run the exact same webpage with the exact same socket call on an external machine targeting my instance's IP address (double checked it is the correct one) I get a 500 Internal Server Error when connecting on port 1024 (for my custom TCP connection), another 500 on port 443 (HTTPS). On port 80 (HTTP) it hangs 20+ seconds then gives me status 200 success, except it does not connect properly to the application and responds with nothing.
Troubleshooting:
I have set up my security group rules to accept incoming TCP from anywhere:
HTTP (80) TCP 80 0.0.0.0/0
HTTP (80) TCP 80 ::/0
HTTPS (443) TCP 443 0.0.0.0/0
HTTPS (443) TCP 443 ::/0
Custom (1024) TCP 1024 0.0.0.0/0
Custom (1024) TCP 1024 ::/0
Outbound rules span port range 0 - 65535 with destination 0.0.0.0/0, so should work.
I ssh every time without problems into the instance on port 22. SCP also works fine.
Checked $sudo service httpd status: running, which is why my UI displays there fine.
Checked $sudo /sbin/iptables -L and all my policies are set to ACCEPT with no rules
Checked $ netstat --listen -p and the app I am targeting is listening on port 0.0.0.0.0:1024.
Checked Network Utility and ports 80 and 1024 are registered as open. Port 443 is not. Pinging did not work for any of them, with 100% packet loss.
Checked my instance is associated to the security group with all the permissions - it is. IP is clearly correct or I could neither ssh nor serve webpages... which I can.
I stopped and restarted the instance.
I replaced the instance.
I think this is due diligence before asking for help... now I need it!
I realised my configuration was correct: the problem was that the hosted domain I used for the GUI, like most hosted domains, does not open custom ports, so tcp did not work.

How to open HTTPS port in Google cloud?

Hello today configured vps on Google Cloud and put Vesta control panel, but the problem is not open one https that is, and the ip server and the domain itself does not open on https. Set up Google Cloud firewall and opened ports 80,443 but https does not open the site itself is not the ip of the server. Checked through online services port 443 is closed but settings of the server and a firewall of Google and ip tables say that port 443 is opened (checked by several services port 443) and in the browser through ip of the server and the domain on https do not open. Please tell me how to open port 443?
Same with ports 8443,8080.
I am not able to comment but here are some steps that might help to isolate the issue:
Check to see if the port is open or closed or filtered using nmap
nmap [ip_address]
Firewall rules are defined at the network level and therefore make sure that you follow this document while creating the firewall rules to allow incoming traffic on TCP port 80 and 443 (same for other ports). In this document in step 11, choose " specified protocols and ports" and enter tcp: 80, tcp: 443.
As you previously stated, you need to make sure there is no firewall running inside the VM blocking those connections.
You also need to verify if the application running on your vps is listening on port 443. To check this, try with this command.
sudo netstat -ntlp | grep LISTEN
In the output, if you don't see the application beside port number, check if your vps is rightly configured to ports for your application.
I was having the same issue with NGinx. And Found the root cause finally to be the Firewall (GCP VM Firewall) having a lower priority for the rule. ie: I had 65534 (which is super low priority) for the "Ingress 443" rule. Which did block the traffic coming into the SSL. Instead when I set this rule to 1, traffic started flowing and issue sorted.
What finally helped me was https://cloud.google.com/vpc/docs/using-firewalls
Thanks #Md Zubayer for the tip.

FTP server running on Port 2000 over NAT not working on Passive Mode

I am running FILE-Zilla ftp server on windows in one of the LAN pc connect to my router. i am trying to access the FTP server from the network outside of the router using Router WAN ip (WAN-to-LAN) by adding Port-Forwarding rule (NAT) in the router. I have 2 cases here as per below configurations. the 1st is working and the 2nd is not (in Passive mode).
Note: i have added the custom inbound rule in the windows 7 firewall
where the ftp server is running.
Configuration #1
Filezilla FTP server port: 21
Passive port range: 50000-51000
NAT - external port: 21
NAT - internal port: 21
Windows firewall inboud rule port allow port: 21, 50000-51000
Client connecting to: <Wan IP>:21
This is working if client is trying to connect using Active/Passive mode
Configuration #2
Filezilla FTP server port: 2000
Passive port range: 50000-51000
NAT - external port: 21
NAT - internal port: 2000
Windows firewall inboud rule port allow port: 2000, 50000-51000
Client connecting to: <Wan IP>:21
This is working only if client is set to Active mode.
Not working with Passive mode configuration by client. the client can connect and login is successfull but ends with the error message at server side like this without any directory listing.
227 Entering Passive Mode (192,168,1,2,195,85)
Note: both the case working in LAN-LAN network.
My guess is that the configuration #1 works only because the NAT is smart enough to translate the IP address in the PASV response from the server. But it likely does that only for the standard FTP port.
You should tell the FileZilla FTP server its external IP address. Go to Edit > Settings > Passive mode settings > IPv4 specific > External Server IP Address for passive mode transfers.
Currently your FTP server is sending its internal IP address to the client. And the client obviously cannot connect to the IP address.
And have the NAT forward the ports in the passive port range (50000-51000).
Though the change will break the LAN-LAN connections. To allow both LAN and WAN connections, check if the NAT can be configured to translate the IP address for the non standard ports too. Though the translation will work for unencrypted connection only anyway. And you should not use unencrypted connections!
The last option is to use the extended passive mode (EPSV), if your clients allow that. In the extended passive mode, there's no IP address in the response. The FTP client uses the primary IP address of the FTP server for data connections.

How to rewrite the TCP destination port during the TCP connection on Windows?

I have a client which is intended to connect to a server. For the client, the remote TCP port number is fixed(i.e. 102). I can NOT change it(while I can change the remote IP address). However, the TCP Port number the server is listening on is fixed as well(i.e. 1024) and I can NOT change it too. These two port numbers are different. I want to make the client connect to the server smoothly.
At the first, I had a idea that I setup a proxy listening on localhost:102 and the client connect to 127.0.0.1:102. Then this proxy redirect these TCP traffic to the real address RemoteServerIP:1024. But I found on my windows, there was already a process which is listening on 0.0.0.0:102 and I can NOT change its listening port. So this idea can NOT work.
Thank you very much.
if you cannot do it on the same windows machine running client, why not try to do it on another (linux maybe) machine?

ssh windows 7 connection refuser

trying to connect from localhost
ssh <MyLogin>#localhost - connected
trying to connect from another computer in my local network
ssh <Mylogin>#<MyServerLocalIp> - connected
trying to connect from internet
ssh <Mylogin>#<InternetIp> -conection refused (it not appears in my log file)
i'm check 22 port in this site http://www.canyouseeme.org/ - 22 port is open and it appears in my log file
trying use telnet
telnet InternetIp 22 - not connected
but when i'm trying another port
telnet InternetIp 21 - connected
This sounds like you are behind a NAT Router.
If this is the case, what you will need to do is first ensure your machine has a static IP address. This will likely be something like 192.168.1.x. You can configure this in your router by either mapping your machines MAC address to a DHCP assigned address or just configuring you machine with a static IP and checking that that IP is not in the DHCP range.
Then you will need to configure your Router to forward inbound port connections to the local IP address of your machine. Here is an article on Wikipedia about Port Forwarding: http://en.wikipedia.org/wiki/Port_forwarding
Your best bet is to download the manual for your specific Router and look up the section on port forwarding. It is often in the section about the routers Firewall.

Resources