Cannot access chef-server web interface. (No route to host) - nginx

I have got chef-server installed on a centos machine.
Everything is working as expected except that I cannot access the chef-server web interface from another machine on my local network.
I can access the web interface from the centos machine itself:
telnet mychefserver.local 4000
Connected
If I do the same from my machine I have got:
telnet: Unable to connect to remote host: No route to host
I can successfully ping mychefserver.local from my machine
Any idea how to configure nginx with chef-server to access the chef-server from the network?

Since Chef Server 10, the web interface uses normal HTTPS (TCP 443), it only listens on the high ports locally, and nginx proxies as needed to the different backend services. I would try with a normal web browser as telnet isn't exactly great at error messages. Normally I would expect that to mean telnet is getting TCP transmission errors, but maybe it is just confused? If it is really a TCP transmit error then more likely the internal DNS is having issues. .local often means mDNS which has uneven support in some places, I would try an actual IP address to be sure.

My issue was iptables.
I stopped iptables and I can access the chef-server from my local network again.

Related

How to port forward external IP to websocket server hosted locally?

I have created a local websocket server using the ktor framework, which is available locally in the below IP.
[main] INFO Application - Responding at http://192.168.1.10:8080
And I'm able to access it locally from postman by hitting
ws://192.168.1.10:8080/chat
I would like to connect to this socket from the internet, But when I setup port forwarding (using NAT virtual server configuration), this doesn't seem to work. I get timed out error.
I tried this because, it is working fine for the http server (express app) I created in another port. From the below NAT virtual server configuration, I was able to do port forwarding and access the webservice from the internet.
I'm quite new to socket programming and networking. Kindly advice.
You can't have a single External Port mapped to two different Server ports. Each Server needs a distinct External Port mapped to it. Right now, you have External Port 80 mapped to both 192.168.1.10:3000 and 192.168.1.10:8080.
Once you fix that issue to use a separate External Port for each Server, then http://<externalIP>:<externalPort1> and ws://<externalIP>:<externalPort2> should work properly to reach the HTTP and WebSocket servers, respectively, from the outside world.

How can I configure TCP client to go through proxy via localhost?

Currently I am using SwiftNIO and have a echo server and client. I was using SquidMan to create a local proxy, then I configured the proxy on my machine via system preferences. When I look at my Wireshark captures, I only see packets go directly from my client to my server and vice-versa. How can I configure it so that my client must go through the proxy first?
Note: I've also tried running my server on a VM and running a proxy on a separate Windows Laptop on my Network.
When I go to System Preferences -> Advance -> Network -> Proxies on my Mac I configured HTTPS/HTTP to point to the proxy I have running on my Windows Laptop. Is there something more I have to do?
on the machine running SwiftNIO echo server/client service, repoint your TCP/IP default gateway to the address of your Proxy server....proxy server will then NAT translate for your SwiftNIO and return correct packets on your behalf
I may not be understanding your issue, but this seems easy

Cannot Ping Or Remote Desktop into Hyper-V PC Via IP Address On Host

I have a bit of a bizarre problem. I have a Hyper-V VM and I cannot connect to it via IP address on the host computer.
I intend to use it as an SQL server to host a database for a website while I test it, and the first step I can see in this endeavour is to make sure the IP addresses work externally.
Other PCs on the LAN appear to be able to connect just fine via the IP address on Remote Desktop. I cannot do so. I also cannot connect through SQL Management Studio (named pipes or TCP/IP). Although named pipes gives an error relating to being denied access as opposed to IPs which are just not found.
I have tried pinging both ways:
VM => Host : Always gives a "Destination Host Unreachable" error
Host => VM: Always gives a "Request Timed Out" error
As for netstat -a -n, I can see that the VM is listening to 3389 (default Hyper V port, which makes sense).
Regarding Firewalls, all have been turned off on all machines. I can tell that the firewall is not the issue.
If you need any more information to help me to diagnose and treat the problem, please ask me as I would like to get this sorted as quickly as possible.
Thanks a lot in advance.
Which windows server version do you use?
Windows Server 2016 blocks insecure RDP connections (https://support.microsoft.com/en-us/help/4295591/credssp-encryption-oracle-remediation-error-when-to-rdp-to-azure-vm).
Since RDP uses CredSSP you have to install the current Windows Patches.
Do you can ping the DNS server by IP address from your VM?
Is ICMP (ICMP = the thing you need for ping) on your host enabled?
Here is a Checklist for ICMP:
https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/cc749323(v=ws.10)
Solved,
Just switched to another physical computer and it was fine.

Is it possible to connect with remote desktop but not be able to ping to the same machine?

It seems I have this weird issue I can't really understand. I am able to connect to a remote computer (windows machine) with remote desktop perfectly but I am not be able to ping to it. When I ping I get timeout all the time. It is the same ip address and I am using the same computer, so there are no firewall issue I think. From what I know ping is using it own protocol (different than TCP and UDP) so you don't ping to a precific port
Yes it is. The system administrator, and the network administrators (of the several networks you need to use to access the remote machines), are able configure their boxes to disable ICMP. Then ping does not work, but HTTP or ssh (or whatever protocol your remote desktop uses) could work.
ICMP is often disabled for security reasons, and to lower the load on the remote computer. It makes slightly harder to find the remote host.

Send HTTP POST to API server running on localhost from another PC

My web server is running on localhost (127.0.0.1:8800) and I would like to send HTTP posts from another machine to that server.
Does anyone know how I will be able to access the server from the outside? (I did a SSL port forwarding from the external address to localhost, but it is a kind of hack and some aspects do not working properly, e.g. web socket does not detect traffic that's been forwarded)
127.0.0.1 is the loopback address of your network card. Only your computer can access that. 127.0.0.1 on any other computer will be that other computer.
You will have to run your server on your internal ip-address (if you're doing this in an internal network). It will probably look something like 192.168.0.x. If you're instead connecting to the computer using the internet you will of course have to bind the server to the external ip-address.
You can find your internal ip-address on Windows by opening cmd.exe and typing ipconfig. On OSX or Linux/BSD you run ifconfig in a terminal.

Resources