My Raspberry Pi 4 8 GB has changed the function as my dedicated Server where i host Web Server and LDAP Server. As replacement i ordered another Raspberry Pi 4 with 4GB of RAM which i believe will be sufficient for my Lab Actovity.

So for now we will install Raspberry Pi 4 with Ubuntu 20.0.4 LTS.

 

Download the ubuntu from this site
Run the flasher app (use balenaEtcher)

After Flashing is completed Open the D drive (System-boot) drive of the Pi

 

Find and modify the network-config file

 

 

version: 2
ethernets:
  eth0:
    dhcp4: true
    optional: true
wifis:
wlan0:
  dhcp4: true
  optional: true
  access-points:
    "wifi_name":
    password: "wifi_password"

TIPS:

ensure indentation is exactly 2 spaces 

 

To enable the SSH access find and modify te user-data file

 

chpasswd:
expire: true
list:
- ubuntu:ubuntu

# Enable password authentication with the SSH daemon
ssh_pwauth: true

 

Move the SD Card to Raspberry Pi device and Power On the Pi.

Check the IP address in Router console.

login with ubuntu/ubuntu and change the password

 

After successful login, you can your activity.

Assign static IP to device:

issue ip link command

ubuntu@ubuntu:~$ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
link/ether dc:a6:32:53:1e:33 brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DORMANT group default qlen 1000
link/ether dc:a6:32:53:1e:35 brd ff:ff:ff:ff:ff:ff

We can see the device have eth0 and wlan0 and we will assign static IP on wlan0 interface.

issue this command ls /etc/netplan

ubuntu@ubuntu:~$ ls /etc/netplan/
50-cloud-init.yaml
sudo vi /etc/netplan/50-cloud-init.yaml

Modify the dhcpcd in Wifi to no

network:
ethernets:
  eth0:
    dhcp4: true
    optional: true
version: 2
wifis:
wlan0:
  access-points:
  homesweet:
      password: pedapeda2
  dhcp4: true
  optional: true

change it to

wifis:
  wlan0:
    access-points:
      homesweet:
      password: pedapeda2
    dhcp4: no
    addresses: [192.168.100.101/24]
    gateway4: 192.168.100.1
    nameservers:
    addresses: [192.168.100.1,8.8.8.8,8.8.4.4]
    optional: true
ubuntu@ubuntu:~$ sudo netplan apply

ifconfig 

ubuntu@ubuntu:~$ ifconfig
eth0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether dc:a6:32:53:1e:33 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 234 bytes 20048 (20.0 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 234 bytes 20048 (20.0 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.100.101 netmask 255.255.255.0 broadcast 192.168.100.255
inet6 fe80::dea6:32ff:fe53:1e35 prefixlen 64 scopeid 0x20<link>
ether dc:a6:32:53:1e:35 txqueuelen 1000 (Ethernet)
RX packets 304082 bytes 424704560 (424.7 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 95574 bytes 9093440 (9.0 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

Change the hostname

  1. modify /etc/hosts
  2. using hostnamectl
    sudo hostnamectl set-hostname expected_hostname

Leave a Reply

Your email address will not be published. Required fields are marked *