Cloud/Shahed/AA: Difference between revisions
Jump to navigation
Jump to search
(→WOL) |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 17: | Line 17: | ||
apt-get install -y wakeonlan;echo | apt-get install -y wakeonlan;echo | ||
EXE | EXE | ||
</syntaxhighlight> | |||
==WOL » MAC » Find== | |||
<syntaxhighlight lang="bash"> | |||
WOL_HOST='shahed-an.local' | |||
ping -q -c5 "${WOL_HOST}" >/dev/null | |||
WOL_IPV4="$(getent hosts "${WOL_HOST}"|awk '{print $1}')" | |||
WOL_MACA="$(arp -n "${WOL_IPV4}"|awk 'NR==2 {print $3}')" | |||
printf '\n%s » %s » %s\n' "${WOL_HOST}" "${WOL_IPV4}" "${WOL_MACA}" | |||
</syntaxhighlight> | |||
==WOL » Shahed » AE== | |||
<syntaxhighlight lang="bash"> | |||
wakeonlan 8c:c6:81:94:70:91 | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==WOL » Shahed » AN== | ==WOL » Shahed » AN== | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
wakeonlan 84:47:09:3c:3e:0a | |||
wakeonlan 84:47:09:3c:3e:09 | |||
wakeonlan | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Latest revision as of 10:07, 11 April 2025
SSH
ssh -qt [email protected] bash
cat <<'EXE' | sudo bash
free -th && echo && systemd-analyze && echo
df -h && echo && lsblk && echo
swapon --show
EXE
WOL
cat <<'EXE'| sudo bash
apt-get update;echo
apt list -a --upgradable;echo
apt-get install -y wakeonlan;echo
EXE
WOL » MAC » Find
WOL_HOST='shahed-an.local'
ping -q -c5 "${WOL_HOST}" >/dev/null
WOL_IPV4="$(getent hosts "${WOL_HOST}"|awk '{print $1}')"
WOL_MACA="$(arp -n "${WOL_IPV4}"|awk 'NR==2 {print $3}')"
printf '\n%s » %s » %s\n' "${WOL_HOST}" "${WOL_IPV4}" "${WOL_MACA}"
WOL » Shahed » AE
wakeonlan 8c:c6:81:94:70:91
WOL » Shahed » AN
wakeonlan 84:47:09:3c:3e:0a
wakeonlan 84:47:09:3c:3e:09
Cloudflare » VIRT
cat << INI | sudo tee /etc/systemd/system/warp0.service >/dev/null
[Unit]
Description=Cloudflared WARP Routing Virtual Interface
After=network.target
[Service]
Type=oneshot
ExecStart=/usr/sbin/ip link add warp0 type dummy
ExecStartPost=/usr/sbin/ip addr add 10.20.40.1/32 dev warp0
ExecStartPost=/usr/sbin/ip link set warp0 up
ExecStop=/usr/sbin/ip link delete warp0
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
INI
cat << EXE | sudo bash
systemctl daemon-reload
systemctl enable --now warp0.service
systemctl status warp0.service
EXE
ip a
Cloudflare » Argo » Tunnel
wget -cq https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-arm64.deb -P ${HOME}/Downloads
sudo dpkg -i ${HOME}/Downloads/cloudflared-linux-arm64.deb; sudo apt install -f
rm -rf ${HOME}/Downloads/cloudflared-linux-arm64.deb
cat <<'SYS' | sudo tee -a /etc/sysctl.conf >/dev/null
###################################################################
# Cloudflared Tunnel Private Network Config
# This config added by Chorke Academia, Inc
# ICMP Group ID Range 0 to 10,000 Users
net.ipv4.ping_group_range = 0 10000
# 208 KiB Default RX Buffer
net.core.rmem_default=212992
# 208 KiB Default TX Buffer
net.core.wmem_default=212992
# 8 MB Maximum RX Buffer
net.core.rmem_max=8388608
# 8 MB Maximum TX Buffer
net.core.wmem_max=8388608
SYS
sudo sysctl -p
Cloudflare » WARP » Forward
sudo vim /etc/sysctl.conf
# Uncomment the next line to enable packet forwarding for IPv4
net.ipv4.ip_forward=1
sudo sysctl -p net.ipv4.ip_forward = 1 ip route | grep default default via 10.19.83.1 dev wlan0 proto dhcp src 10.19.83.68 metric 600
Implement Forward Routing | |||
---|---|---|---|
Name | Network | Subnets | Forward |
Network » shahed-aj | 10.20.40.10/32 |
10.20.40.10/32 = 1 |
⚪️ |
Network » shahed-ak | 10.20.40.11/32 |
10.20.40.11/32 = 1 |
⚪️ |
Network » shahed-al | 10.20.40.12/32 |
10.20.40.12/32 = 1 |
✅ |
Network » shahed-am | 10.20.40.13/32 |
10.20.40.13/32 = 1 |
✅ |
Network » shahed-an | 10.20.40.14/32 |
10.20.40.14/32 = 1 |
⚪️ |
cat <<'INI' | sudo tee /etc/systemd/system/warp-route.service >/dev/null
[Unit]
Description=WARP Routes Over LAN
Wants=network-online.target
After=network-online.target
[Service]
Type=oneshot
ExecStartPre=/bin/sleep 15
ExecStart=/usr/sbin/ip route add 10.20.40.12/32 via 10.19.83.101
ExecStart=/usr/sbin/ip route add 10.20.40.13/32 via 10.19.83.100
ExecStop=/usr/sbin/ip route del 10.20.40.12/32
ExecStop=/usr/sbin/ip route del 10.20.40.13/32
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
INI
cat << EXE | sudo bash
systemctl daemon-reload
cat /etc/systemd/system/warp-route.service
systemctl enable --now warp-route.service
systemctl status warp-route.service
echo && ip route show
echo && sysctl -p
EXE
cat << EXE | bash
traceroute 10.20.40.12
traceroute 10.20.40.13
EXE
cat << EXE | sudo bash
systemctl daemon-reload
cat /etc/systemd/system/warp-route.service
systemctl disable --now warp-route.service
systemctl status warp-route.service
echo && ip route show
echo && sysctl -p
EXE
References
| ||
| ||
| ||