Cloudflare/Argo Tunnel: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
(3 intermediate revisions by the same user not shown) | |||
Line 33: | Line 33: | ||
cloudflared --origincert=\ | cloudflared --origincert=\ | ||
/root/.cloudflared/certs/chorke.com.pem \ | /root/.cloudflared/certs/chorke.com.pem \ | ||
tunnel create aa-chorke-com | tunnel create aa-chorke-com-argo | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 40: | Line 40: | ||
cloudflared --origincert=\ | cloudflared --origincert=\ | ||
/root/.cloudflared/certs/chorke.org.pem \ | /root/.cloudflared/certs/chorke.org.pem \ | ||
tunnel create aa-chorke-org | tunnel create aa-chorke-org-argo | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 47: | Line 47: | ||
cloudflared --origincert=\ | cloudflared --origincert=\ | ||
/root/.cloudflared/certs/shahed.biz.pem \ | /root/.cloudflared/certs/shahed.biz.pem \ | ||
tunnel create aa-shahed-biz | tunnel create aa-shahed-biz-argo | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 105: | Line 105: | ||
cloudflared --origincert=\ | cloudflared --origincert=\ | ||
/root/.cloudflared/certs/chorke.com.pem \ | /root/.cloudflared/certs/chorke.com.pem \ | ||
tunnel route dns aa-chorke-com aa | tunnel route dns aa-chorke-com-argo aa | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 112: | Line 112: | ||
cloudflared --origincert=\ | cloudflared --origincert=\ | ||
/root/.cloudflared/certs/chorke.org.pem \ | /root/.cloudflared/certs/chorke.org.pem \ | ||
tunnel route dns aa-chorke-org aa | tunnel route dns aa-chorke-org-argo aa | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 119: | Line 119: | ||
cloudflared --origincert=\ | cloudflared --origincert=\ | ||
/root/.cloudflared/certs/shahed.biz.pem \ | /root/.cloudflared/certs/shahed.biz.pem \ | ||
tunnel route dns aa-shahed-biz aa | tunnel route dns aa-shahed-biz-argo aa | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 151: | Line 151: | ||
cat << YML | sudo tee ${CONFIG_FILE} >/dev/null | cat << YML | sudo tee ${CONFIG_FILE} >/dev/null | ||
--- | --- | ||
tunnel: aa-chorke-com | tunnel: aa-chorke-com-argo | ||
credentials-file: ${AUTHNZ_FILE} | credentials-file: ${AUTHNZ_FILE} | ||
Line 196: | Line 196: | ||
cat << YML | sudo tee ${CONFIG_FILE} >/dev/null | cat << YML | sudo tee ${CONFIG_FILE} >/dev/null | ||
--- | --- | ||
tunnel: aa-chorke-org | tunnel: aa-chorke-org-argo | ||
credentials-file: ${AUTHNZ_FILE} | credentials-file: ${AUTHNZ_FILE} | ||
Line 241: | Line 241: | ||
cat << YML | sudo tee ${CONFIG_FILE} >/dev/null | cat << YML | sudo tee ${CONFIG_FILE} >/dev/null | ||
--- | --- | ||
tunnel: aa-shahed-biz | tunnel: aa-shahed-biz-argo | ||
credentials-file: ${AUTHNZ_FILE} | credentials-file: ${AUTHNZ_FILE} | ||
Line 286: | Line 286: | ||
sudo cloudflared tunnel \ | sudo cloudflared tunnel \ | ||
--config /etc/cloudflared/chorke.com-config.yml \ | --config /etc/cloudflared/chorke.com-config.yml \ | ||
run aa-chorke-com | run aa-chorke-com-argo | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 293: | Line 293: | ||
sudo cloudflared tunnel \ | sudo cloudflared tunnel \ | ||
--config /etc/cloudflared/chorke.org-config.yml \ | --config /etc/cloudflared/chorke.org-config.yml \ | ||
run aa-chorke-org | run aa-chorke-org-argo | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 300: | Line 300: | ||
sudo cloudflared tunnel \ | sudo cloudflared tunnel \ | ||
--config /etc/cloudflared/shahed.biz-config.yml \ | --config /etc/cloudflared/shahed.biz-config.yml \ | ||
run aa-shahed-biz | run aa-shahed-biz-argo | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 490: | Line 490: | ||
cloudflared --origincert=\ | cloudflared --origincert=\ | ||
/root/.cloudflared/certs/chorke.com.pem \ | /root/.cloudflared/certs/chorke.com.pem \ | ||
tunnel create ab-chorke-com | tunnel create ab-chorke-com-argo | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 497: | Line 497: | ||
cloudflared --origincert=\ | cloudflared --origincert=\ | ||
/root/.cloudflared/certs/chorke.org.pem \ | /root/.cloudflared/certs/chorke.org.pem \ | ||
tunnel create ab-chorke-org | tunnel create ab-chorke-org-argo | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 504: | Line 504: | ||
cloudflared --origincert=\ | cloudflared --origincert=\ | ||
/root/.cloudflared/certs/shahed.biz.pem \ | /root/.cloudflared/certs/shahed.biz.pem \ | ||
tunnel create ab-shahed-biz | tunnel create ab-shahed-biz-argo | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 583: | Line 583: | ||
cat << YML | sudo tee ${CONFIG_FILE} >/dev/null | cat << YML | sudo tee ${CONFIG_FILE} >/dev/null | ||
--- | --- | ||
tunnel: ab-chorke-com | tunnel: ab-chorke-com-argo | ||
credentials-file: ${AUTHNZ_FILE} | credentials-file: ${AUTHNZ_FILE} | ||
Line 608: | Line 608: | ||
cat << YML | sudo tee ${CONFIG_FILE} >/dev/null | cat << YML | sudo tee ${CONFIG_FILE} >/dev/null | ||
--- | --- | ||
tunnel: ab-chorke-org | tunnel: ab-chorke-org-argo | ||
credentials-file: ${AUTHNZ_FILE} | credentials-file: ${AUTHNZ_FILE} | ||
Line 633: | Line 633: | ||
cat << YML | sudo tee ${CONFIG_FILE} >/dev/null | cat << YML | sudo tee ${CONFIG_FILE} >/dev/null | ||
--- | --- | ||
tunnel: ab-shahed-biz | tunnel: ab-shahed-biz-argo | ||
credentials-file: ${AUTHNZ_FILE} | credentials-file: ${AUTHNZ_FILE} | ||
Line 658: | Line 658: | ||
sudo cloudflared tunnel \ | sudo cloudflared tunnel \ | ||
--config /etc/cloudflared/chorke.com-config.yml \ | --config /etc/cloudflared/chorke.com-config.yml \ | ||
run ab-chorke-com | run ab-chorke-com-argo | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 665: | Line 665: | ||
sudo cloudflared tunnel \ | sudo cloudflared tunnel \ | ||
--config /etc/cloudflared/chorke.org-config.yml \ | --config /etc/cloudflared/chorke.org-config.yml \ | ||
run ab-chorke-org | run ab-chorke-org-argo | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 672: | Line 672: | ||
sudo cloudflared tunnel \ | sudo cloudflared tunnel \ | ||
--config /etc/cloudflared/shahed.biz-config.yml \ | --config /etc/cloudflared/shahed.biz-config.yml \ | ||
run ab-shahed-biz | run ab-shahed-biz-argo | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 745: | Line 745: | ||
* [https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/use-cases/smb/ Cloudflare » Zero Trust » SMB] | * [https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/use-cases/smb/ Cloudflare » Zero Trust » SMB] | ||
* [https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/use-cases/ssh/ Cloudflare » Zero Trust » SSH] | * [https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/use-cases/ssh/ Cloudflare » Zero Trust » SSH] | ||
* [https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/ Cloudflare » Tunnel] | |||
* [https://www.cloudflare.com/learning/access-management/what-is-ssh/ Cloudflare » SSH] | |||
|valign="top"| | |||
* [https://developers.cloudflare.com/cloudflare-one/connections/connect-devices/agentless/ Cloudflare » Zero Trust » Devices » Agentless] | |||
* [https://developers.cloudflare.com/cloudflare-one/connections/connect-devices/warp/ Cloudflare » Zero Trust » Devices » WARP] | |||
|valign="top"| | |||
|- | |||
|colspan="3"| | |||
---- | |||
|- | |||
|valign="top"| | |||
* [[Cloudflare/WARP Connector|Cloudflare » WARP Connector]] | * [[Cloudflare/WARP Connector|Cloudflare » WARP Connector]] | ||
* [https://chorke.cloudflareaccess.com Cloudflare » Access » Chorke] | |||
* [[Cloudflare]] | * [[Cloudflare]] | ||
|valign="top"| | |valign="top"| | ||
|valign="top"| | |valign="top"| | ||
Line 790: | Line 801: | ||
* [https://www.calculator.net/ip-subnet-calculator.html?cclass=any&csubnet=32&cip=10.19.83.1&ctype=ipv4&x=Calculate CIDR » 10.19.83.1/32] | * [https://www.calculator.net/ip-subnet-calculator.html?cclass=any&csubnet=32&cip=10.19.83.1&ctype=ipv4&x=Calculate CIDR » 10.19.83.1/32] | ||
* [https://www.calculator.net/ip-subnet-calculator.html?cclass=any&csubnet=24&cip=10.19.83.1&ctype=ipv4&x=Calculate CIDR » 10.19.83.1/24] | * [https://www.calculator.net/ip-subnet-calculator.html?cclass=any&csubnet=24&cip=10.19.83.1&ctype=ipv4&x=Calculate CIDR » 10.19.83.1/24] | ||
* [[Linux User Creation]] | |||
|} | |} |
Latest revision as of 09:29, 22 December 2024
Argo Tunnel
sudo su
cd /root/.cloudflared/
cloudflared tunnel login
mv cert.pem ./certs/chorke.com.pem
|
sudo su
cd /root/.cloudflared/
cloudflared tunnel login
mv cert.pem ./certs/chorke.org.pem
|
sudo su
cd /root/.cloudflared/
cloudflared tunnel login
mv cert.pem ./certs/shahed.biz.pem
|
| ||
cloudflared --origincert=\
/root/.cloudflared/certs/chorke.com.pem \
tunnel create aa-chorke-com-argo
|
cloudflared --origincert=\
/root/.cloudflared/certs/chorke.org.pem \
tunnel create aa-chorke-org-argo
|
cloudflared --origincert=\
/root/.cloudflared/certs/shahed.biz.pem \
tunnel create aa-shahed-biz-argo
|
| ||
mv certs/ccc2684a-*.json \
./auths/chorke.com.json
|
mv certs/621edb67-*.json \
./auths/chorke.org.json
|
mv certs/249a5a7c-*.json \
./auths/shahed.biz.json
|
| ||
cloudflared --origincert=\
/root/.cloudflared/certs/chorke.com.pem \
tunnel list --output=json|jq -r '.[].name'
|
cloudflared --origincert=\
/root/.cloudflared/certs/chorke.org.pem \
tunnel list --output=json|jq -r '.[].name'
|
cloudflared --origincert=\
/root/.cloudflared/certs/shahed.biz.pem \
tunnel list --output=json|jq -r '.[].name'
|
| ||
cloudflared --origincert=\
/root/.cloudflared/certs/chorke.com.pem \
tunnel route dns aa-chorke-com-argo aa
|
cloudflared --origincert=\
/root/.cloudflared/certs/chorke.org.pem \
tunnel route dns aa-chorke-org-argo aa
|
cloudflared --origincert=\
/root/.cloudflared/certs/shahed.biz.pem \
tunnel route dns aa-shahed-biz-argo aa
|
| ||
CONFIG_BASE=/etc/cloudflared
LOGGER_BASE=/var/log/cloudflared
AUTHNZ_BASE=/root/.cloudflared/auths
cat << EXE | sudo bash
mkdir -p ${CONFIG_BASE}/
mkdir -p ${LOGGER_BASE}/
mkdir -p /root/.cloudflared/{cert,auth}s/
EXE
| ||
| ||
LOGGER_FILE=${LOGGER_BASE}/chorke.com.log
AUTHNZ_FILE=${AUTHNZ_BASE}/chorke.com.json
CONFIG_FILE=${CONFIG_BASE}/chorke.com-config.yml
cat << YML | sudo tee ${CONFIG_FILE} >/dev/null
---
tunnel: aa-chorke-com-argo
credentials-file: ${AUTHNZ_FILE}
ingress:
- service: http://localhost
hostname: aa.chorke.com
path: /*
- service: ssh://localhost:22
hostname: aa.chorke.com
- service: tcp://localhost:3306
hostname: aa.chorke.com
- service: tcp://localhost:5432
hostname: aa.chorke.com
- service: http_status:404
warp-routing:
enabled: true
private_network:
- 10.19.83.0/24
dns:
- 1.1.1.1
- 8.8.8.8
- 10.19.83.100
loglevel: info
logfile: ${LOGGER_FILE}
heartbeat:
interval: 10s
max_retries: 3
restart: true
YML
|
LOGGER_FILE=${LOGGER_BASE}/chorke.org.log
AUTHNZ_FILE=${AUTHNZ_BASE}/chorke.org.json
CONFIG_FILE=${CONFIG_BASE}/chorke.org-config.yml
cat << YML | sudo tee ${CONFIG_FILE} >/dev/null
---
tunnel: aa-chorke-org-argo
credentials-file: ${AUTHNZ_FILE}
ingress:
- service: http://localhost
hostname: aa.chorke.org
path: /*
- service: ssh://localhost:22
hostname: aa.chorke.org
- service: tcp://localhost:3306
hostname: aa.chorke.org
- service: tcp://localhost:5432
hostname: aa.chorke.org
- service: http_status:404
warp-routing:
enabled: true
private_network:
- 10.19.83.0/24
dns:
- 1.1.1.1
- 8.8.8.8
- 10.19.83.100
loglevel: info
logfile: ${LOGGER_FILE}
heartbeat:
interval: 10s
max_retries: 3
restart: true
YML
|
LOGGER_FILE=${LOGGER_BASE}/shahed-biz.log
AUTHNZ_FILE=${AUTHNZ_BASE}/shahed.biz.json
CONFIG_FILE=${CONFIG_BASE}/shahed.biz-config.yml
cat << YML | sudo tee ${CONFIG_FILE} >/dev/null
---
tunnel: aa-shahed-biz-argo
credentials-file: ${AUTHNZ_FILE}
ingress:
- service: http://localhost
hostname: aa.shahed.biz
path: /*
- service: ssh://localhost:22
hostname: aa.shahed.biz
- service: tcp://localhost:3306
hostname: aa.shahed.biz
- service: tcp://localhost:5432
hostname: aa.shahed.biz
- service: http_status:404
warp-routing:
enabled: true
private_network:
- 10.19.83.0/24
dns:
- 1.1.1.1
- 8.8.8.8
- 10.19.83.100
loglevel: info
logfile: ${LOGGER_FILE}
heartbeat:
interval: 10s
max_retries: 3
restart: true
YML
|
| ||
sudo cloudflared tunnel \
--config /etc/cloudflared/chorke.com-config.yml \
run aa-chorke-com-argo
|
sudo cloudflared tunnel \
--config /etc/cloudflared/chorke.org-config.yml \
run aa-chorke-org-argo
|
sudo cloudflared tunnel \
--config /etc/cloudflared/shahed.biz-config.yml \
run aa-shahed-biz-argo
|
| ||
SYSTEM_FILE=[email protected]
SYSTEM_PATH=/etc/systemd/system/${SYSTEM_FILE}
cat << INI | sudo tee ${SYSTEM_PATH} >/dev/null
[Unit]
Description=cloudflared
After=network-online.target
Wants=network-online.target
[Service]
TimeoutStartSec=0
Type=notify
ExecStart=/usr/bin/cloudflared --no-autoupdate \
--config /etc/cloudflared/chorke.com-config.yml \
tunnel run
Restart=on-failure
RestartSec=5s
[Install]
WantedBy=multi-user.target
INI
|
SYSTEM_FILE=[email protected]
SYSTEM_PATH=/etc/systemd/system/${SYSTEM_FILE}
cat << INI | sudo tee ${SYSTEM_PATH} >/dev/null
[Unit]
Description=cloudflared
After=network-online.target
Wants=network-online.target
[Service]
TimeoutStartSec=0
Type=notify
ExecStart=/usr/bin/cloudflared --no-autoupdate \
--config /etc/cloudflared/chorke.org-config.yml \
tunnel run
Restart=on-failure
RestartSec=5s
[Install]
WantedBy=multi-user.target
INI
|
SYSTEM_FILE=[email protected]
SYSTEM_PATH=/etc/systemd/system/${SYSTEM_FILE}
cat << INI | sudo tee ${SYSTEM_PATH} >/dev/null
[Unit]
Description=cloudflared
After=network-online.target
Wants=network-online.target
[Service]
TimeoutStartSec=0
Type=notify
ExecStart=/usr/bin/cloudflared --no-autoupdate \
--config /etc/cloudflared/shahed.biz-config.yml \
tunnel run
Restart=on-failure
RestartSec=5s
[Install]
WantedBy=multi-user.target
INI
|
| ||
cat << EXE | sudo bash
systemctl daemon-reload
systemctl enable [email protected]
systemctl start [email protected]
systemctl status [email protected]
EXE
|
cat << EXE | sudo bash
systemctl daemon-reload
systemctl enable [email protected]
systemctl start [email protected]
systemctl status [email protected]
EXE
|
cat << EXE | sudo bash
systemctl daemon-reload
systemctl enable [email protected]
systemctl start [email protected]
systemctl status [email protected]
EXE
|
| ||
tail -n100 \
-f /var/log/cloudflared/chorke.com.log
journalctl -xeu [email protected]
|
tail -n100 \
-f /var/log/cloudflared/chorke.org.log
journalctl -xeu [email protected]
|
tail -n100 \
-f /var/log/cloudflared/shahed-biz.log
journalctl -xeu [email protected]
|
| ||
cat << EXE | sudo bash
systemctl daemon-reload
systemctl disable [email protected]
systemctl stop [email protected]
systemctl status [email protected]
EXE
|
cat << EXE | sudo bash
systemctl daemon-reload
systemctl disable [email protected]
systemctl stop [email protected]
systemctl status [email protected]
EXE
|
cat << EXE | sudo bash
systemctl daemon-reload
systemctl disable [email protected]
systemctl stop [email protected]
systemctl status [email protected]
EXE
|
WARP Routing
| ||
cloudflared --origincert=\
/root/.cloudflared/certs/chorke.com.pem \
tunnel create ab-chorke-com-argo
|
cloudflared --origincert=\
/root/.cloudflared/certs/chorke.org.pem \
tunnel create ab-chorke-org-argo
|
cloudflared --origincert=\
/root/.cloudflared/certs/shahed.biz.pem \
tunnel create ab-shahed-biz-argo
|
| ||
mv certs/56f034e2-*.json \
./auths/chorke.com.json
|
mv certs/472fe18e-*.json \
./auths/chorke.org.json
|
mv certs/030320f3-*.json \
./auths/shahed.biz.json
|
| ||
cloudflared --origincert=\
/root/.cloudflared/certs/chorke.com.pem \
tunnel list --output=json|jq -r '.[].name'
|
cloudflared --origincert=\
/root/.cloudflared/certs/chorke.org.pem \
tunnel list --output=json|jq -r '.[].name'
|
cloudflared --origincert=\
/root/.cloudflared/certs/shahed.biz.pem \
tunnel list --output=json|jq -r '.[].name'
|
| ||
CONFIG_BASE=/etc/cloudflared
LOGGER_BASE=/var/log/cloudflared
AUTHNZ_BASE=/root/.cloudflared/auths
cat << EXE | sudo bash
mkdir -p ${CONFIG_BASE}/
mkdir -p ${LOGGER_BASE}/
mkdir -p /root/.cloudflared/{cert,auth}s/
EXE
| ||
| ||
LOGGER_FILE=${LOGGER_BASE}/chorke.com.log
AUTHNZ_FILE=${AUTHNZ_BASE}/chorke.com.json
CONFIG_FILE=${CONFIG_BASE}/chorke.com-config.yml
cat << YML | sudo tee ${CONFIG_FILE} >/dev/null
---
tunnel: ab-chorke-com-argo
credentials-file: ${AUTHNZ_FILE}
warp-routing:
enabled: true
loglevel: info
logfile: ${LOGGER_FILE}
heartbeat:
interval: 10s
max_retries: 3
restart: true
YML
|
LOGGER_FILE=${LOGGER_BASE}/chorke.org.log
AUTHNZ_FILE=${AUTHNZ_BASE}/chorke.org.json
CONFIG_FILE=${CONFIG_BASE}/chorke.org-config.yml
cat << YML | sudo tee ${CONFIG_FILE} >/dev/null
---
tunnel: ab-chorke-org-argo
credentials-file: ${AUTHNZ_FILE}
warp-routing:
enabled: true
loglevel: info
logfile: ${LOGGER_FILE}
heartbeat:
interval: 10s
max_retries: 3
restart: true
YML
|
LOGGER_FILE=${LOGGER_BASE}/shahed-biz.log
AUTHNZ_FILE=${AUTHNZ_BASE}/shahed.biz.json
CONFIG_FILE=${CONFIG_BASE}/shahed.biz-config.yml
cat << YML | sudo tee ${CONFIG_FILE} >/dev/null
---
tunnel: ab-shahed-biz-argo
credentials-file: ${AUTHNZ_FILE}
warp-routing:
enabled: true
loglevel: info
logfile: ${LOGGER_FILE}
heartbeat:
interval: 10s
max_retries: 3
restart: true
YML
|
| ||
sudo cloudflared tunnel \
--config /etc/cloudflared/chorke.com-config.yml \
run ab-chorke-com-argo
|
sudo cloudflared tunnel \
--config /etc/cloudflared/chorke.org-config.yml \
run ab-chorke-org-argo
|
sudo cloudflared tunnel \
--config /etc/cloudflared/shahed.biz-config.yml \
run ab-shahed-biz-argo
|
| ||
Playground
cat /usr/local/etc/cloudflared/config.yml
ls -lah ~/.cloudflare-warp
ls -lah ~/cloudflare-warp
|
sudo cloudflared service uninstall
systemctl status cloudflared
journalctl -xeu cloudflared
|
tail -n100 -f /var/log/cloudflared.log
sudo systemctl daemon-reload
ps aux|grep cloudflared
|
| ||
ls -alh /etc/systemd/system|grep cloudflared
ls -alh /etc/systemd/system|grep minikube
ls -alh /etc/systemd/system|grep minio
|
ls -lah /usr/local/etc/cloudflared/
ls -lah /etc/cloudflared/
ls -lah ~/.cloudflared/
|
sudo ln -s /etc/cloudflared/chorke.com-config.yml \
/etc/cloudflared/config.yml
ls -lah /etc/cloudflared/
|
References
| ||
| ||