I have a program that runs from wsl 1 listening to grpc requests under port 5032. When I want to communicate from windows to that program I use host name localhost and the specified port, it works. But when I tried to look up the ip address via ip route and sending requests to that ip with the same port from different machine it didn't work.
Is it possible to send requests from another machine to wsl?
If yes, what should be done: maybe some additional configuration is needed or could I use the wrong ip?
Related
Basically I need to send data from Esp8266 to a server which is created using XAMPP on the laptop.
I have been using the following code on the ESP side
AT+CWJAP="dlink","password"
AT+CIPMUX=1
AT+CIPSTART=4,"TCP","192.168.0.105",80
AT+CIPSEND=4,6
123456 busy s...
AT+CIPCLOSE
My question is whether the IP address which i'm using is the correct IP for the server created using XAMPP? Do I need to send a GET request in order to send data? Do I need to make changes on the server side or just running the apache service is enough for my purpose?
The IP will be different in every network. I assume your network is set up with DHCP in which case the server might get different addresses every time.
There are mDNS libraries for ESP82666 that you can use to lookup the server by its local domain name (for example servername.local). Or you can configure the server to use a static IP.
So we have a staging server running commerce that's binding to port 8000:
[12/23/15 15:21:44:043 EST] 0000000f webcontainer I com.ibm.ws.wswebcontainer.VirtualHost addWebApplication SRVE0250I: Web Module WorkspaceAdministration has been bound to VH_comm_Tools[xxx.xxx.com:8000,*:8000]
The issue here is I can't connect to that port and netstat -an | grep 8000 shows it's not listening. telnet or curling the locahost does not return anything. Iptables is also disabled.
I have another environment that's working without adding a port in the HTTP Transport chain although i did attempt that but without any luck.
Can someone chime in please??
Thank you!
WAS ND 8.5.5.1
The message you included is referring to the "host aliases" defined in the "virtual host" the .war is associated with. These are accessible via the WAS admin console.
Separately, your web container is associated with a TCP transport listening on one or more ports. These are accessible in the WAS admin console in a slightly different area.
The server will let you create host aliases that do not match any listening port, because they could be logical ports used by frontend proxy/http servers.
I'd suggest you do one of two things:
figure out your listening ports, then add them as host aliases to the virtual host your app is associated with
or
find a virtual host with host aliases that match your listening ports and associate your web module with that virtual host instead.
I am using a call to ftp.exe to upload file to a FTP Server.
This program is running since many years and uploads to number of servers, so far without problems.
After one of the receiver servers has been updated, uploads are no longer possible.
This is the command sequence:
open ftp.xxx.de
<user>
<pw>
>230 User logged in, proceed
cd upload
bin
put <filename>
and in response to this the server replies:
501 PORT IP is not the same as 10.100.244.5
150 File Status okay, about to open Connection
That is it, after this the connection is stuck and gets closed after a certain timeout period.
Funny enough, a google search for "PORT IP is not the same as" return exactly one result, which explains that the IP seen by the server is different from the one expected.
Also, when using WinSCP, FileZilla or other FTP utility programs, the connection has no problem and does transfer files just fine.
So, why does this appear and how to solve it?
The ftp.exe uses an old-fashioned active mode command PORT, which requires the client to specify its IP address to which the FTP servers needs to connect back to open a data transfer connection.
If your are behind a firewall or a NAT, the client may not know its external IP address and uses its local network address. This causes troubles. Either the server fails to connect back as it obviously cannot connect to the client's local network. Or the server rejects the PORT command straight away, if the specified IP address does not match the IP address, from which the FTP client connects to the server. This is a security measure as the difference may indicate a man-in-the-middle attack. Your server does the validation. Some servers might be configured to ignore the IP address specified in the PORT command and connect to a known IP address of the client.
Another way to solve this is, if the firewall/NAT can inspect the FTP traffic and seamlessly modify the IP address in the PORT command. This is obviously not happening.
You do not get the problem with WinSCP or FileZilla, as these clients default to the passive FTP mode, which does not have the problem. Also in the active mode these clients can be configured to use the external IP address. FileZilla also supports the modern EPRT command, that does not need to specify the IP address at all (the server uses the known IP address of the client).
See my article about active/passive FTP mode for details.
I do not think there's any way to make it working with the Windows ftp.exe. It neither supports the passive mode, nor can be configured to use the external IP address, nor supports the EPRT command.
So unless you can configure the FTP server not to do the check and connect to the known IP address of the client or configure your firewall/NAT to modify the IP address in the PORT command, you have to use another FTP client.
As you know that WinSCP works, see the guide for converting the Windows ftp.exe script to WinSCP script.
(I'm the author of WinSCP)
I have a REST service running on Mac OS X, which im currently accessing using "localhost:8888" and "10.0.2.2:8888"
I want to access the same service from another computer which is in the same network.
I disabled the firewall also and I typed
nc -v 192.168.1.3 8888
and got the result as
nc: connectx to 192.168.1.3 port 8888 (tcp) failed: Connection refused
currently i use localhost (to access using java application) and 10.0.2.2 (to access using android application runs in the simulator) which both runs on the same machine which the server runs too.
I want to put the android application to my phone and give the machine ip addess ( because if i connect to internet via wifi, it'll be in the same local area network) i should be able to access my service runs on my machine.
can some one please tell me what im doing wrong here? Thank you
You can't access localhost from your front end code. It needs to refer to the server's name or address.
The localhost address should be 127.0.0.1, which is in the loopback range of addresses. Any address in the 127.0.0.0/8 block can never appear anywhere on any network, nor can any address in that block be used as a source or destination address outside a host. It is not possible for one host to access anything in that address range on another host.
The goes back at least as far as RFC 990, ASSIGNED NUMBERS:
The class A network number 127 is assigned the "loopback" function,
that is, a datagram sent by a higher level protocol to a network 127
address should loop back inside the host. No datagram "sent" to a
network 127 address should ever appear on any network anywhere.
RFC 1122, Requirements for Internet Hosts -- Communication Layers:
(g) { 127, }
Internal host loopback address. Addresses of this form MUST NOT
appear outside a host.
Also RFC 3330, Special-Use IPv4 Addresses:
127.0.0.0/8 - This block is assigned for use as the Internet host loopback address. A datagram sent by a higher level protocol to an
address anywhere within this block should loop back inside the host.
This is ordinarily implemented using only 127.0.0.1/32 for loopback,
but no addresses within this block should ever appear on any network
anywhere [RFC1700, page 5].
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.