2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Raspberry Pi に Avahi で 接続する

Last updated at Posted at 2018-01-29

ラズベリーパイに IP アドレスでなく ホスト名で接続する方法です。ラズベリーパイは、モバイルルーターから DHCP でアドレスを取得しています。

Arch Linux から、次のように接続できるようにします。
pansy は、ラズベリーパイのホスト名です。

ssh pansy.local

ラズベリーパイ側のソフトのインストール

sudo apt install avahi-daemon

デーモンの動作確認

$ systemctl status avahi-daemon
● avahi-daemon.service - Avahi mDNS/DNS-SD Stack
   Loaded: loaded (/lib/systemd/system/avahi-daemon.service; enabled)
   Active: active (running) since Mon 2018-01-29 11:10:48 JST; 16min ago
 Main PID: 1546 (avahi-daemon)
   Status: "avahi-daemon 0.6.31 starting up."
   CGroup: /system.slice/avahi-daemon.service
           ├─1546 avahi-daemon: running [pansy.local]
           └─1547 avahi-daemon: chroot helper

Arch Linux 側のソフトのインストール

sudo pacman -S avahi
sudo pacman -S nss-mdns

/etc/nsswitch.conf の編集

hosts: files mymachines mdns_minimal [NOTFOUND=return] resolve [!UNAVAIL=return]
 dns myhostname

そして、avahi-daemon の再起動

sudo systemctl restart avahi-daemon

参考ページ
archlinux Avahi

2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?