TransWikia.com

connmanctl on a Debian 'pocketbeagle'

Unix & Linux Asked on January 3, 2022

I’m trying to configure my new "pocketbeagle" to share a network connection with my Ubuntu (20.04) laptop. PocketBeagle runs a version of Debian: 10.3/2020-04-06 (REF).

"pocketbeagle" has neither WiFi nor Ethernet – only a single USB port. It supports ssh, and I can access the board this way through either or both of two IPs. Perhaps easier if I show it like this:

ifconfig run on "pocketbeagle" reveals:

$ ifconfig
usb0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.7.2  netmask 255.255.255.0  broadcast 192.168.7.255
        inet6 fe80::6264:5ff:fefa:813a  prefixlen 64  scopeid 0x20<link>
        ether 60:64:05:fa:81:3a  txqueuelen 1000  (Ethernet)
        ...
usb1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.6.2  netmask 255.255.255.0  broadcast 192.168.6.255
        inet6 fe80::6264:5ff:fefa:813e  prefixlen 64  scopeid 0x20<link>
        ether 60:64:05:fa:81:3e  txqueuelen 1000  (Ethernet)
        ...

ifconfig run on "ubuntu" reveals:

$ ifconfig 
enx606405fa813b: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.7.1  netmask 255.255.255.0  broadcast 192.168.7.255
        inet6 fe80::2267:92a0:a191:297d  prefixlen 64  scopeid 0x20<link>
        ether 60:64:05:fa:81:3b  txqueuelen 1000  (Ethernet)
        ...

enx606405fa813d: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.6.1  netmask 255.255.255.0  broadcast 192.168.6.255
        inet6 fe80::3898:bc86:d0c2:cb53  prefixlen 64  scopeid 0x20<link>
        ether 60:64:05:fa:81:3d  txqueuelen 1000  (Ethernet)
        ...

Through a bit of research, I formulated a procedure to effect sharing as shown below:

  1. Using the "ubuntu" GUI, I changed the "Ethernet Connection" w/ MAC 60:64:05:FA:81:3D from its default "automatic DHCP" to a "shared connection".

  2. This changed its IP address from 192.168.6.1 assigned by "pocketbeagle" to 10.42.0.1.

After making this change, here’s what the "ubuntu" reports on its CLI:

$ ifconfig
enx606405fa813d: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.42.0.1  netmask 255.255.255.0  broadcast 10.42.0.255
        inet6 fe80::3898:bc86:d0c2:cb53  prefixlen 64  scopeid 0x20<link>
        ether 60:64:05:fa:81:3d  txqueuelen 1000  (Ethernet)
        ...
  1. At this point, the interfaces on "pocketbeagle" are unchanged, but obviously incorrect for connection sharing. I executed the following from the CLI on "pocketbeagle"
$ sudo connmanctl config usb1 --ipv4 manual 10.42.0.2 255.255.255.0 10.42.0.1 --nameservers 10.42.0.1
[sudo] password for debian: 
Error usb1: Method "SetProperty" with signature "sv" on interface "net.connman.Service" doesn't exist

Attempting a query of services w/ connmanctl:

$ sudo connmanctl 
Error getting VPN connections: The name net.connman.vpn was not provided by any .service files
connmancconnmanctl> services

connmanctl>

I’m not at all familiar with connmanctl, but my research suggested it was the only way to properly set up DNS service. Perhaps I screwed up? Perhaps there is something else I’ve missed? I then decided to try the configuration the "old way":

  1. The following sequence of commands was used to re-configure the corresponding "pocketbeagle" interface in the "old way":
$ sudo ifconfig usb1 10.42.0.2 netmask 255.255.255.0 up
$ sudo route add default gw 10.42.0.1 usb1
$ sudo nano /etc/resolv.conf
#
# add line: nameserver 10.42.0.1 
# save & exit editor
#
# yes - this is an awful kludge, but it did provide DNS

And this worked! – the "pocketbeagle" successfully connected to the Internet, DNS worked also.

debian@beaglebone:~$ ping unix.stackexchange.com
PING unix.stackexchange.com (151.101.1.69) 56(84) bytes of data.
64 bytes from 151.101.1.69 (151.101.1.69): icmp_seq=1 ttl=56 time=9.01 ms
64 bytes from 151.101.1.69 (151.101.1.69): icmp_seq=2 ttl=56 time=11.8 ms
...

QUESTION: Obviously the issue is with my use of connmanctl, and not with "pocketbeagle" itself. What did I do incorrectly – why will connmanctl not work as intended?

One Answer

I have had a similar issue with my Pocketbeagle. The default configuration consists of dnsmasq, which is acting as a local dns server. Whenever you connect by default, it does not have any access to the internet, and serves it's own DNS to allow access to the default Cloud9 IDE.

My temporary fix is to run:
sudo dhclient -r <usb0 or usb1>.

This should pick up and temporarily configure DNS automatically from the host PC. You will have to re-run the command each time you restart the pocketbeagle. As far as I am aware, connmanctl does not manage DNS on the Pocketbeagle so setting the name-servers may not have any affect, neither with the bone-ubuntu image or the bone-debian.

To run the DNS resolver automatically, you need to install systemd-resolved and enable the service so that it starts on boot. This is generally the method I use to get internet access.

Answered by Ari Stehney on January 3, 2022

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP