Skip to content

b5g-ex/setup_ping_pong_pi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Setup Ping Pong Pi

This repo includes ansible playbooks to setup rpi4 for measuring ping/pong.

  • host is executing ansible-playbook machine.
  • target is rpi4.

Prerequisite

  1. Install Raspberry Pi Imager

https://www.raspberrypi.com/software/

  1. Install ansible to host.
apt install ansible sshpass

How to setup ping and pong

prepare Ubuntu SDs

  1. start Raspberry Pi Imager

  2. select rpi4

  3. select Ubuntu Server 22.04 LTS(64-bit)

  1. select Storage, be carefull

  1. click "次へ" and OS Customization

  1. ユーザー名とパスワード設定(ユーザー名は ping/pong, パスワードは ubuntu とすると楽)

  1. パスワード認証を使う

  1. オプションは変更なし

  1. 「保存」をクリックし、 「はい」をクリック

SD への書き込みが終了するのを待つ

edit SDs

Disable auto-upgrades

Open SD's /etc/apt/apt.conf.d/20auto-upgrades and make changes like following,

Before

APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";

After

APT::Periodic::Update-Package-Lists "0";
APT::Periodic::Unattended-Upgrade "0";

Add netplan config

Make /etc/netplan/99-custom-network.yaml and write following,

network:
  version: 2
  renderer: networkd
  ethernets:
    eth0:
      optional: true
      dhcp4: false
      dhcp6: false
      addresses:
        - 192.168.0.101/24
      routes:
        - to: default
          via: 192.168.0.1
      nameservers:
        addresses:
          - 192.168.0.1
    wlan0:
      optional: true
  • Installs needs WAN access, so we need to give the WAN accessible static IP, router's and name server's IP.
  • ex. ping's IP is '192.168.0.101', pong's IP is '192.168.0.102'

setup targets

  1. make rpi4 accessible with SSH
 ┌────┐
 │PING├────────┐
 └────┘        │
               │
             ┌─┴─┐         ┌────┐
             │HUB├─────────┤HOST│
             └─┬─┘         └────┘
               │
 ┌────┐        │
 │PONG├────────┘
 └────┘

You need to access ping/pong with SSH by hand first time to resolve fingerprints.

  1. run ansible playbooks, main.yml, on host.
ansible-playbook -i inventory.yml main.yml

It's also possible to specify a playbook directly.

ansible-playbook -i inventory.yml playbooks/measurer-playbook.yml

about ansible files

  • ansible.cfg is ansible's configuration file, which is INI file.
  • inventory.yml is target machine settings.
  • main.yml is recipes for target.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published