Querying Current Wifi Network SSID for Network Profiles script - networking

I've got a script that programmatically applies different proxy settings for different wifi networks, but I'd like to make it automatic; when a certain wifi network is logged into, my script is called with the network name.
Any ideas?

Assuming you are on a linux if-up/if-down hooks is what you need.
Look at /etc/network/if-up.d and /etc/network/if-down.d .
The interfaces(5) manual page whould help in general.

Related

Would it be possible to create a Chromebook extension that would toggle the "Configure IP address automatically" network setting on and off?

Chromebooks at a certain facility will not work with static IPs, and they have reserved IP addresses, but for some odd reason they will not grab those from the DCHP server. By toggling Configure IP address automatically off for a few seconds and back on, the Chromebook gets its reserved IP and works fine. In about 6-8 months we will be changing the entire network and resolving this issue, but in the meantime if I could create a shortcut method for the end users to be able to do this easily it would be a big stone out of my shoe...
I had forgotten I posted this. In order to resolve the issue, I did use "code" and "programming" to create a script that would do what I described above. So, it wasn't a networking question, it was a programming question.

Serial COM port data over WebRTC

I'm currently looking at options to allow me to build a remote COM-port solution.
The idea is to be able to access from my remote PC, another PC that's directly connected to a device locally via its serial COM-port.
I know that the obivous answer is to use a VPN between the 2 Internet connected PCs.
However, I need this solution to be as seamless to the end-user as possible.
i.e. no installing and configuring VPN software, etc.
So I was thinking that WebRTC would be great because the end-user can simply use their web-browser and not have to install any additional software.
My question is, is it possible to stream the COM port data between the 2 PCs via WebRTC?
If so, can you please point me in the right direction as to how I can go about achieving this?
Sorry if this is a ridiculous question, I'm very new to WebRTC, just exploring my options.
Thanks.
That should work great!
Networking wise you get NAT Traversal. That means the two computers can be in completely different networks, and still communicate. You may have to run a TURN server if P2P isn't possible.
Data wise you can exchange anything you want via data channels. It is datagram based and you can send/receive binary data. You get a callback telling you how much has been delivered, that way you can detect backpressure.
Are you ok with installing software on the remote host? You can do something like Pion WebRTC's data-channels. This shows you can have a browser connect to a Go process via WebRTC. Then use tarm/serial on the remote host to interact with the device.
If you want a browser on both ends there is the Web Serial API I haven't used it myself though. That locks you into only doing Chromium which might be an issue.

Ask user to signup/login when someone connects to my WiFi network

I want that when somebody connects to my WiFi network, the user should be redirected to a website, where he either needs to sign up or login(if already registered). He can only use the WiFi after successful login.
I see such networks in most of the restaurants and hotels, does any one know how to create one like that?
Thank you.
What you're looking for is called a captive portal. There are many free and open source versions (such as WifiDog, NoCatAuth, CoovaChilli) as well as some for-pay versions (Antamedia Hotspot, FirstSpot). You can also get some equipment (especially wireless LAN controllers) that have built-in captive portals (Netgear, Aruba, Cisco). You can also find instructions online for designing and building your own custom portal like this page.

Work with multiple NICs/networks in Windows

I'm searching for a solution to work on a Windows machine with multiple NICs/networks. While working within the network of a customer I tend to get a lot of problems. I need an internet connection for several things like git/sourcesafe/development system etc. but clients often can't offer internet access. So the solution is to use a mobilephone to connect to the internet and ethernet to access the client network/database.
Windows seems to be pretty random here. Sometimes everything works, some mintues later it trys to access the internet over the clients gataway or access the database via the internet. So I end up deactivting/activating NIC's all day long.
Is there some easy way to use the ethernet connection only to access the clients network and the mobile for everything else?
From what you described I think this might help: turn off DHCP for the interface that connects to your customers network and set a static address for that (without a gateway). Then configure your other interface to use DHCP. This should set ONE default gateway (your phone) and all traffic will run through it, except endpoints in your customer's net.
BTW: You can only have one default gateway at a time, of course, but in your case the gateway that was set the latest won, so to speak.

Access point in client or bridge mode with a different model as remote AP?

I need help with this.
I have a zebra printer which needs to be wireless. The printer is located in a warehouse with various access points around, but no ethernet available. I've been asked to use some of the spare Access points they have (they don't use them anymore) so I thought I could set them as bridge or client mode to connect to the other Access points around and give the network connection to the printer.
What happens is that I tried D-link, I tried Linksys (model Wap54G) Access points and everyone of them says in the manuale that it needs another access points of the exactly same BRAND AND MODEL as remote access point.
Why?? One should buy 2 Access points of the same brand and model to make a bridge or client AP otherwise you can't do nothing??
So basically I need to BUY another access point of the same brand of the one they are using (expensive as they are Cisco stuff) or another Linksys and configure and attach it to the switch (networks get to the warehouse and then to the various APs from a main switch) and so I can finally bridge????
Tell me there is a workaround... I can't believe this...
Thanks for the answers, they're too much! And for the downvotes too!
I ended up installing a personalized firmware (DD-WRT) which gives the specified function after some hardcore configuration.

Resources