I have a device in my local network with unknown IP address and outside of my sub-net (it was configured previously as static IP in another network). I know though its MAC address. Is it possible with java to communicate with that device using only its MAC address?
Related
Complete novice with this topic - struggled to grasp an understanding.
Two devices - Device A, Device B(Laptop)
Device A - IP Address 192.169.0.120
Device B - IP address 192.169.0.121
Device B(Laptop) is connected to WiFi, and to Device A through Ethernet cable.
I have an embedded app in Device A, which i access though web browser on Device B(Laptop), on Device A's IP Address.
Is it possible to make this IP address public - for instance my mobile to pick up Device A's IP address?
I've looked into VPN's (hamachi) and port forwarding. is this the right way to go?
image of example setup
You can use ngrok to obtain the public ip address. This will basically expose your machine as public although it is in private network.
reference : https://ngrok.com/
You can't connect from outside the network using your local ip (192.168.0.120). Check out this topic if you want to know how to grab your external ip:
Getting the 'external' IP address in Java
I'm try to detect a network cable interface using it's mac address.
On some machine there is many type of adapter (cable, wifi, usb dongle, etc).
Is it possible to have the types of each mac address, such as wifi/cable/other?
The primary application is a Java program, but other languages would be useful too.
You can get your machine's current MAC in Java; you can't get remote MAC addresses.
Get MAC address on local machine with Java
If you were to connect the computer to the network one way, get the MAC address, and then remember that, you'd have it.
It sounds like what you want is a regexp to tell you if a particular MAC address is a wifi device, a cable router, etc; I don't think the space of MAC addresses was well enough designed to reliably allow for that, and you'd still miss cases of MAC spoofing.
I want to get the web user/client mac address, i.e i want to restrict the users to open my web application with register mac address only. So other systems could not open my web application,
For example, if the user entered URL in the browser and enters, the request will go to the server, in the server side is it possible to capture the mac address of the client?,if it is possible i can restrict him to open my application by checking with my already registered mac addresses.
please help me.
The MAC address does not survive beyond IP routers. You can't find the client MAC address from a remote server.
In a local subnet, the MAC addresses are mapped to IP addresses through the ARP system. You can find the MAC address of computers within your subnet using 'arp -a' or 'nbtstat -A ipaddress' command in windows.
However, when your packets passes though the router from the local subnet through the gateway out to the Internet, the originating MAC address is lost.
We are launching an ERP application on cloud and hence planning to capture the system ip address of the clients machine who access the application from our server.
This ip address that we are fetching is it the system ip or localhost ip?
It is fetched using
InetAddress local_ip=InetAddress.getLocalHost();
InetAddress remote_ip=InetAddress.getByName(request.getRemoteAddr());
Is it secure to fetch the ip address or mac address? As i know the ip address is unique only across a network.
Thank You
You will not be able to track the mac unless you are on the same network. Once the packet crosses a router the mac addr becomes the mac of the routers you bounce across at each hop. Mac addresses are available to the broadcast domain only. Some devices support proxy arp though.
IP addresses might change over sessions. Think about NATted clients and DHCP assigned addresses. These keep changing. Same IP might represent another client at another time.
Considering security, as mentioned in a comment, no.
I have two android devices - one is a server, second is a client. I run WiFi hotspot on server (using some external app, like QuickSettings), and then connect to this hotspot on second device. I have an application which transfers some data between these devices, so I need to get an IP address of the server to be able to create a socket on client. So my question is how can I do that inside my application (not justing by typing the proper IP manually)?
Did you try assuming the hotspot is the first IP in the valid range?
I mean: The hotspot gives you device an IP and a mask (and it should give even a gateway). The IP of the hotspot is the IP gateway, but if the hostspot did not tell your device such IP, the gateway is usually the first IP in the range allowed by the mask.