Hi all,
I would like to use a Raspberry Pi running balena to create a local network so an iPad can talk to it using an ethernet adapter.
It’s currently working creating a wi-fi hotspot but I would like to use ethernet because it should be more reliable.
I had a look at the documentation but I can’t find an example of how to setup the network configuration files for this application https://www.balena.io/docs/reference/OS/network/2.x/
Can you please point me in the right direction?
Any help would be appreciated,
Many thanks,
Enrico
Thanks,
I already have a file in system-connections to create a wi-fi hotspot and it’s working okay.
My question is if the pi can share the same network via ethernet port as well like I router would do.
There is a network manager connection profile that allows you to do this. You need to add this in resin-boot/system-connections folder from the SD card.
The example itself is a bit old and it uses our older base images which included systemd, but you may create a container with host networking and running in privileged mode and run dnsmasq directly.
@majorz
that’s helpful, my project already has a container with host networking running in privileged mode and with dnsmqsq installed.
I will test it and let you know if I encounter any issues, thanks
However, when I connect the pi to the ipad via ethernet port (or my mac) the ethernet interface doesn’t get the expected IP but a self assigned one like 169.254.220.255
If you can provide a demo that will greatly help!
many thanks,
Enrico
Hi @enricopenzo, the 169.254.x.x address that you saw is a link-local address that may fit very well a use case when you would like to connect to the RPi 3 through IPad, but it won’t provide Internet access to the RPi.
In the use case where you would like to access the Internet through the iPad and actually you do not have to run dnsmasq at all. You may delete any Ethernet NetworkManager connections with nmcli c delete and use the auto-configured default connection by NetworkManager.
As for link-local configuration, where you do not need Internect connection sharing, you may use the following command to create a link-local profile on the RPi: nmcli c a ifname eth0 type ethernet ipv4.method link-local ipv6.method ignore
Then you need to activate the newly created connection profile, e.g. nmcli c up <NAME>, where you may see the name of it with nmcli c.
Then check the hostname of the RPi with hostname, e.g. it will look like ebb0e2b - a seven symbols hex number. Then you may connect to it using as a .local domain from your iPad, e.g. ping ebb0e2b.local.
And getting back to your original issue you had with the 169.254.x.x address where you run the DHCP server on the RPi side, I think it probably how Mac OS X configures it’s network. If you connect the Ethernet cable to the Mac first and wait too much, it may configure a the link-local address automatically. So it is best to first connect the cable to the RPi and then to the Mac.