Close

Zeroconf

A project log for Wandboard experiments

Setting up the WBQUAD

christoph-tackChristoph Tack 05/30/2020 at 13:010 Comments

SSH-connections to the wandboard are great, but you need to know the IP-address in advance.  This becomes difficult in networks with a DHCP-server.  It would be easy if you could just call your device by its name.  No matter what IP-address it has.  Luckily in Linux, you can do that.

Setting your hostname

The default hostname for the wandboard is arm.  Let's change that to wandboard.

ubuntu@arm:~$ hostname
arm
ubuntu@arm:~$ sudo hostnamectl set-hostname wandboard
ubuntu@arm:~$ hostname
wandboard
ubuntu@arm:~$ 

 Reboot the wandboard.

Establishing a remote connection to the wandboard

There's no need to know the IP-address.

christoph@christoph-ThinkPad-L580:~$ ssh ubuntu@wandboard.local
The authenticity of host 'wandboard.local (192.168.1.8)' can't be established.
ECDSA key fingerprint is SHA256:DsYVUlf605cdhz55Anl14mqYHqnV7ZKEcm4O0xyTaOk.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'wandboard.local' (ECDSA) to the list of known hosts.
Last login: Sat May 30 12:58:22 2020
ubuntu@wandboard:~$ 

Correcting hosts file

The Wandboard's /etc/hosts file will still contain the entries for arm.  One of the problems with that is that sudo will not be able to resolve the name.  Every sudo command will take about 30s to authenticate.  The solution is simple.  Open the Wandboard's /etc/hosts file and replace arm by wandboard.

root@wandboard:~# cat /etc/hosts
127.0.0.1       localhost
127.0.1.1       wandboard.localdomain   wandboard

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

Discussions