How can devices exchange data over data link layer 2? - linux

I have a collection of wifi enabled linux devices.
I would like to configure one to use the wifi and the rest to automatically join the same network. It seems to me if I could set up a data link client/server model, all the devices could exchange network credentials and join the same wifi network. Is this possible? Can it be done over command line? How can devices communicate when they have not yet joined a network or received and ip address?

For your devices to communicate they need to connect to something. Since your goal is to have them learn WiFi credentials X, we should assume they can't use credentials X to connect to each other. So they'll have to do something peer-to-peer. Some ideas:
Have the one device which knows credentials X create an "ad hoc" WiFi network. Have the others join it and connect to the creator to learn credentials X.
Use an alternate protocol for credential exchange, such as Bluetooth.
Neither of these ideas will be best implemented in Bash. Something like Python or C may be easier.

Related

Can a list of connected devices to a WPA2 WiFi hotspot be stolen, without connecting to the network itself?

Is it possible for let’s say a hacker to obtain a list of users connected to a WPA2 secured WiFi, if he doesn't know the password and will not be able to obtain it in any way ?
Yes kind of.
You can read out the MAC - Addresses of connected devices without having the passkey. You just would have to run a passive scan.
The MAC - Address is not necessarily unique as you could change it on most devices.
Needless to say:
It's illegal to obtain such data in other Wifi's than your own as this is a breach in personal privacy.

WPS VS Access Point when connecting to WiFi

I'm building a commercial esp8266 device. I need it to connect to WiFi to use the device with an app.
I managed to connect it via both WPS and Access Point (getting the SSID and Password from the app by connecting to the Access Point).
I'm trying to understand which of these two would be ideal for commercial use.
WPS compromises network security until a device connects but it is super fast.
AP doesn't compromise security but it is slower + the user loses his WiFi connection until he passes the SSID and Password.
Another problem is that people might not be able to find the WPS button on their router.
Which of these two methods of connecting to WiFi should I use?
So, essentially what should I choose between Speed and Security?
Edit: It's important to note that multiple commercial devices use WPS to connect (printers for example).
In a commercial setting using WPS makes no sense at all, just use the access point information as you do not want to have any chance of security breach.

How to work with two networks is one script?

I work in company where there are strict restrictions on the network. I need to write an application in python 3, where a wired connection and wi-fi will be used simultaneously. For example, to send data to internal resources, I will use Ethernet and to go data from the network use wi-fi

Linux Tunnell Through Nat Via Custom Proxy

I am currently working on some design concepts that would see me have the requirements for the following type of system.
In short I am looking at ways to Tunnel a connection through NAT similar to VPN but without the complexity.
I have a small embedded linux device that sits behind a home LAN that I would like to be able to interface with through an API that I have created.
Currently the setup I have is as follows:
Device A (Embedded Linux) - Public IP
Device B (Amazon Server)
I am using a REST/Json api to control Device A from Device B.
I am looking for a protocol or solution that would allow me to send two way communication from Device A and B possibly by adding a third proxy server to handle this "Tunnelled" connection.
Notes:
Would preferably like to avoid complex VPN's and the need for the NAT device to support VPN Passthough.
Traffic between Device A and B is small and not highly sensitive but some security like SSL would be nice.
This is a multinode system, Hence, There are many Device A's.
Any advice as to where I should be looking would be greatly appreciated.
Regards
pjf

What are the other mean of connectivity apart from bluetooth?

I want to consider all the connectivity possibilities in JavaME , connectivity between phone mobile and PC. Apart from bluetooth what are the possible means of such connectivity ?
You need to have a look at the Generic Connection Framework (GCF) which gives you the ablility to open connections using various protocols. You do this my using a Connector object.
It is obviously completely dependant upon the hardware upon the phone and any optional JSRs that it implements, but you can communicate to a phone via:
Using internet protocols e.g. Http, Datagram, Socket connections (Requires PC to be accessible via the internet)
NFC (Near Field Communication)
Using a Secure Element (SATSA)
Serial COMM port connection (I think)
I'll completely admit that using some of these methods to communicate between a PC and a phone are nuts but it could be done.
The best thing to do for simplicity is to use bluetooth or a HttpConnection.
U also able to connect mobile with pc via internet (Gprs).Better u look at the Generic Connection Framework (GCF) documentation.It will help u

Resources