一、基础环境
012345678910111213141516 $ curl cip.ccIP : 35.206.235.142数据三 : 中国台湾省彰化县 | 谷歌$ uname -aLinux tw.t4x.org 6.8.0-1017-gcp #19-Ubuntu SMP Tue Oct 15 19:02:59 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux$ curl cip.ccIP : 35.207.210.15数据三 : 印度马哈拉施特拉孟买 | 谷歌$ uname -aLinux mumbai 5.10.0-33-cloud-amd64 #1 SMP Debian 5.10.226-1 (2024-10-03) x86_64 GNU/Linux$ curl cip.ccIP : 35.213.179.122数据三 : 新加坡 | 谷歌$ uname -aLinux singapore 6.1.0-27-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.115-1 (2024-11-01) x86_64 GNU/Linux
特别说明 : Netmaker的服务端有时候是用香港的Server,有时候用台湾的Server,安装方法不一样,一个是采用官方的快速安装,另外一个是采用docker-compose部署,但是基本操作方法是一样的.[自定义网段不同官方默认的100.64.0.0/16、docker-compose自定义网段是100.63.0.0/16] SourceByrd's Weblog-https://note.t4x.org/basic/netmaker-manager-wireguard/
二、防火墙配置
2.0 基础配置
0 1 2 3 4 5 6 7 |
apt install firewalld -y systemctl start firewalld firewall-cmd --new-zone=personal firewall-cmd --permanent --new-zone=personal firewall-cmd --zone=personal --add-interface=netmaker firewall-cmd --permanent --zone=personal --add-interface=netmaker firewall-cmd --zone=personal --add-port=22/tcp firewall-cmd --set-default=personal |
2.1 必须配置
0 1 2 3 4 |
firewall-cmd --zone=personal --add-masquerade firewall-cmd --zone=personal --add-port=51820-51899/udp firewall-cmd --zone=personal --add-rich-rule="rule family="ipv4" source address="10.170.0.0/24" accept" firewall-cmd --zone=personal --add-rich-rule="rule family="ipv4" source address="10.170.0.0/24" masquerade" firewall-cmd --zone=personal --add-interface=ens4 |
2.2 非必须配置
0 1 2 3 4 5 6 |
firewall-cmd --zone=personal --add-port=53/udp firewall-cmd --zone=personal --add-port=53/tcp firewall-cmd --zone=personal --add-port=443/tcp firewall-cmd --zone=personal --add-port=80/tcp firewall-cmd --zone=personal --add-rich-rule="rule family="ipv4" source address="100.63.0.0/16" accept" firewall-cmd --zone=personal --add-rich-rule="rule family="ipv4" source address="100.63.0.0/16" masquerade" firewall-cmd --zone=personal --add-forward |
三、服务端部署tw
3.1 基础环境
012345678910111213 cat >> /etc/sysctl.conf <<BYRD# WireGuard configure startnet.ipv4.ip_forward = 1net.ipv4.conf.all.rp_filter=2net.ipv4.conf.all.proxy_arp = 1# WireGuard configure endBYRDsysctl -pcat /proc/sys/net/ipv4/ip_forwardcat /proc/sys/net/ipv4/conf/all/proxy_arp# sysctl -w net.ipv4.ip_forward=1# sysctl -w net.ipv4.conf.all.rp_filter=2# echo "1" > /proc/sys/net/ipv4/conf/all/proxy_arp# cat /proc/sys/net/ipv4/conf/all/proxy_arp
3.2 Centos
012 sudo dnf -y install dnf-plugins-coresudo dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.reposudo dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
3.3 ubuntu、debian
01234567891011 sudo apt-get update -ysudo apt-get install ca-certificates curl -ysudo install -m 0755 -d /etc/apt/keyringssudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.ascsudo chmod a+r /etc/apt/keyrings/docker.asc# Add the repository to Apt sources:echo \"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \sudo tee /etc/apt/sources.list.d/docker.list > /dev/nullsudo apt-get update
VIP内容VIP登录后查看Login
3.4.4 nginx部署
SourceByrd's Weblog-https://note.t4x.org/basic/netmaker-manager-wireguard/
01234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 $ wget -O - https://openresty.org/package/pubkey.gpg | sudo gpg --dearmor -o /usr/share/keyrings/openresty.gpg$ echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/openresty.gpg] http://openresty.org/package/ubuntu $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/openresty.list > /dev/null$ sudo apt-get update$ sudo apt-get -y install openresty$ egrep -v "^$|#" /usr/local/openresty/nginx/conf/nginx.confworker_processes 1;events {worker_connections 1024;}http {include mime.types;default_type application/octet-stream;sendfile on;keepalive_timeout 65;server {listen 80;server_name localhost;location / {root html;index index.html index.htm;}error_page 500 502 503 504 /50x.html;location = /50x.html {root html;}}server {listen 443 ssl;server_name dashboard.network.t4x.org;ssl_certificate certificate/fullchain.cer;ssl_certificate_key certificate/cert.key;ssl_session_cache shared:SSL:1m;ssl_session_timeout 5m;ssl_ciphers HIGH:!aNULL:!MD5;ssl_prefer_server_ciphers on;location / {proxy_set_header X-Forwarded-Host $host;proxy_set_header X-Forwarded-Server $host;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_pass http://127.0.0.1:8082;proxy_http_version 1.1;proxy_set_header Upgrade $http_upgrade;proxy_set_header Connection "Upgrade";}}server {listen 443 ssl;server_name api.network.t4x.org;ssl_certificate certificate/fullchain.cer;ssl_certificate_key certificate/cert.key;ssl_session_cache shared:SSL:1m;ssl_session_timeout 5m;ssl_ciphers HIGH:!aNULL:!MD5;ssl_prefer_server_ciphers on;location / {proxy_set_header X-Forwarded-Host $host;proxy_set_header X-Forwarded-Server $host;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_pass http://127.0.0.1:8081;proxy_http_version 1.1;proxy_set_header Upgrade $http_upgrade;proxy_set_header Connection "Upgrade";}}server {listen 443 ssl;server_name grpc.network.t4x.org;ssl_certificate certificate/fullchain.cer;ssl_certificate_key certificate/cert.key;ssl_session_cache shared:SSL:1m;ssl_session_timeout 5m;ssl_ciphers HIGH:!aNULL:!MD5;ssl_prefer_server_ciphers on;location / {proxy_set_header X-Forwarded-Host $host;proxy_set_header X-Forwarded-Server $host;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_pass http://127.0.0.1:8083;proxy_http_version 1.1;proxy_set_header Upgrade $http_upgrade;proxy_set_header Connection "Upgrade";}}}
四、节点接入mumbai
SourceByrd's Weblog-https://note.t4x.org/basic/netmaker-manager-wireguard/
01 wget -O netclient https://fileserver.netmaker.io/releases/download/v0.26.0/netclient-linux-amd64 && chmod +x ./netclient && mv netclient /usr/bin/netclient && sudo netclient installnetclient join -t eyJzZXJ2ZXIiOiJhcGkucGVyc29uYWwubmV0d29yay52Zy50NHgub3JnIiwidmFsdWUiOiJDQTNUUU5VWFRBR0JVVUVBRDUzNTNHTkhCUENFNlpLTSJ9
五、连通验证
5.1 windows客户端[河北]
0123456789101112131415161718192021222324252627282930313233343536373839 C:\Windows\System32>netclient join -t eyJzZXJ2ZXIiOiJhcGkucGVyc29uYWwubmV0d29yay52Zy50NHgub3JnIiwidmFsdWUiOiJSRzNZUTVaQVhMRlA0UkdZREk2Uk5QRklON1pSUFJPVCJ9setting host fields{"time":"2024-11-23T14:19:35.8615368+08:00","level":"ERROR","source":"daemon.go 424}","msg":"unable to connect to broker","server":"wss://broker.nm.35-206-235-142.nip.io","error":"connect timeout"}WARNING: Joining any network on another server will disconnect netclient from the networks of the current server -> nm.35-206-235-142.nip.ioregistered with serverC:\Windows\System32>tracert 100.63.0.1通过最多 30 个跃点跟踪到 100.63.0.1 的路由1 51 ms 50 ms 51 ms 100.63.0.1跟踪完成。C:\Windows\System32>ping 100.63.0.1 #台湾服务器正在 Ping 100.63.0.1 具有 32 字节的数据:来自 100.63.0.1 的回复: 字节=32 时间=1143ms TTL=64来自 100.63.0.1 的回复: 字节=32 时间=54ms TTL=64来自 100.63.0.1 的回复: 字节=32 时间=52ms TTL=64来自 100.63.0.1 的回复: 字节=32 时间=51ms TTL=64C:\Windows\System32>ping 100.63.0.3 #新加坡服务器正在 Ping 100.63.0.3 具有 32 字节的数据:来自 100.63.0.3 的回复: 字节=32 时间=203ms TTL=64来自 100.63.0.3 的回复: 字节=32 时间=205ms TTL=64来自 100.63.0.3 的回复: 字节=32 时间=203ms TTL=64来自 100.63.0.3 的回复: 字节=32 时间=203ms TTL=64C:\Windows\System32>wginterface: netmakerpublic key: fzOHq2WPjzYIBw7pX/rv4OE7GqDE07QOOKMvOOF4u00=private key: (hidden)listening port: 51821peer: nS5+/qajqCVlsn0euvnKTBks7zLV5MDmbV9t0b0lJiQ=endpoint: 35.213.179.122:51821allowed ips: 100.63.0.3/32latest handshake: 3 seconds agotransfer: 124 B received, 476 B sentpersistent keepalive: every 20 secondspeer: WIB3JASnLHpxbDXzTAKlNeNbkJ7l0wTqArofcJMQ2hQ=endpoint: 35.206.235.142:51821allowed ips: 100.63.0.1/32latest handshake: 9 seconds agotransfer: 508 B received, 712 B sentpersistent keepalive: every 20 seconds
5.2 ubuntu客户端[新加坡]
012345678910111213141516171819202122 $ netclient join -t eyJzZXJ2ZXIiOiJhcGkucGVyc29uYWwubmV0d29yay52Zy50NHgub3JnIiwidmFsdWUiOiJSRzNZUTVaQVhMRlA0UkdZREk2Uk5QRklON1pSUFJPVCJ9setting host fieldsWARNING: Joining any network on another server will disconnect netclient from the networks of the current server -> nm.35-206-235-142.nip.ioregistered with server$ wginterface: netmakerpublic key: nS5+/qajqCVlsn0euvnKTBks7zLV5MDmbV9t0b0lJiQ=private key: (hidden)listening port: 51821peer: WIB3JASnLHpxbDXzTAKlNeNbkJ7l0wTqArofcJMQ2hQ=endpoint: 10.140.0.3:51821allowed ips: 100.63.0.1/32latest handshake: 29 seconds agotransfer: 956 B received, 1020 B sentpersistent keepalive: every 20 secondspeer: fzOHq2WPjzYIBw7pX/rv4OE7GqDE07QOOKMvOOF4u00=endpoint: x.x.x.x:22628allowed ips: 100.63.0.2/32latest handshake: 35 seconds agotransfer: 212 B received, 272 B sentpersistent keepalive: every 20 seconds
5.3 netmaker服务端[台湾]
SourceByrd's Weblog-https://note.t4x.org/basic/netmaker-manager-wireguard/
0123456789101112131415161718 $ wginterface: netmakerpublic key: WIB3JASnLHpxbDXzTAKlNeNbkJ7l0wTqArofcJMQ2hQ=private key: (hidden)listening port: 51821peer: nS5+/qajqCVlsn0euvnKTBks7zLV5MDmbV9t0b0lJiQ=endpoint: 10.148.0.2:51821allowed ips: 100.63.0.3/32latest handshake: 1 minute, 39 seconds agotransfer: 820 B received, 1.03 KiB sentpersistent keepalive: every 20 secondspeer: fzOHq2WPjzYIBw7pX/rv4OE7GqDE07QOOKMvOOF4u00=endpoint: x.x.x.x:24751allowed ips: 100.63.0.2/32latest handshake: 1 minute, 50 seconds agotransfer: 724 B received, 656 B sentpersistent keepalive: every 20 seconds
六、官方快速安装方案
SourceByrd's Weblog-https://note.t4x.org/basic/netmaker-manager-wireguard/
0123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416 sudo ufw allow 443/tcpsudo ufw allow 80/tcpsudo ufw allow 51821/udpsudo ufw allow 51821/tcpsudo ufw allow 53sudo ufw allow 8085/tcpsudo ufw allow 1883/tcpsudo ufw allow 8883/tcpsudo ufw allow 8083/tcpsudo ufw allow 18083/tcpsudo ufw allow 22/tcpsudo ufw enablewget -qO /root/nm-quick.sh https://raw.githubusercontent.com/gravitl/netmaker/master/scripts/nm-quick.sh && sudo chmod +x /root/nm-quick.sh && sudo /root/nm-quick.sh. . .-----------------------------------------------------1) Auto Generated (nm.35-206-235-142.nip.io)2) Custom Domain (e.x: netmaker.example.com)#? 1using nm.35-206-235-142.nip.io for base domain. . .-----------------------------------------------------The following subdomains will be used:dashboard.nm.35-206-235-142.nip.ioapi.nm.35-206-235-142.nip.iobroker.nm.35-206-235-142.nip.io-----------------------------------------------------. . .Email Address for Domain Registration: admin@qq.com. . .-----------------------------------------------------------------SETUP ARGUMENTS-----------------------------------------------------------------domain: nm.35-206-235-142.nip.ioemail: admin@qq.compublic ip: 35.206.235.142-----------------------------------------------------------------Confirm Settings for Installation- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Does everything look right? [y/n]: y-----------------------------------------------------------------Beginning installation...-----------------------------------------------------------------. . .Pulling config files...Saving the config to /root/netmaker.envStarting containers.... . .Testing Caddy setup (please be patient, this may take 1-2 minutes)Downloading nmctl...using server api.nm.35-206-235-142.nip.iousing master key p6iXAxIMEyUvVHrvtcRv943vk8fayg. . .. . .. . .. . .. . .Creating netmaker network (100.64.0.0/16){"addressrange": "100.64.0.0/16","addressrange6": "","netid": "netmaker","nodeslastmodified": 1732333478,"networklastmodified": 1732333478,"defaultinterface": "nm-netmaker","defaultlistenport": 51821,"nodelimit": 999999999,"defaultpostdown": "","defaultkeepalive": 20,"allowmanualsignup": "no","isipv4": "yes","isipv6": "no","defaultudpholepunch": "no","defaultmtu": 1280,"defaultacl": "yes"}Obtaining enrollment key.... . .. . .. . .[netclient] 2024-11-23 03:44:48 setting OS[netclient] 2024-11-23 03:44:48 setting version[netclient] 2024-11-23 03:44:48 setting netclient hostid[netclient] 2024-11-23 03:44:48 setting name[netclient] 2024-11-23 03:44:48 setting macAddress[netclient] 2024-11-23 03:44:48 setting wireguard keys[netclient] 2024-11-23 03:44:48 setting wireguard interface[netclient] 2024-11-23 03:44:48 setting listenport[netclient] 2024-11-23 03:44:48 setting MTU[netclient] 2024-11-23 03:44:48 setting traffic keysRegister token: eyJzZXJ2ZXIiOiJhcGkubm0uMzUtMjA2LTIzNS0xNDIubmlwLmlvIiwidmFsdWUiOiIzNVRUUDdHV0JJS1JVV0tCSU9aNFlIRkgyQjZYWUNRTCJ9setting host fieldsregistered with server nm.35-206-235-142.nip.iowaiting for netclient to become availableregister complete. New node ID: ae37cf11-d853-4081-868f-e75a8a0348c5making host a defaultHost ID: 7d529a13-7f85-4ef9-b418-67698b42f1e8{"id": "7d529a13-7f85-4ef9-b418-67698b42f1e8","verbosity": 0,"firewallinuse": "","version": "v0.26.0","name": "tw","os": "linux","debug": false,"isstaticport": false,"isstatic": false,"listenport": 51821,"wg_public_listen_port": 0,"mtu": 1420,"interfaces": [{"name": "ens4","addressString": "10.140.0.3/32"},{"name": "ens4","addressString": "fe80::4001:aff:fe8c:3/64"},{"name": "veth91681b9","addressString": "fe80::1e:9fff:fe45:7766/64"},{"name": "veth744f7dd","addressString": "fe80::e818:80ff:fee8:1d25/64"},{"name": "veth38266bd","addressString": "fe80::d421:e1ff:fe99:cef2/64"},{"name": "veth88cdfc5","addressString": "fe80::7085:71ff:fea9:2c4b/64"},{"name": "veth9fcc8b9","addressString": "fe80::e4d4:b2ff:fe90:6c5/64"}],"defaultinterface": "ens4","endpointip": "35.206.235.142","endpointipv6": "","publickey": "PcGvmnP8w66LXjsp26jGVMxolYbxXHL6wGUOmuXGj3A=","macaddress": "42:01:0a:8c:00:03","nodes": ["ae37cf11-d853-4081-868f-e75a8a0348c5"],"isdefault": true,"nat_type": "behind_nat","persistentkeepalive": 20,"autoupdate": false}{"id": "ae37cf11-d853-4081-868f-e75a8a0348c5","hostid": "7d529a13-7f85-4ef9-b418-67698b42f1e8","address": "100.64.0.1/16","address6": "","localaddress": "","allowedips": null,"lastmodified": 1732333519,"expdatetime": 4890599111,"lastcheckin": 1732333512,"lastpeerupdate": -62135596800,"network": "netmaker","networkrange": "100.64.0.0/16","networkrange6": "","isrelayed": false,"isrelay": false,"relayedby": "","relaynodes": null,"isegressgateway": false,"isingressgateway": true,"egressgatewayranges": null,"egressgatewaynatenabled": false,"dnson": true,"ingressdns": "","ingresspersistentkeepalive": 20,"ingressmtu": 1420,"server": "nm.35-206-235-142.nip.io","connected": true,"pendingdelete": false,"metadata": "This host can be used for remote access","defaultacl": "yes","is_fail_over": false,"fail_over_peers": {},"failed_over_by": "00000000-0000-0000-0000-000000000000","isinternetgateway": false,"inet_node_req": {"inet_node_client_ids": null},"internetgw_node_id": "","additional_rag_ips": [],"tags": {"netmaker.remote-access-gws": {}},"is_static": false,"is_user_node": false,"static_node": {"clientid": "","privatekey": "","publickey": "","network": "","dns": "","address": "","address6": "","extraallowedips": null,"allowed_ips": null,"ingressgatewayid": "","ingressgatewayendpoint": "","lastmodified": 0,"enabled": false,"ownerid": "","deniednodeacls": null,"remote_access_client_id": "","postup": "","postdown": "","tags": null}}root@hk:~# cat netmaker.envNM_EMAIL=admin@qq.comNM_DOMAIN=nm.35-215-135-34.nip.ioFRONTEND_URL=UI_IMAGE_TAG=v0.26.0METRICS_EXPORTER=offPROMETHEUS=offSERVER_IMAGE_TAG=v0.26.0SERVER_HOST=35.215.135.34MASTER_KEY=bhU0fiy5aAwXEnTykIlcVhLb5qjLl2MQ_USERNAME=netmakerMQ_PASSWORD=j6ZmMFxmijTb84SKKgokB10YiD9YTLLICENSE_KEY=NETMAKER_TENANT_ID=INSTALL_TYPE=ceNODE_ID=netmaker-server-1DNS_MODE=onNETCLIENT_AUTO_UPDATE=enabledAPI_PORT=8081CORS_ALLOWED_ORIGIN=*DISPLAY_KEYS=onDATABASE=sqliteSERVER_BROKER_ENDPOINT=ws://mq:1883VERBOSITY=1DEBUG_MODE=offREST_BACKEND=onDISABLE_REMOTE_IP_CHECK=offTELEMETRY=onALLOWED_EMAIL_DOMAINS=*AUTH_PROVIDER=CLIENT_ID=CLIENT_SECRET=AZURE_TENANT=OIDC_ISSUER=EXPORTER_API_PORT=8085JWT_VALIDITY_DURATION=43200RAC_AUTO_DISABLE=falseCACHING_ENABLED=trueENDPOINT_DETECTION=trueSMTP_HOST=smtp.gmail.comSMTP_PORT=587EMAIL_SENDER_ADDR=EMAIL_SENDER_USER=EMAIL_SENDER_PASSWORD=root@hk:~# cat wait.sh#!/bin/ashencrypt_password() {echo "${MQ_USERNAME}:${MQ_PASSWORD}" > /mosquitto/password.txtmosquitto_passwd -U /mosquitto/password.txt}main(){encrypt_passwordecho "Starting MQ..."# Run the main container command./docker-entrypoint.sh/usr/sbin/mosquitto -c /mosquitto/config/mosquitto.conf}main "${@}"root@hk:~# cat mosquitto.confper_listener_settings falselistener 8883protocol websocketsallow_anonymous falselistener 1883protocol websocketsallow_anonymous falsepassword_file /mosquitto/password.txtroot@hk:~# cat docker-compose.ymlversion: "3.4"services:netmaker:container_name: netmakerimage: gravitl/netmaker:$SERVER_IMAGE_TAGenv_file: ./netmaker.envrestart: alwaysvolumes:- dnsconfig:/root/config/dnsconfig- sqldata:/root/dataenvironment:# config-dependant vars- STUN_LIST=stun1.netmaker.io:3478,stun2.netmaker.io:3478,stun1.l.google.com:19302,stun2.l.google.com:19302# The domain/host IP indicating the mq broker address- BROKER_ENDPOINT=wss://broker.${NM_DOMAIN} # For EMQX broker use `BROKER_ENDPOINT=wss://broker.${NM_DOMAIN}/mqtt`# For EMQX broker (uncomment the two lines below)#- BROKER_TYPE=emqx#- EMQX_REST_ENDPOINT=http://mq:18083# The base domain of netmaker- SERVER_NAME=${NM_DOMAIN}- SERVER_API_CONN_STRING=api.${NM_DOMAIN}:443# Address of the CoreDNS server. Defaults to SERVER_HOST- COREDNS_ADDR=${SERVER_HOST}# Overrides SERVER_HOST if set. Useful for making HTTP available via different interfaces/networks.- SERVER_HTTP_HOST=api.${NM_DOMAIN}netmaker-ui:container_name: netmaker-uiimage: gravitl/netmaker-ui:$UI_IMAGE_TAGenv_file: ./netmaker.envenvironment:# config-dependant vars# URL where UI will send API requests. Change based on SERVER_HOST, SERVER_HTTP_HOST, and API_PORTBACKEND_URL: "https://api.${NM_DOMAIN}"depends_on:- netmakerlinks:- "netmaker:api"restart: alwayscaddy:image: caddy:2.8.4container_name: caddyenv_file: ./netmaker.envrestart: unless-stoppedextra_hosts:- "host.docker.internal:host-gateway"volumes:- ./Caddyfile:/etc/caddy/Caddyfile- caddy_data:/data- caddy_conf:/configports:- "80:80"- "443:443"coredns:#network_mode: hostcontainer_name: corednsimage: coredns/coredns:1.10.1command: -conf /root/dnsconfig/Corefileenv_file: ./netmaker.envrestart: alwaysdepends_on:- netmakervolumes:- dnsconfig:/root/dnsconfigmq:container_name: mqimage: eclipse-mosquitto:2.0.15-opensslenv_file: ./netmaker.envdepends_on:- netmakerrestart: unless-stoppedcommand: [ "/mosquitto/config/wait.sh" ]volumes:- ./mosquitto.conf:/mosquitto/config/mosquitto.conf- ./wait.sh:/mosquitto/config/wait.sh- mosquitto_logs:/mosquitto/log- mosquitto_data:/mosquitto/datavolumes:caddy_data: { } # runtime data for caddycaddy_conf: { } # configuration file for Caddysqldata: { }dnsconfig: { } # storage for corednsmosquitto_logs: { } # storage for mqtt logsmosquitto_data: { } # storage for mqtt dataroot@tw:~# route -nKernel IP routing tableDestination Gateway Genmask Flags Metric Ref Use Iface0.0.0.0 10.140.0.1 0.0.0.0 UG 100 0 0 ens410.140.0.1 0.0.0.0 255.255.255.255 UH 100 0 0 ens4100.64.0.0 0.0.0.0 255.255.0.0 U 0 0 0 netmaker172.17.0.0 0.0.0.0 255.255.0.0 U 0 0 0 docker0172.18.0.0 0.0.0.0 255.255.0.0 U 0 0 0 br-90d6161ad499root@tw:~# netstat -tunlpActive Internet connections (only servers)Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program nametcp 0 0 0.0.0.0:51821 0.0.0.0:* LISTEN 6113/netclienttcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 5569/docker-proxytcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 5546/docker-proxytcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 861/sshd: /usr/sbintcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 453/systemd-resolvetcp6 0 0 :::51821 :::* LISTEN 6113/netclienttcp6 0 0 :::443 :::* LISTEN 5575/docker-proxytcp6 0 0 :::80 :::* LISTEN 5560/docker-proxytcp6 0 0 :::22 :::* LISTEN 861/sshd: /usr/sbinudp 0 0 127.0.0.53:53 0.0.0.0:* 453/systemd-resolveudp 0 0 10.140.0.3:68 0.0.0.0:* 450/systemd-networkudp 0 0 127.0.0.1:323 0.0.0.0:* 1544/chronydudp 0 0 0.0.0.0:51821 0.0.0.0:* -udp6 0 0 ::1:323 :::* 1544/chronydudp6 0 0 :::51821 :::* -
参考文档:
0:https://docs.netmaker.io/docs/server-installation/advanced-options
1:https://docs.docker.com/engine/install/ubuntu/
2:https://mrdoc.fun/doc/587/
3:https://ewhisper.cn/posts/13793/
4:https://icloudnative.io/posts/configure-a-mesh-network-with-netmaker/
5:https://docs.netmaker.io/docs/upgradesSourceByrd's Weblog-https://note.t4x.org/basic/netmaker-manager-wireguard/
SourceByrd's Weblog-https://note.t4x.org/basic/netmaker-manager-wireguard/