wifi-connect icon indicating copy to clipboard operation
wifi-connect copied to clipboard

Add ability to configure static IPs

Open alisondavis17 opened this issue 6 years ago • 7 comments

alisondavis17 avatar Aug 01 '17 15:08 alisondavis17

We would like to be able to set a static ip on a wifi or wired device. And would like to be able use ipv4 or ipv6.

In trying to implement this ourselves, we ran into some issues. Particularly with the wired connection. Wired requires you to modify an existing connection, which is not currently built into this project. We had some issues accomplishing that from the start. But thanks to some stellar help from the resin team, we were able to put together a script that was able to set a static IP on the wired connection. Please reference the following link

https://forums.resin.io/t/static-ip-configured-via-app/1495

So we proved out it was possible to set a static IP via script but it wasn't integrated into this app. Upon trying to bring that functionality into this app, we kinda ran into a catch 22 situation. The way this app determines whether or not it needs to start the access point is by seeing if there is a connection existing not in the whitelist of Wired connection 1 or resin-sample. This works fine for wifi since you are creating a new connection. But modifying Wired connection 1 won't result in a new connection. Thus, the app always starts the access point. If your remove Wired connection 1 from the whitelist, then you have the reverse problem. It will never start the access point.

jansselt avatar Aug 02 '17 21:08 jansselt

Yesterday I started looking at the ability to set a static IP into the resin-wifi-connect rewrite (using the Rust language) and I will follow up with details very soon.

majorz avatar Aug 04 '17 06:08 majorz

We would like to be able to set a static ip on a wifi or wired device. And would like to be able use ipv4 or ipv6.

For one of the next minor versions we can extend the application with support for static IP assignment for the newly created Wi-Fi connection. This seems a natural extension of the current functionality. I will bring it up for discussion with the team.

Question: what type of UI changes and CLI extensions do you think will fit best your use case?

The way this app determines whether or not it needs to start the access point is by seeing if there is a connection existing not in the whitelist of Wired connection 1 or resin-sample.

For the next version we won't have a whitelist anymore, because we will iterate only over standard Wi-Fi connections. Thus if there are wired connections configured they will not impact the behavior of the application. In a future we plan to expand resin-wifi-connect beyond Wi-Fi, but we have not discussed that in details yet.

majorz avatar Aug 07 '17 08:08 majorz

Here is how we modified the UI. Its nothing too fancy but it fits our needs. Sorry for multiple images. Apple's captive wont let you resize. So that's top and bottom of the form.

captive captive2

The static IP inputs don't show on the form unless the user checks the static IP checkbox. Also note we have a check box to manually enter an SSID in the event that the user has a hidden SSID. If you check that box, the SSID drop down changes to a textbox. This would also be good functionality to add and was fairly easy.

To be honest I don't have a ton of experience in the CLI so I don't know that I should be one to make recommendations there. Hopefully someone else sees this and has some thoughts.

Glad to see wired is coming in a future releases. This is requirement for us and a major need. Its also the one scenario we haven't been able to completely solve. As mentioned, we have a python script that will do it, but we don't have it integrated into a user friendly application.

jansselt avatar Aug 07 '17 14:08 jansselt

+1 for being able to configure static ip address

bbinet avatar Feb 22 '18 12:02 bbinet

Would love to see this somehow integrated into wifi-connect.. a PR perhaps?

jgentes avatar May 02 '18 17:05 jgentes

Notes for future visitors:

  1. That the thread is now at https://forums.balena.io/t/static-ip-configured-via-app/1495/21.
  2. @jansselt's script (https://github.com/ljanssen5/resin-wired-static-ip, can be run in parallel with wifi-connect, with the desired IP set in start.sh) is in Python while the project is in Rust, so it's not so much integration as major feature development. I'm not aware of a container-based captive portal for both WiFi and Ethernet, but any suggestions would be greatly appreciated.

MBerka avatar Jan 26 '23 01:01 MBerka