how to access localhost from another device on same wifi network? - networking

I run tor service on my MacBook; it runs on 127.0.0.1, and with port 9501, how can I access that IP and port on another device on same wifi network?

With your terminal type "ifconfig" or go to your network configuration->TCP/ip and check your Mac's current IP, ex. 10.0.0.8
In the other device (another computer or a cellphone) just use the URL 10.0.0.8:9501.

Related

how to set static ip to pc

I use tor proxy and i set the tunnel port to 192.168.1.2:9050.
I also set my router dhcp that give 192.168.1.2 to my pc
but my problem is that sometimes I use another router or my phone hotspot and they give my pc anothre ip (like 192.168.43.164/24) . I can't set their dhcp. so tor doesn't work.
Is there any way to always get the same ip ?
Or Is there any way to refer my wifi ip (something like localhost that refer to 127.0.0.1) to set in tor?
Your phone hotspot gives you a different DHCP's IP because it is threated as another network bridging one network (your PC) to another one (current network connected on your phone).
If you are using wireless hotspot and connecting to your phone's network on wi-fi, that is not possible because tethering IP that is provided for your phone router to use DHCP services is hardcoded in com.android.server.connectivity.Tethering, unless you have root access privileges.
And that it the reason to your phone routing service (USB Bridged or Wi-Fi Hostpot) gives you always an 192.168.42.X IP address.
If you are using Android, you can get more details in this thread on Android Enthusiasts in Stack Exchange:
https://android.stackexchange.com/questions/46499/how-configure-the-dhcp-settings-of-wifi-tethering-hotspot-on-android

ipv4 address vs localhost

if our system IP address acts as a local host, then what does this definition indicates for IP address of localhost - "127.0. 0.1 is the loopback Internet protocol (IP) address also referred to as the localhost"
Within a network every device has it's own ip address. The ip address of a device is for every device different and May change (DHCP).
The hostname loclalhost respectively the ip address 127.0.0.1 points always on the current device.
For example If you are using a laptop and ping from that laptop to 127.0.01 it will resolve to the device the ping is send from thus the laptop itself.
If you ping from a server, it will resolve to the device the ping is send from thus the server.

Source vs Destination Port

For example, if i want to rdp to a remote server from my local computer etc
what would be the source port and destination ports to open for network firewall?
can anyone also give more scenarios on the source and destination ports to open for network firewall? are they always the same?
On firewall you would open destination port (for RDP by default it 3389)
Source ports are randomly generated from the unregistered port range.
The source/destination port works similar to your IP. The port you
send from, is the port the service will reply too. For instance; a
website is simply a server listening for connections on port 80 (or
443).

Connect to localhost with iPad

Trying to connect to localhost on my development machine with my iPad using wifi.
The webserver integrated in Visual studio.
Using ip number I get from ipconfig.
192.168.1.84:1144
I'm receiving http 400 error.
I've added port 1144 as TCP/IP port on firewall.
Anybody knows what I'm doing wrong?
does your machine have a static IP? with DHCP enabled, the ip of your machine keeps changing every now and then, so it might be the case that the address provided is no longer available!!
disconnect and reconnect to your network, then run ipconfig again and check if the IP has changed, if it has, then DHCP is enabled...

Open website via computer IP address while running tomcat locally with a router?

I'm working on a website for a friend, developing using Eclipse/Tomcat. I'm running it locally and trying to open it via my internet port IP address, but I can't get it to work. The computer I am running it from is connected to a router, so it is running off of 192.168.1.4, and http://192.168.1.4:8080/Mobile_Site/index.jsp works. However when I try and open it via my internet port IP, http://67.xxx.244.xx:8080/Mobile_Site/index.jsp it doesn't find it from any device, even outside my local network. Is there a way to send the link when running locally when connected to a router?
You have to configure your router port forwarding (or virtual servers depending on the router) to forward TCP connections from 67.xxx.244.xx:NNNN to 192.168.1.4:8080.
Then you give the 67.xxx.244.xx:NNNN address to your friend.
Note: NNNN at your router doesn't need to be 8080, as long as the port forwarding is set properly.

Resources