# 4G and local lan networks

**URL:** <https://forums.balena.io/t/4g-and-local-lan-networks/76751>\
**Category:** balenaOS\
**Created:** [March 10, 2020, 2:38pm UTC](https://forums.balena.io/t/4g-and-local-lan-networks/76751 "2020-03-10T14:38:57Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![sthysel](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/sthysel/32/2878_2.png) [@sthysel](https://forums.balena.io/u/sthysel)\
**Post date:** [March 10, 2020, 2:38pm UTC](https://forums.balena.io/t/4g-and-local-lan-networks/76751/1 "2020-03-10T14:38:57Z")

</div>

Good evening,

I have a device connected to an isolated local LAN consuming a data stream from sensors. I also have a 4g modem on the device. I followed the [cellular modem](https://www.balena.io/docs/reference/OS/network/2.x/#cellular-modem-setup) instructions dropped the file into /resin-boot and it ends up in /etc/NetworkManager/system-connections. After a reboot I see no IP assigned to the wwp0s20f0u2i12 device, which is my modem. manually configuring the modem seems to work:

```
    root@8fde118:~# mmcli -b 0
  --------------------------------
  General | dbus path: /org/freedesktop/ModemManager1/Bearer/0
                     | type: default
  --------------------------------
  Status | connected: yes
                     | suspended: no
                     | interface: wwp0s20f0u2i12
                     | ip timeout: 20
  --------------------------------
  Properties | apn: telstra.internet
                     | roaming: allowed
  --------------------------------
  IPv4 configuration | method: static
                     | address: 10.106.128.70
                     | prefix: 30
                     | gateway: 10.106.128.69
                     | dns: 10.5.80.241, 10.5.209.36
                     | mtu: 1500
  --------------------------------
  Statistics | duration: 510

```

I need both the modem and the ethernet to be configured. The ethernet needs a static IP to communicate with the local LAN and the 4g modem is used for balena VPN.

To test things out I need to be able to change the contents in /resin-boot so that needs to be rw. I believe I did a mount -o remount,rw resin-boot / to get that done.

So where can I look for guidelines on the above ?

Thanks for your time

---

<div class="post-metadata">

**Author:** ![nazrhom](https://avatars.discourse-cdn.com/v4/letter/n/ee59a6/32.png) [@nazrhom](https://forums.balena.io/u/nazrhom)\
**Post date:** [March 10, 2020, 3:23pm UTC](https://forums.balena.io/t/4g-and-local-lan-networks/76751/6 "2020-03-10T15:23:43Z")

</div>

Hello, could you please expand on the steps you took to configure the modem manually, I would expect this to work following the steps in the cellular modem setup guide. Also, the command you link should correctly remount `resin-boot` as writable, but could you clarify why you need the partition to be writable?

---

<div class="post-metadata">

**Author:** ![sthysel](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/sthysel/32/2878_2.png) [@sthysel](https://forums.balena.io/u/sthysel)\
**Post date:** [March 10, 2020, 3:32pm UTC](https://forums.balena.io/t/4g-and-local-lan-networks/76751/7 "2020-03-10T15:32:52Z")

</div>

I remount the /resin-boot rewritable so I can add and update the files on the disk. Balena OS is installed to the devices fixed disk, its a Dell 7212 industrial tablet. Re-installing every time I need to change a network config while debugging is not a option. Is there a better way of adding files to /resin-boot. Or perhaps more pertinently, setting config in /etc/NetworkManager/system-connections ? My understanding is that the contents of /resin-boot/system-connections is mount-binded at boot time to the active partition.

So from my notes:

```
root@8fde118:~# mmcli -m 0 --simple-connect="apn=telstra.internet,number=*99#"
successfully connected the modem
root@8fde118:~# mmcli -m 0                                                    
  -----------------------------
  General | dbus path: /org/freedesktop/ModemManager1/Modem/0
           | device id: d72e399c23c72c017ce17085209cc6c77e54f938
  -----------------------------
  Hardware | manufacturer: Sierra Wireless, Incorporated
           | model: DW5816e Snapdragon? X7 LTE
           | firmware revision: SWI9X30C_02.24.05.03
           | carrier config: default
           | h/w revision: EM7430
           | supported: gsm-umts, lte
           | current: gsm-umts, lte
           | equipment id: 355201082019766
  -----------------------------
  System | device: /sys/devices/pci0000:00/0000:00:14.0/usb2/2-2
           | drivers: cdc_mbim
           | plugin: Dell
           | primary port: cdc-wdm0
           | ports: cdc-wdm0 (mbim), wwp0s20f0u2i12 (net)
  -----------------------------
  Status | unlock retries: sim-pin2 (3)
           | state: connected
           | power state: on
           | access tech: lte
           | signal quality: 0% (cached)
  -----------------------------
  Modes | supported: allowed: 3g; preferred: none
           | allowed: 4g; preferred: none
           | allowed: 3g, 4g; preferred: 3g
           | allowed: 3g, 4g; preferred: 4g
           | current: allowed: 3g, 4g; preferred: 4g
  -----------------------------
  Bands | supported: utran-1, utran-6, utran-5, utran-8, utran-9, eutran-1, 
           | eutran-3, eutran-5, eutran-7, eutran-8, eutran-18, eutran-19, 
           | eutran-21, eutran-28, eutran-38, eutran-39, eutran-40, eutran-41, 
           | utran-19
           | current: utran-1, utran-6, utran-5, utran-8, utran-9, eutran-1, 
           | eutran-3, eutran-5, eutran-7, eutran-8, eutran-18, eutran-19, 
           | eutran-21, eutran-28, eutran-38, eutran-39, eutran-40, eutran-41, 
           | utran-19
  -----------------------------
  IP | supported: ipv4, ipv6, ipv4v6
  -----------------------------
  3GPP | imei: 355201082019766
           | enabled locks: fixed-dialing
           | operator id: 50501
           | operator name: Telstra
           | registration: home
  -----------------------------
  SIM | dbus path: /org/freedesktop/ModemManager1/SIM/0
  -----------------------------
  Bearer | dbus path: /org/freedesktop/ModemManager1/Bearer/0
  root@8fde118:~# mmcli -b 0
  --------------------------------
  General | dbus path: /org/freedesktop/ModemManager1/Bearer/0
                     | type: default
  --------------------------------
  Status | connected: yes
                     | suspended: no
                     | interface: wwp0s20f0u2i12
                     | ip timeout: 20
  --------------------------------
  Properties | apn: telstra.internet
                     | roaming: allowed
  --------------------------------
  IPv4 configuration | method: static
                     | address: 10.106.128.70
                     | prefix: 30
                     | gateway: 10.106.128.69
                     | dns: 10.5.80.241, 10.5.209.36
                     | mtu: 1500
  --------------------------------
  Statistics | duration: 510

```

ta for your attention mate

---

<div class="post-metadata">

**Author:** ![tmigone](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/tmigone/32/2814_2.png) [@tmigone](https://forums.balena.io/u/tmigone)\
**Post date:** [March 10, 2020, 6:17pm UTC](https://forums.balena.io/t/4g-and-local-lan-networks/76751/10 "2020-03-10T18:17:18Z")

</div>

Hi, from your comment I take it you are running balenaOS on a Dell 7212 tablet, is that correct? If so can you share what device type and base images are you using? I would think that there could be missing support for that tablet, but since you say manual configuration works ok it’s probably not the case.

Regarding network config changes while debugging, the easiest that comes to mind is using DBus to talk to NetworkManager, admittedly it can be a bit cumbersome. We have a section on the docs that covers it: [https://www.balena.io/docs/reference/OS/network/2.x/#changing-the-network-at-runtime](https://www.balena.io/docs/reference/OS/network/2.x/#changing-the-network-at-runtime)  
Note that we do not advise to do any essential networking configuration on a container for production environments because containers can fail to start and leave your device offline.

---

<div class="post-metadata">

**Author:** ![sthysel](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/sthysel/32/2878_2.png) [@sthysel](https://forums.balena.io/u/sthysel)\
**Post date:** [March 10, 2020, 11:39pm UTC](https://forums.balena.io/t/4g-and-local-lan-networks/76751/16 "2020-03-10T23:39:19Z")

</div>

I’m running` Linux 8fde118 5.2.10-yocto-standard #1 SMP PREEMPT Fri Jan 31 07:23:09 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux`, the latest balenaOS 2.47.0+rev1, NUC variant in local mode.

Yes is a Latitude 7212 Rugged Extreme Tablet from Dell with embedded basically everything. Its a company standard IP rated device that runs our stack adequately.

---

<div class="post-metadata">

**Author:** ![sthysel](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/sthysel/32/2878_2.png) [@sthysel](https://forums.balena.io/u/sthysel)\
**Post date:** [March 11, 2020, 2:05am UTC](https://forums.balena.io/t/4g-and-local-lan-networks/76751/17 "2020-03-11T02:05:04Z")

</div>

Seems I have gaslighted myself into believing changing files in /resin-boot/system-connections/ and then rebooting gets the config updated. How do I change network config, add new connection files and so on on a installed device ? iirc last year I could just drop the new config in /resin-boot/system-connections/, new files or changed old files, and the change would propagate to /etc/NetworkManager/sytem-connections after a reboot. This does not happen anymore. How am I supposed to work this problem ?

---

<div class="post-metadata">

**Author:** ![sthysel](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/sthysel/32/2878_2.png) [@sthysel](https://forums.balena.io/u/sthysel)\
**Post date:** [March 11, 2020, 7:24am UTC](https://forums.balena.io/t/4g-and-local-lan-networks/76751/18 "2020-03-11T07:24:04Z")

</div>

So a colleague set me straight, adding config files to /mnt/boot/system-connections gets propagated to /etc/NetworManager/system-connections on boot.

The only way I could make the modem auto start was to specify the `interface-name=cdc-wdm0` explicitly.

So I drop a file `telstra` in /mnt/boot/system-commands/

```
[connection]
id=telstra
type=gsm
autoconnect=true
interface-name=cdc-wdm0

[gsm]
auto-config=true
apn=telstra.internet
number=*99#

[serial]
baud=115200

[ipv4]
method=auto

[ipv6]
addr-gen-mode=stable-privacy
method=auto
```

---

<div class="post-metadata">

**Author:** ![shaunmulligan](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/shaunmulligan/32/34_2.png) [@shaunmulligan](https://forums.balena.io/u/shaunmulligan)\
**Post date:** [March 11, 2020, 8:41am UTC](https://forums.balena.io/t/4g-and-local-lan-networks/76751/19 "2020-03-11T08:41:22Z")

</div>

Hi @sthysel , indeed your colleague is correct, the files in `/resin-boot/system-connections/` will always be copied to `/etc/NetworkManager/system-connections` and is just a simple copy so will not delete any existing files in that destination. It is strange that you would need to specify the interface name, we haven’t come across that type of issue before but I am glad you have it working automatically now. Let us know if you need further help.

---

<div class="post-metadata">

**Author:** ![sthysel](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/sthysel/32/2878_2.png) [@sthysel](https://forums.balena.io/u/sthysel)\
**Post date:** [March 11, 2020, 8:57am UTC](https://forums.balena.io/t/4g-and-local-lan-networks/76751/21 "2020-03-11T08:57:31Z")

</div>

The take here is that /mnt/boot/system-connections is rw already, so rather use that than /resin-boot/system-connections/ which is not, the latter being a ro bind mount. If you follow the docs as they stand you will be surprised that /resin-boot/system-connections/ is ro, the assumption seems to be that the user is fiddling with a sdcard and then plugging it in. That’s just not a workable solution while debugging.

---

<div class="post-metadata">

**Author:** ![shaunmulligan](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/shaunmulligan/32/34_2.png) [@shaunmulligan](https://forums.balena.io/u/shaunmulligan)\
**Post date:** [March 11, 2020, 9:12am UTC](https://forums.balena.io/t/4g-and-local-lan-networks/76751/22 "2020-03-11T09:12:15Z")

</div>

Yes indeed, fiddling with the SD card is only meant for pre-configuration and definitely not for debugging. For debugging connections the recommend way would be to have a serial console (or keyboard and screen) on a development version of balenaOS, then it would be a matter of using the `nmcli` tool to create connections, etc and this writes to `/etc/NetworkManager/system-connections` . Once one has found a working configuration files that can be copied out and used across other images by pre-configuring on the SD card. I think the challenge in this thread is that we don’t have much experience with tablets and don’t know what interfaces are available to you for debug, its far easier on boards where serial and ethernet are exposed.

---

<div class="post-metadata">

**Author:** ![sthysel](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/sthysel/32/2878_2.png) [@sthysel](https://forums.balena.io/u/sthysel)\
**Post date:** [March 11, 2020, 9:30am UTC](https://forums.balena.io/t/4g-and-local-lan-networks/76751/24 "2020-03-11T09:30:53Z")

</div>

Yes that in a nutshell is more or less how I worked it. fwiw [the tablet](https://www.dell.com/en-au/work/shop/2-in-1-laptops-tablet-pcs/latitude-7212-rugged-extreme-business-tablet/spd/latitude-12-7212-tablet) is basically a powerful board with a embedded screen. In my case a coral tpu hangs of the usb port and I do real time video inferencing on a number of HD streams. A usb-\>nic hangs of it as well. I ssh to it `balena ssh 10.0.0.69` and go about my business (btw, bash auto-completion is broken in vi mode, do `set -o vi` and hit TAB to autocomplete, you get a TAB in vi-mode, that’s pretty annoying).

Hope that helps someone else.

---

<div class="post-metadata">

**Author:** ![shaunmulligan](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/shaunmulligan/32/34_2.png) [@shaunmulligan](https://forums.balena.io/u/shaunmulligan)\
**Post date:** [March 11, 2020, 9:40am UTC](https://forums.balena.io/t/4g-and-local-lan-networks/76751/25 "2020-03-11T09:40:13Z")

</div>

Thanks for the additional info, the team should have asked you for all that information upfront as it helps a ton to with recommending how to go about debugging, I assume they just recommended the way they knew would work for any device as they probably assumed a tablet PC didn’t have usb and usb-\>nic . For the bash auto completion, is that in the OS? if it is, could you open a github issue on [https://github.com/balena-os/meta-balena/issues](https://github.com/balena-os/meta-balena/issues) and im sure the team will fix it asap. Thanks for all the feedback

---

<div class="post-metadata">

**Author:** ![sthysel](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/sthysel/32/2878_2.png) [@sthysel](https://forums.balena.io/u/sthysel)\
**Post date:** [March 11, 2020, 9:51am UTC](https://forums.balena.io/t/4g-and-local-lan-networks/76751/26 "2020-03-11T09:51:09Z")

</div>

Sure, raised a issue [https://github.com/balena-os/meta-balena/issues/1848](https://github.com/balena-os/meta-balena/issues/1848)

---

<div class="post-metadata">

**Author:** ![shaunmulligan](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/shaunmulligan/32/34_2.png) [@shaunmulligan](https://forums.balena.io/u/shaunmulligan)\
**Post date:** [March 11, 2020, 9:58am UTC](https://forums.balena.io/t/4g-and-local-lan-networks/76751/27 "2020-03-11T09:58:10Z")

</div>

perfect, thank you!
