Connect ethernet PC to other wifi connected devices (the same router) - networking

I have a PC (Windows 10) connected to my router through an ethernet cable. I also have a few devices connected to the same router. What I would like to do is make them "see" each other. I want to transfer files from my phone to my pc and back using ES File Explorer. I want to Broadcast movies to my smart TV using apps like Wondershare.
My PC is visible for other devices but I can't seem to find it using my TV or phone. Therefore... i guess all these devices are not connected to the same "mini-network". I don't know how to call it.
What should I do?

If you are in the same subnet as the router and there are no firewall rules blocking it, you should be able to see the devices on your computer. If you go to your phone settings, search for the IP and try to ping it with the command line of your choice. If it does not work, compare the subnet mask and ip address of your devices, make sure they are in the same subnet.
On windows the command is: ipconfig on linux: ifconfig or the new form: ip addr

Related

I have a screen sharing service hosted on one router and the target screen(a smart tv) connected to another router. What can I do to connect them?

The first router (Telekom something) which is connected to the cable from outside is the one which the smart tv is connected to. The second router (Asus something) is connected through the first one and hosts a separate wifi network from the first. My pc is connected to this router through a LAN cable. I'm trying to use a screen sharing program called Deskreen which hosts a website from the computer and can be reached by typing in the ip address of the computer into a browser. This only works on the same network that the pc connected to.
I tried searching online but I couldn't find anything about a similar situation. My main question would be if I can somehow reach the other router from the smart tv since the two routers are connected.
Yes, use more specific networks that are part of the block on the first router (if you have at least a /29 block), and enable proxy arp (should be on by default).

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

IP address Dynamic or static

I have a laptop and a mobile phone both connected to a common wifi. I need to send data from phone to laptop using MQTT protocol. I would like to know whether my laptop's IP will change or will it be the same . If IP will change, then each time I need to change IP address in the program.
If you use the same modem or router to access the internet, it will give you the same IP adres until you are away for an x amount of time (usually weeks or months if not configured).
Unless you're not using an open wifi network, you're good to go!

Same ip address for multiple devices?

I want to develop an Android app that connects with a Windows desktop application via TCP/IP.
However I have very little knowledge of networking and so please forgive me if this is a very basic doubt.
My Windows based laptop as well as Android phone are connected to the internet via the same WiFi router.
Now I checked the IP address for my laptop as well as phone using a website.
Both are same!
If both have the same IP address, then to achieve networking between these devices I will choose different set of port numbers.
Will this connection work?
Is the connection happening via the internet or just locally on my
router?
EDIT: After reading the answer from #Doon, I have broadened my question.
Let's say the local address of laptop is 192.168.1.10 and that of phone is 192.168.1.20.
If I code my application to use these IP addresses, it should work as it is a local network.
But what if I want my laptop to connect with another phone which is not connected to the WiFi router, rather by 3G network.
Then which IP address should be used for the laptop and the other phone?
Since I am not allowed to use any other server, I am going to use port forwarding i.e. the user will type in the IP address displayed on the other device. The connection could be initiated on either one of the devices.
If you could also show how to do this programmatically, it would be very helpful.
My Windows application is developed in C++ using Qt.
All of your devices are sharing 1 external or WAN IP address using NAPT (network address port translation). Internally on your LAN each device has its own address. So yes it will work but you are going to need to use internal addrss and the devices actual IP address not its perceived address via an external service.
As for the connection locally or via router that all depends on where you are connecting to. If both end points are on your lan or on the same Subnet then the router will not be involved. So in the average home network between your phone and desktop both connected to the same network say via wifi then they are most likely layer 2 adjacent (see the OSI 7 layer model for more info on layer 2 vs layer 3). But once they are not on the same network then routing will be involved and your router will be used. If the phone is connected to 3G or the cell data network and you want it to talk to your desktop on your home network you are going to need to deal with port forwarding on your router and other such fun things.
In regards to updates. Once you leave the local network it gets more complicated especially with IPv4 as address are running out so there is more and more use of nat or IPv6 with 6 to 4 gateways. Do you want the laptop to initiate connect to the phone or phone to the laptop? But normally you will need to iterate your address on your interfaces. Then connect with an external service to get your external IP address and compare and see if they are the same. if both endpoints are dynamically assigned you will need some sort of location mechanism could be dynamic DNS could be locator service etc.

IOS4 - Send data using UDP socket on Wifi

I am trying to send data using the AsyncUDPSocket class. And I can send data using the iPhone simulator over the wire to another machine that is running a simple C-coded listening server. I can also receive data over the wire using a client connected to the simulator(server). However, when I tried the same over Wifi, using the simulator, I could only send data but not receive any data.
I read on another post, that unicast data makes this possible. How can I acheive this using AsyncUDPSocket?
Thanks,
Angelo.
Ok, I figured this out. A newbie kind of thing, really.
When I set my Mac network preferences to Ethernet, I get an IP for me to communicate. However, when I turn Airport(Wi-Fi for more newbies) ON, and ethernet cable disconnected, I checked my network preferences, and sure enough my IP address was a different one.
Spoke to a friend (an ace in networking) and the thing clicked immediately: On WiFi networks a DHCP server allocates an IP address. This IP address has to be reserved, at the very least, at the DHCP server. Since my IP was not reserved, I had to change the IP address, in my udp_client.c file, recompile and run the client to connect.
BTW, I can now communicate between my iPhone and my PC using my local WiFi (office) network.
For any who might face the same problem, do not be assured that the IP address of your mchine is the same, when you switch from LAN to Wifi, and use the device mostly for WiFi reated testing. :)

Resources