Raspberry Pi/Zero 2W/Ubuntu/24.04: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
| (14 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
{|class='wikitable | {|class='wikitable' | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
lsblk | lsblk | ||
:' | :' | ||
| Line 10: | Line 10: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
ls -alh /media/${USER}/system-boot/{ssh,{config,cmdline}.txt} | ls -alh /media/${USER}/system-boot/{ssh,{config,cmdline}.txt} | ||
:' | :' | ||
| Line 20: | Line 20: | ||
|- | |- | ||
|valign='top'| | |valign='top'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
ls -lah /media/${USER}/writable/etc/netplan/ | ls -lah /media/${USER}/writable/etc/netplan/ | ||
:' | :' | ||
| Line 30: | Line 30: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|valign='top'| | |valign='top'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
ls -lah /media/${USER}/writable/etc/udev/rules.d/ | ls -lah /media/${USER}/writable/etc/udev/rules.d/ | ||
:' | :' | ||
| Line 41: | Line 41: | ||
|- | |- | ||
|valign='top' colspan='2'| | |valign='top' colspan='2'| | ||
{|class='wikitable mw-collapsible mw-collapsed | {|class='wikitable mw-collapsible mw-collapsed' | ||
!scope='col' style='text-align:left' colspan='2'| | !scope='col' style='text-align:left' colspan='2'| | ||
system-boot » config.txt | system-boot » config.txt | ||
|- | |- | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='ini'> | ||
cat /media/${USER}/system-boot/config.txt && echo | cat /media/${USER}/system-boot/config.txt && echo | ||
<<-'TXT' | <<-'TXT' | ||
| Line 113: | Line 113: | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
|} | |} | ||
{|class='wikitable mw-collapsible mw-collapsed | {|class='wikitable mw-collapsible mw-collapsed' | ||
!scope='col' style='text-align:left'| | !scope='col' style='text-align:left'| | ||
system-boot » cmdline.txt | system-boot » cmdline.txt | ||
|- | |- | ||
|valign='top'| | |valign='top'| | ||
<syntaxhighlight | <syntaxhighlight lang='ini'> | ||
cat /media/${USER}/system-boot/cmdline.txt && echo | cat /media/${USER}/system-boot/cmdline.txt && echo | ||
:' | :' | ||
| Line 128: | Line 128: | ||
==SD Card » Pre-Boot== | ==SD Card » Pre-Boot== | ||
{|class='wikitable mw-collapsible | {|class='wikitable mw-collapsible' | ||
!scope='col' style='text-align:left'| | !scope='col' style='text-align:left'| | ||
SD Card » Pre-Boot | SD Card » Pre-Boot | ||
|- | |- | ||
|valign='top'| | |valign='top'| | ||
{|class='wikitable mw-collapsible | {|class='wikitable mw-collapsible' | ||
!scope='col' style='text-align:left' colspan='2'| | !scope='col' style='text-align:left' colspan='2'| | ||
system-boot » config.txt | system-boot » config.txt | ||
|- | |- | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='ini'> | ||
cat <<'INI' | tee -a /media/${USER}/system-boot/config.txt >/dev/null | cat <<'INI' | tee -a /media/${USER}/system-boot/config.txt >/dev/null | ||
dtoverlay=dwc2 | dtoverlay=dwc2 | ||
| Line 148: | Line 148: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
lsmod | grep -E 'dwc2|g_ether' | lsmod | grep -E 'dwc2|g_ether' | ||
dmesg | grep -E 'dwc2' | dmesg | grep -E 'dwc2' | ||
| Line 158: | Line 158: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} | ||
{|class='wikitable mw-collapsible mw-collapsed | {|class='wikitable mw-collapsible mw-collapsed' | ||
!scope='col' style='text-align:left'| | !scope='col' style='text-align:left'| | ||
system-boot » cmdline.txt | system-boot » cmdline.txt | ||
|- | |- | ||
|valign='top'| | |valign='top'| | ||
<syntaxhighlight | <syntaxhighlight lang='ini'> | ||
# modules-load=dwc2 | # modules-load=dwc2 | ||
| Line 172: | Line 172: | ||
|- | |- | ||
|valign='top'| | |valign='top'| | ||
<syntaxhighlight | <syntaxhighlight lang='ini'> | ||
# modules-load=dwc2,g_ether | # modules-load=dwc2,g_ether | ||
| Line 181: | Line 181: | ||
|- | |- | ||
|valign='top'| | |valign='top'| | ||
<syntaxhighlight | <syntaxhighlight lang='ini'> | ||
# modules-load=dwc2,g_ether | # modules-load=dwc2,g_ether | ||
# g_ether.host_addr=12:a5:cf:42:92:fd | # g_ether.host_addr=12:a5:cf:42:92:fd | ||
| Line 191: | Line 191: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} | ||
{|class='wikitable mw-collapsible mw-collapsed | {|class='wikitable mw-collapsible mw-collapsed' | ||
!scope='col' style='text-align:left' colspan='2'| | !scope='col' style='text-align:left' colspan='2'| | ||
writable » 10-usb-wan.yaml | writable » 10-usb-wan.yaml | ||
|- | |- | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='yaml'> | ||
ls -lah /media/${USER}/writable/etc/netplan/ | ls -lah /media/${USER}/writable/etc/netplan/ | ||
cat <<'YML' | sudo /media/${USER}/writable/etc/netplan/10-usb-wan.yaml >/dev/null | cat <<'YML' | sudo /media/${USER}/writable/etc/netplan/10-usb-wan.yaml >/dev/null | ||
| Line 221: | Line 221: | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
sudo netplan try --timeout 60 | sudo netplan try --timeout 60 | ||
sudo netplan generate | sudo netplan generate | ||
| Line 245: | Line 245: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} | ||
{|class='wikitable mw-collapsible | {|class='wikitable mw-collapsible' | ||
!scope='col' style='text-align:left' colspan='2'| | !scope='col' style='text-align:left' colspan='2'| | ||
writable » 99-usb-gadget.yaml | writable » 99-usb-gadget.yaml | ||
|- | |- | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='yaml'> | ||
ls -lah /media/${USER}/writable/etc/netplan/ | ls -lah /media/${USER}/writable/etc/netplan/ | ||
cat <<'YML' | sudo tee /media/${USER}/writable/etc/netplan/99-usb-gadget.yaml >/dev/null | cat <<'YML' | sudo tee /media/${USER}/writable/etc/netplan/99-usb-gadget.yaml >/dev/null | ||
| Line 268: | Line 268: | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
sudo netplan try --timeout 60 | sudo netplan try --timeout 60 | ||
sudo netplan generate | sudo netplan generate | ||
| Line 285: | Line 285: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} | ||
{|class='wikitable mw-collapsible mw-collapsed | {|class='wikitable mw-collapsible mw-collapsed' | ||
!scope='col' style='text-align:left' colspan='2'| | !scope='col' style='text-align:left' colspan='2'| | ||
writable » 70-usb-gadget-net.rules | writable » 70-usb-gadget-net.rules | ||
|- | |- | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='ini'> | ||
ls -lah /media/${USER}/writable/etc/udev/rules.d/ | ls -lah /media/${USER}/writable/etc/udev/rules.d/ | ||
cat <<'INI' | sudo tee /media/${USER}/writable/etc/udev/rules.d/70-usb-gadget-net.rules >/dev/null | cat <<'INI' | sudo tee /media/${USER}/writable/etc/udev/rules.d/70-usb-gadget-net.rules >/dev/null | ||
| Line 300: | Line 300: | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
sudo udevadm control --reload | sudo udevadm control --reload | ||
sudo udevadm trigger | sudo udevadm trigger | ||
| Line 312: | Line 312: | ||
==SD Card » Post-Boot== | ==SD Card » Post-Boot== | ||
{|class='wikitable mw-collapsible | {|class='wikitable mw-collapsible' | ||
!scope='col' style='text-align:left'| | !scope='col' style='text-align:left'| | ||
SD Card » Post-Boot | SD Card » Post-Boot | ||
|- | |- | ||
|valign='top'| | |valign='top'| | ||
{|class='wikitable mw-collapsible | {|class='wikitable mw-collapsible' | ||
!scope='col' style='text-align:left' colspan='2'| | !scope='col' style='text-align:left' colspan='2'| | ||
Post-Boot » Swapfile | Post-Boot » Swapfile | ||
|- | |- | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
cat <<'EXE' | sudo bash | cat <<'EXE' | sudo bash | ||
swapoff /swapfile | swapoff /swapfile | ||
| Line 331: | Line 331: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
cat << FST | sudo tee -a /etc/fstab >/dev/null | cat << FST | sudo tee -a /etc/fstab >/dev/null | ||
# Loopback Swap Space » 512Mi + 512Mi | # Loopback Swap Space » 512Mi + 512Mi | ||
| Line 340: | Line 340: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} | ||
{|class='wikitable mw-collapsible mw-collapsed | {|class='wikitable mw-collapsible mw-collapsed' | ||
!scope='col' style='text-align:left' colspan='2'| | !scope='col' style='text-align:left' colspan='2'| | ||
Post-Boot » 10-usb-wan.yaml | Post-Boot » 10-usb-wan.yaml | ||
|- | |- | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='yaml'> | ||
ls -lah /etc/netplan/ | ls -lah /etc/netplan/ | ||
cat <<'YML' | sudo /etc/netplan/10-usb-wan.yaml >/dev/null | cat <<'YML' | sudo /etc/netplan/10-usb-wan.yaml >/dev/null | ||
| Line 370: | Line 370: | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
sudo netplan try --timeout 60 | sudo netplan try --timeout 60 | ||
sudo netplan generate | sudo netplan generate | ||
| Line 394: | Line 394: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} | ||
{|class='wikitable mw-collapsible mw-collapsed | {|class='wikitable mw-collapsible mw-collapsed' | ||
!scope='col' style='text-align:left' colspan='2'| | !scope='col' style='text-align:left' colspan='2'| | ||
Post-Boot » 99-usb-gadget.yaml | Post-Boot » 99-usb-gadget.yaml | ||
|- | |- | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='yaml'> | ||
ls -lah /etc/netplan/ | ls -lah /etc/netplan/ | ||
cat <<'YML' | sudo tee /etc/netplan/99-usb-gadget.yaml >/dev/null | cat <<'YML' | sudo tee /etc/netplan/99-usb-gadget.yaml >/dev/null | ||
| Line 417: | Line 417: | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
sudo netplan try --timeout 60 | sudo netplan try --timeout 60 | ||
sudo netplan generate | sudo netplan generate | ||
| Line 434: | Line 434: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} | ||
{|class='wikitable mw-collapsible mw-collapsed | {|class='wikitable mw-collapsible mw-collapsed' | ||
!scope='col' style='text-align:left' colspan='2'| | !scope='col' style='text-align:left' colspan='2'| | ||
Post-Boot » 70-usb-gadget-net.rules | Post-Boot » 70-usb-gadget-net.rules | ||
|- | |- | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='ini'> | ||
ls -lah /etc/udev/rules.d/ | ls -lah /etc/udev/rules.d/ | ||
cat <<'INI' | sudo tee /etc/udev/rules.d/70-usb-gadget-net.rules >/dev/null | cat <<'INI' | sudo tee /etc/udev/rules.d/70-usb-gadget-net.rules >/dev/null | ||
| Line 449: | Line 449: | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
sudo udevadm control --reload | sudo udevadm control --reload | ||
sudo udevadm trigger | sudo udevadm trigger | ||
| Line 461: | Line 461: | ||
==Host » Ethernet » USB0== | ==Host » Ethernet » USB0== | ||
{|class='wikitable mw-collapsible | {|class='wikitable mw-collapsible' | ||
!scope='col' style='text-align:left'| | !scope='col' style='text-align:left'| | ||
Host » Ethernet » USB0 | Host » Ethernet » USB0 | ||
|- | |- | ||
|valign='top'| | |valign='top'| | ||
{|class='wikitable mw-collapsible mw-collapsed | {|class='wikitable mw-collapsible mw-collapsed' | ||
!scope='col' style='text-align:left' colspan='2'| | !scope='col' style='text-align:left' colspan='2'| | ||
Host » 70-pi-usb-net.rules | Host » 70-pi-usb-net.rules | ||
|- | |- | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='ini'> | ||
ls -lah /etc/udev/rules.d/ | ls -lah /etc/udev/rules.d/ | ||
cat <<'INI' | sudo tee /etc/udev/rules.d/70-pi-usb-net.rules >/dev/null | cat <<'INI' | sudo tee /etc/udev/rules.d/70-pi-usb-net.rules >/dev/null | ||
| Line 481: | Line 481: | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
sudo udevadm control --reload | sudo udevadm control --reload | ||
sudo udevadm trigger | sudo udevadm trigger | ||
| Line 490: | Line 490: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} | ||
{|class='wikitable mw-collapsible mw-collapsed | {|class='wikitable mw-collapsible mw-collapsed' | ||
!scope='col' style='text-align:left' colspan='2'| | !scope='col' style='text-align:left' colspan='2'| | ||
Host » 20-usb0.network » Match » MAC | Host » 20-usb0.network » Match » MAC | ||
|- | |- | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='ini'> | ||
ls -lah /etc/systemd/network/ | ls -lah /etc/systemd/network/ | ||
cat <<'INI' | sudo tee /etc/systemd/network/20-usb0.network >/dev/null | cat <<'INI' | sudo tee /etc/systemd/network/20-usb0.network >/dev/null | ||
| Line 509: | Line 509: | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
ls -l /etc/systemd/network/20-usb0.network | ls -l /etc/systemd/network/20-usb0.network | ||
sudo systemctl restart systemd-networkd | sudo systemctl restart systemd-networkd | ||
| Line 522: | Line 522: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} | ||
{|class='wikitable mw-collapsible mw-collapsed | {|class='wikitable mw-collapsible mw-collapsed' | ||
!scope='col' style='text-align:left' colspan='2'| | !scope='col' style='text-align:left' colspan='2'| | ||
Host » 20-usb0.network » Match » Name | Host » 20-usb0.network » Match » Name | ||
|- | |- | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='ini'> | ||
ls -lah /etc/systemd/network/ | ls -lah /etc/systemd/network/ | ||
cat <<'INI' | sudo tee /etc/systemd/network/20-usb0.network >/dev/null | cat <<'INI' | sudo tee /etc/systemd/network/20-usb0.network >/dev/null | ||
| Line 544: | Line 544: | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
ls -l /etc/systemd/network/20-usb0.network | ls -l /etc/systemd/network/20-usb0.network | ||
sudo systemctl restart systemd-networkd | sudo systemctl restart systemd-networkd | ||
| Line 563: | Line 563: | ||
==Utility » Install== | ==Utility » Install== | ||
{|class='wikitable mw-collapsible | {|class='wikitable mw-collapsible' | ||
!scope='col' style='text-align:left'| | !scope='col' style='text-align:left'| | ||
Utility » Install | Utility » Install | ||
|- | |- | ||
|valign='top'| | |valign='top'| | ||
{|class='wikitable mw-collapsible mw-collapsed | {|class='wikitable mw-collapsible mw-collapsed' | ||
!scope='col' style='text-align:left' colspan='2'| | !scope='col' style='text-align:left' colspan='2'| | ||
Install » LXD | Install » LXD | ||
|- | |- | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
cat << EXE | sudo bash | cat << EXE | sudo bash | ||
snap install lxd --channel=6/stable | snap install lxd --channel=6/stable | ||
| Line 612: | Line 612: | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='yaml'> | ||
cat <<'YML' | sudo lxd init --preseed | cat <<'YML' | sudo lxd init --preseed | ||
--- | --- | ||
| Line 650: | Line 650: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} | ||
{|class='wikitable mw-collapsible mw-collapsed | {|class='wikitable mw-collapsible mw-collapsed' | ||
!scope='col' style='text-align:left' colspan='2'| | !scope='col' style='text-align:left' colspan='2'| | ||
Install » Docker | Install » Docker | ||
|- | |- | ||
|valign='top' colspan='2'| | |valign='top' colspan='2'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg \ | curl -fsSL https://download.docker.com/linux/ubuntu/gpg \ | ||
| sudo tee /etc/apt/keyrings/docker.asc >/dev/null | | sudo tee /etc/apt/keyrings/docker.asc >/dev/null | ||
| Line 666: | Line 666: | ||
|- | |- | ||
|valign='top' colspan='2'| | |valign='top' colspan='2'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
cat << EXE | sudo bash | cat << EXE | sudo bash | ||
apt-get update;echo | apt-get update;echo | ||
| Line 677: | Line 677: | ||
|- | |- | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='json'> | ||
cat << EOF | sudo tee /etc/docker/daemon.json >/dev/null | cat << EOF | sudo tee /etc/docker/daemon.json >/dev/null | ||
{ | { | ||
| Line 694: | Line 694: | ||
|- | |- | ||
|valign='top'| | |valign='top'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
cat << EXE | sudo bash | cat << EXE | sudo bash | ||
systemctl stop docker.socket | systemctl stop docker.socket | ||
| Line 704: | Line 704: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|valign='top'| | |valign='top'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
docker network ls | docker network ls | ||
echo 'id -nG' | sudo -i -u shahed bash | echo 'id -nG' | sudo -i -u shahed bash | ||
| Line 714: | Line 714: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} | ||
{|class='wikitable mw-collapsible | {|class='wikitable mw-collapsible' | ||
!scope='col' style='text-align:left' colspan='2'| | !scope='col' style='text-align:left' colspan='2'| | ||
Install » Pi-hole | Install » Pi-hole | ||
|- | |- | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
ssh -i ~/.ssh/cid.chorke.org_ed25519 -qt shahed@192.168.10.2 bash | ssh -i ~/.ssh/cid.chorke.org_ed25519 -qt shahed@192.168.10.2 bash | ||
sudo su | sudo su | ||
| Line 730: | Line 730: | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
cat << EXE | sudo bash | cat << EXE | sudo bash | ||
ufw allow 53 | ufw allow 53 | ||
| Line 740: | Line 740: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|- | |- | ||
|valign='top' colspan='2'| | |||
{|class='wikitable mw-collapsible' | |||
!scope='col' style='text-align:left' colspan='2'| | |||
Pi-hole » Config | |||
|- | |||
|valign='top' style='width:50%'| | |||
<syntaxhighlight lang='bash'> | |||
echo ;\ | |||
sudo pihole-FTL --config dns.upstreams | |||
# pihole-FTL --config dns.upstreams '[]' | |||
sudo pihole-FTL --config dns.upstreams '[ | |||
"1.1.1.1", | |||
"8.8.8.8" | |||
]' | |||
</syntaxhighlight> | |||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight style=' | <syntaxhighlight lang='bash'> | ||
echo ;\ | |||
sudo pihole-FTL --config dns.revServers | |||
# pihole-FTL --config dns.revServers '[]' | |||
sudo pihole-FTL --config dns.revServers '[ | |||
"true,192.168.10.0/24,192.168.10.2,biz.otg", | |||
"true,192.168.49.0/24,192.168.49.110,biz.ops" | |||
]' | |||
</syntaxhighlight> | |||
|- | |||
|valign='top'| | |||
<syntaxhighlight lang='bash'> | |||
echo ;\ | |||
sudo pihole-FTL --config dns.hosts | |||
# pihole-FTL --config dns.hosts '[]' | |||
sudo pihole-FTL --config dns.hosts '[ | |||
"10.20.40.1 aa.shahed.shahed.biz.otg", | |||
"10.20.40.2 aa.shahed.shahed.biz.otg", | |||
"10.20.41.1 aa.hetzner.shahed.biz.otg", | |||
"10.20.41.2 ab.hetzner.shahed.biz.otg", | |||
"192.168.10.1 gw.shahed.biz.otg", | |||
"192.168.10.3 ab.shahed.biz.otg", | |||
"192.168.10.4 ac.shahed.biz.otg", | |||
"192.168.10.2 ns0.shahed.biz.otg", | |||
"192.168.49.110 ns0.shahed.biz.ops", | |||
"192.168.49.102 pgsql.shahed.biz.ops", | |||
"192.168.49.100 kafka.shahed.biz.ops", | |||
"192.168.49.101 mariadb.shahed.biz.ops" | |||
]' | |||
</syntaxhighlight> | |||
|valign='top'| | |||
<syntaxhighlight lang='bash'> | |||
echo ;\ | |||
sudo pihole-FTL --config misc.dnsmasq_lines | |||
# pihole-FTL --config misc.dnsmasq_lines '[]' | |||
sudo pihole-FTL --config misc.dnsmasq_lines '[ | |||
"address=/biz.otg/192.168.10.2", | |||
"address=/com.otg/192.168.10.2", | |||
"address=/org.otg/192.168.10.2", | |||
"address=/bd.ops/192.168.49.110", | |||
"address=/io.ops/192.168.49.110", | |||
"address=/my.ops/192.168.49.110", | |||
"address=/biz.ops/192.168.49.110", | |||
"address=/com.ops/192.168.49.110", | |||
"address=/k8s.ops/192.168.49.110", | |||
"address=/org.ops/192.168.49.110", | |||
"address=/group.ops/192.168.49.110", | |||
"dhcp-option=6,192.168.10.1" | |||
]' | |||
</syntaxhighlight> | |||
|- | |||
|valign='top'| | |||
<syntaxhighlight lang='bash'> | |||
echo ;\ | |||
sudo pihole-FTL --config dns.cnameRecords | |||
# pihole-FTL --config dns.cnameRecords '[]' | |||
sudo pihole-FTL --config dns.cnameRecords '[ | |||
"bd.ops,ns0.shahed.biz.ops", | |||
"io.ops,ns0.shahed.biz.ops", | |||
"my.ops,ns0.shahed.biz.ops", | |||
"biz.ops,ns0.shahed.biz.ops", | |||
"com.ops,ns0.shahed.biz.ops", | |||
"k8s.ops,ns0.shahed.biz.ops", | |||
"org.ops,ns0.shahed.biz.ops", | |||
"biz.otg,ns0.shahed.biz.otg", | |||
"group.ops,ns0.shahed.biz.ops", | |||
"k8s.shahed.biz.ops,www.k8s.ops", | |||
"host.shahed.biz.ops,host.k8s.ops", | |||
"dev.shahed.biz,ns0.shahed.biz.ops", | |||
"pihole.shahed.biz.ops,ns0.shahed.biz.ops", | |||
"psql.shahed.biz.ops,pgsql.shahed.biz.ops", | |||
"mysql.shahed.biz.ops,mariadb.shahed.biz.ops" | |||
]' | |||
</syntaxhighlight> | |||
|valign='top'| | |||
<syntaxhighlight lang='bash'> | |||
printf '\n\e[1;37mCompatibility:\e[0m\n:' | |||
sudo pihole-FTL --config misc.etc_dnsmasq_d | |||
sudo pihole-FTL --config misc.etc_dnsmasq_d false | |||
nslookup ab.shahed.biz.otg | |||
nslookup kafka.shahed.biz.ops | |||
nslookup mariadb.shahed.biz.ops | |||
ping -c3 192.168.10.1 | |||
ping -c3 192.168.10.2 | |||
dig +short @192.168.10.2 -x 192.168.10.1 | |||
dig +short @192.168.10.2 gw.shahed.biz.otg | |||
ping -c3 192.168.49.110 | |||
dig +short @192.168.49.110 -x 192.168.49.110 | |||
dig +short @192.168.49.110 pihole.shahed.biz.ops | |||
ping -c3 192.168.49.100 | |||
dig +short @192.168.49.110 -x 192.168.49.100 | |||
dig +short @192.168.49.110 kafka.shahed.biz.ops | |||
</syntaxhighlight> | |||
|} | |||
{|class='wikitable mw-collapsible mw-collapsed' | |||
!scope='col' style='text-align:left' colspan='2'| | |||
Pi-hole » Config » Legacy | |||
|- | |||
|valign='top' style='width:50%'| | |||
<syntaxhighlight lang='bash'> | |||
echo;\ | echo;\ | ||
sudo cat /etc/addn-hosts; | sudo cat /etc/addn-hosts; | ||
| Line 763: | Line 884: | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
echo;\ | echo;\ | ||
sudo cat /etc/dnsmasq.d/02-custom.conf; | sudo cat /etc/dnsmasq.d/02-custom.conf; | ||
| Line 784: | Line 905: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|- | |- | ||
|valign='top | |valign='top'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
echo;\ | echo;\ | ||
sudo cat /etc/dnsmasq.d/05-pihole-custom-cname.conf; | sudo cat /etc/dnsmasq.d/05-pihole-custom-cname.conf; | ||
| Line 808: | Line 929: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|valign='top | |valign='top'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
printf '\n\e[1;37mCompatibility:\e[0m\n:' | |||
sudo pihole-FTL --config misc.etc_dnsmasq_d | |||
sudo pihole-FTL --config misc.etc_dnsmasq_d true | |||
nslookup ab.shahed.biz.otg | nslookup ab.shahed.biz.otg | ||
nslookup kafka.shahed.biz.ops | nslookup kafka.shahed.biz.ops | ||
| Line 826: | Line 951: | ||
dig +short @192.168.49.110 -x 192.168.49.100 | dig +short @192.168.49.110 -x 192.168.49.100 | ||
dig +short @192.168.49.110 kafka.shahed.biz.ops | dig +short @192.168.49.110 kafka.shahed.biz.ops | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |||
|} | |} | ||
|} | |} | ||
==Playground== | ==Playground== | ||
{|class='wikitable mw-collapsible | {|class='wikitable mw-collapsible' | ||
!scope='col' style='text-align:left' colspan='2'| | !scope='col' style='text-align:left' colspan='2'| | ||
Playground | Playground | ||
|- | |- | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
printf '\n\e[1;37mIsolation:\e[0m\n:' | printf '\n\e[1;37mIsolation:\e[0m\n:' | ||
sudo pihole-FTL --config webserver.port | sudo pihole-FTL --config webserver.port | ||
| Line 847: | Line 969: | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
echo ;\ | echo ;\ | ||
sudo pihole-FTL --config webserver.port | sudo pihole-FTL --config webserver.port | ||
| Line 854: | Line 976: | ||
|- | |- | ||
|valign='top'| | |valign='top'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
printf '\n\e[1;37mCompatibility:\e[0m\n:' | printf '\n\e[1;37mCompatibility:\e[0m\n:' | ||
sudo pihole-FTL --config misc.etc_dnsmasq_d | sudo pihole-FTL --config misc.etc_dnsmasq_d | ||
| Line 861: | Line 983: | ||
|valign='top'| | |valign='top'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
echo ;\ | echo ;\ | ||
sudo pihole-FTL --config misc.etc_dnsmasq_d | sudo pihole-FTL --config misc.etc_dnsmasq_d | ||
| Line 868: | Line 990: | ||
|- | |- | ||
|valign='top'| | |valign='top'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
printf '\n\e[1;37mCompatibility:\e[0m\n:' | printf '\n\e[1;37mCompatibility:\e[0m\n:' | ||
sudo pihole-FTL --config dns.cnameRecords | sudo pihole-FTL --config dns.cnameRecords | ||
| Line 875: | Line 997: | ||
|valign='top'| | |valign='top'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
printf '\n\e[1;37mCompatibility:\e[0m\n:' | printf '\n\e[1;37mCompatibility:\e[0m\n:' | ||
sudo pihole-FTL --config misc.dnsmasq_lines | sudo pihole-FTL --config misc.dnsmasq_lines | ||
| Line 882: | Line 1,004: | ||
|- | |- | ||
|valign='top'| | |valign='top'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
printf '\n\e[1;37mCompatibility:\e[0m\n:' | printf '\n\e[1;37mCompatibility:\e[0m\n:' | ||
sudo pihole-FTL --config dns.hosts | sudo pihole-FTL --config dns.hosts | ||
| Line 889: | Line 1,011: | ||
|valign='top'| | |valign='top'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
printf '\n\e[1;37mCompatibility:\e[0m\n:' | printf '\n\e[1;37mCompatibility:\e[0m\n:' | ||
sudo pihole-FTL --config dns.hosts | sudo pihole-FTL --config dns.hosts | ||
| Line 896: | Line 1,018: | ||
|- | |- | ||
|valign='top'| | |valign='top'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
sudo systemctl restart pihole-FTL | sudo systemctl restart pihole-FTL | ||
sudo pihole networkflush | sudo pihole networkflush | ||
| Line 904: | Line 1,026: | ||
|valign='top'| | |valign='top'| | ||
<syntaxhighlight lang='bash'> | |||
sudo cat /etc/pihole/migration_backup/adlists.list | |||
sudo cat /etc/pihole/hosts/custom.list | |||
sudo cat /etc/pihole/dnsmasq.conf | |||
sudo cat /etc/pihole/pihole.toml | |||
</syntaxhighlight> | |||
|- | |||
|valign='top'| | |||
<syntaxhighlight lang='bash'> | |||
# pihole » domain » list » allow | |||
sudo pihole allow gitlab.shahed.biz | |||
sudo pihole reloaddns | |||
sudo pihole allow -l | |||
</syntaxhighlight> | |||
|valign='top'| | |||
<syntaxhighlight lang='bash'> | |||
# pihole » domain » list » allow » delete | |||
sudo pihole allow gitlab.shahed.biz -d | |||
sudo pihole reloaddns | |||
sudo pihole allow -l | |||
</syntaxhighlight> | |||
|- | |||
|valign='top'| | |||
<syntaxhighlight lang='bash'> | |||
# pihole » domain » list » allow » wild | |||
sudo pihole --allow-wild shahed.biz | |||
sudo pihole --allow-wild -l | |||
sudo pihole reloaddns | |||
</syntaxhighlight> | |||
|valign='top'| | |||
<syntaxhighlight lang='bash'> | |||
# pihole » domain » list » allow » wild » delete | |||
sudo pihole --allow-wild shahed.biz -d | |||
sudo pihole --allow-wild -l | |||
sudo pihole reloaddns | |||
</syntaxhighlight> | |||
|- | |||
|valign='top'| | |||
<syntaxhighlight lang='bash'> | |||
cat <<'EXE' | sudo bash | |||
echo | |||
while read -r domain; do | |||
pihole --allow-wild ${domain} || true | |||
done <<'DNS' | |||
cloudflareinsights.com | |||
cloudflareclient.com | |||
alpinelinux.org | |||
finology.com.my | |||
xpresscover.io | |||
loanstreet.my | |||
DNS | |||
echo ; pihole --allow-wild -l | |||
echo ; pihole allow -l | |||
echo ; pihole reloaddns | |||
EXE | |||
</syntaxhighlight> | |||
|valign='top'| | |||
<syntaxhighlight lang='bash'> | |||
cat <<'EXE' | sudo bash | |||
echo | |||
while read -r domain; do | |||
pihole --allow-wild ${domain} || true | |||
done <<'DNS' | |||
snapcraft.io | |||
bmet.gov.bd | |||
chorke.com | |||
chorke.org | |||
github.com | |||
shahed.biz | |||
DNS | |||
echo ; pihole --allow-wild -l | |||
echo ; pihole allow -l | |||
echo ; pihole reloaddns | |||
EXE | |||
</syntaxhighlight> | |||
|} | |} | ||
==References== | ==References== | ||
{|class='wikitable mw-collapsible | {|class='wikitable mw-collapsible' | ||
!scope='col' style='text-align:left' colspan='3'| | !scope='col' style='text-align:left' colspan='3'| | ||
References | References | ||
|- | |- | ||
|valign='top' style='width:33%'| | |valign='top' style='width:33%'| | ||
* [[Raspberry Pi/5 16GB/Debian/13|Raspberry Pi » 5 16GB » Debian » 13]] | |||
* [https://downloads.raspberrypi.com/imager/ Raspberry Pi » Download] | * [https://downloads.raspberrypi.com/imager/ Raspberry Pi » Download] | ||
* [https://www.raspberrypi.com/software/ Raspberry Pi] | * [https://www.raspberrypi.com/software/ Raspberry Pi] | ||
| Line 954: | Line 1,159: | ||
* [[Diagram/Kroki|Diagram » Kroki]] | * [[Diagram/Kroki|Diagram » Kroki]] | ||
* [[Diagram]] | * [[Diagram]] | ||
* [[K9s]] | |||
|} | |} | ||
Latest revision as of 00:48, 19 January 2026
lsblk
:'
sdb 8:16 1 29.8G 0 disk
├─sdb1 8:17 1 512M 0 part /media/shahed/system-boot
└─sdb2 8:18 1 29.3G 0 part /media/shahed/writable
'
|
ls -alh /media/${USER}/system-boot/{ssh,{config,cmdline}.txt}
:'
-rw-r--r-- 1 shahed shahed 170 Dec 30 01:03 /media/shahed/system-boot/cmdline.txt
-rw-r--r-- 1 shahed shahed 1.8K Dec 29 21:13 /media/shahed/system-boot/config.txt
-rw-r--r-- 1 shahed shahed 0 Dec 29 17:45 /media/shahed/system-boot/ssh
'
| ||||||
ls -lah /media/${USER}/writable/etc/netplan/
:'
total 12K
drwxr-xr-x 2 root root 4.0K Dec 30 08:29 .
drwxr-xr-x 108 root root 4.0K Dec 29 20:55 ..
-rw------- 1 root root 262 Dec 29 17:22 50-cloud-init.yaml
'
|
ls -lah /media/${USER}/writable/etc/udev/rules.d/
:'
total 72K
drwxr-xr-x 2 root root 4.0K Aug 6 01:00 .
drwxr-xr-x 4 root root 4.0K Dec 29 20:47 ..
-rw-r--r-- 1 root root 62K Aug 6 01:00 70-snap.snapd.rules
'
| ||||||
| |||||||
SD Card » Pre-Boot
|
SD Card » Pre-Boot | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||
SD Card » Post-Boot
|
SD Card » Post-Boot | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||
Host » Ethernet » USB0
|
Host » Ethernet » USB0 | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||
Utility » Install
|
Utility » Install | ||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||
Playground
|
Playground | |
|---|---|
printf '\n\e[1;37mIsolation:\e[0m\n:'
sudo pihole-FTL --config webserver.port
sudo pihole-FTL --config webserver.port "127.0.0.1:8080"
|
echo ;\
sudo pihole-FTL --config webserver.port
sudo pihole-FTL --config webserver.port "80o,443os,[::]:80o,[::]:443os"
|
printf '\n\e[1;37mCompatibility:\e[0m\n:'
sudo pihole-FTL --config misc.etc_dnsmasq_d
sudo pihole-FTL --config misc.etc_dnsmasq_d true
|
echo ;\
sudo pihole-FTL --config misc.etc_dnsmasq_d
sudo pihole-FTL --config misc.etc_dnsmasq_d false
|
printf '\n\e[1;37mCompatibility:\e[0m\n:'
sudo pihole-FTL --config dns.cnameRecords
sudo cat /etc/dnsmasq.d/05-pihole-custom-cname.conf
|
printf '\n\e[1;37mCompatibility:\e[0m\n:'
sudo pihole-FTL --config misc.dnsmasq_lines
sudo cat /etc/dnsmasq.d/02-custom.conf
|
printf '\n\e[1;37mCompatibility:\e[0m\n:'
sudo pihole-FTL --config dns.hosts
sudo cat /etc/pihole/hosts/custom.list
|
printf '\n\e[1;37mCompatibility:\e[0m\n:'
sudo pihole-FTL --config dns.hosts
sudo cat /etc/addn-hosts
|
sudo systemctl restart pihole-FTL
sudo pihole networkflush
sudo pihole reloadlists
sudo pihole reloaddns
|
sudo cat /etc/pihole/migration_backup/adlists.list
sudo cat /etc/pihole/hosts/custom.list
sudo cat /etc/pihole/dnsmasq.conf
sudo cat /etc/pihole/pihole.toml
|
# pihole » domain » list » allow
sudo pihole allow gitlab.shahed.biz
sudo pihole reloaddns
sudo pihole allow -l
|
# pihole » domain » list » allow » delete
sudo pihole allow gitlab.shahed.biz -d
sudo pihole reloaddns
sudo pihole allow -l
|
# pihole » domain » list » allow » wild
sudo pihole --allow-wild shahed.biz
sudo pihole --allow-wild -l
sudo pihole reloaddns
|
# pihole » domain » list » allow » wild » delete
sudo pihole --allow-wild shahed.biz -d
sudo pihole --allow-wild -l
sudo pihole reloaddns
|
cat <<'EXE' | sudo bash
echo
while read -r domain; do
pihole --allow-wild ${domain} || true
done <<'DNS'
cloudflareinsights.com
cloudflareclient.com
alpinelinux.org
finology.com.my
xpresscover.io
loanstreet.my
DNS
echo ; pihole --allow-wild -l
echo ; pihole allow -l
echo ; pihole reloaddns
EXE
|
cat <<'EXE' | sudo bash
echo
while read -r domain; do
pihole --allow-wild ${domain} || true
done <<'DNS'
snapcraft.io
bmet.gov.bd
chorke.com
chorke.org
github.com
shahed.biz
DNS
echo ; pihole --allow-wild -l
echo ; pihole allow -l
echo ; pihole reloaddns
EXE
|
References
|
References | ||
|---|---|---|