I deployed it according to the method in the document, and the configuration is as follows
Server:
`#FirstNet
[Interface]
PrivateKey = XXXXXXX
Address = 10.3.2.1/24
ListenPort = 50500 # 注意该端口是UDP端口
DNS = 8.8.8.8
MTU = 1500
#策略
PostUp = iptables -I INPUT -p udp --dport 50500 -j ACCEPT
PostUp = iptables -I FORWARD -i ens3 -o wg0 -j ACCEPT
PostUp = iptables -I FORWARD -i wg0 -j ACCEPT
PostUp = iptables -t nat -A POSTROUTING -o ens3 -j MASQUERADE
PostUp = ip6tables -I FORWARD -i wg0 -j ACCEPT
PostUp = ip6tables -t nat -A POSTROUTING -o ens3 -j MASQUERADE
PostDown = iptables -D INPUT -p udp --dport 50500 -j ACCEPT
PostDown = iptables -D FORWARD -i ens3 -o wg0 -j ACCEPT
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT
PostDown = iptables -t nat -D POSTROUTING -o ens3 -j MASQUERADE
PostDown = ip6tables -D FORWARD -i wg0 -j ACCEPT
PostDown = ip6tables -t nat -D POSTROUTING -o ens3 -j MASQUERADE
#Client Net-1
[Peer]
PublicKey = XXXXXXX
PresharedKey = XXXXXXX
AllowedIPs = 10.3.2.2/32
#Client Net-2
[Peer]
PublicKey = XXXXXXX
PresharedKey = XXXXXXX
AllowedIPs = 10.3.2.3/32`
./wormhole registry -t XXXXXXX
Client Net-1:
`### Client Net-1
[Interface]
PrivateKey = XXXXXXX
Address = 10.3.2.2/32
DNS = 8.8.8.8
MTU = 1500
[Peer]
PublicKey = XXXXXXX
PresharedKey = XXXXXXX
Endpoint = 148.135.40.164:50500
AllowedIPs = 10.3.2.0/24`
./wormhole node -a 10.3.2.1:1638 -t XXXXXXX
Client Net-2:
`### Client Net-2
[Interface]
PrivateKey = XXXXXXX
Address = 10.3.2.3/32
DNS = 8.8.8.8
MTU = 1500
[Peer]
PublicKey = XXXXXXX
PresharedKey = XXXXXXX
Endpoint = 148.135.40.164:50500
AllowedIPs = 10.3.2.0/24`
./wormhole node -a 10.3.2.1:1638 -t XXXXXXX
In this way, the client cannot obtain other nodes except the server node.
2024/02/01 12:30:07 -------device handler-----
2024/02/01 12:30:08 Device name: wg0
2024/02/01 12:30:08 PublicKey: XXXXXXX
2024/02/01 12:30:08 Type: Linux kernel
2024/02/01 12:30:08 PeerCount: 1
2024/02/01 12:30:08 =======peer handler======
2024/02/01 12:30:08 endpoint:148.135.40.164:50500,publicKey:XXXXXXXLastHandshakeTime:2024-02-01 12:29:49.323391482 +0800 CST
I deployed it according to the method in the document, and the configuration is as follows
Server:
`#FirstNet
[Interface]
PrivateKey = XXXXXXX
Address = 10.3.2.1/24
ListenPort = 50500 # 注意该端口是UDP端口
DNS = 8.8.8.8
MTU = 1500
#策略
PostUp = iptables -I INPUT -p udp --dport 50500 -j ACCEPT
PostUp = iptables -I FORWARD -i ens3 -o wg0 -j ACCEPT
PostUp = iptables -I FORWARD -i wg0 -j ACCEPT
PostUp = iptables -t nat -A POSTROUTING -o ens3 -j MASQUERADE
PostUp = ip6tables -I FORWARD -i wg0 -j ACCEPT
PostUp = ip6tables -t nat -A POSTROUTING -o ens3 -j MASQUERADE
PostDown = iptables -D INPUT -p udp --dport 50500 -j ACCEPT
PostDown = iptables -D FORWARD -i ens3 -o wg0 -j ACCEPT
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT
PostDown = iptables -t nat -D POSTROUTING -o ens3 -j MASQUERADE
PostDown = ip6tables -D FORWARD -i wg0 -j ACCEPT
PostDown = ip6tables -t nat -D POSTROUTING -o ens3 -j MASQUERADE
#Client Net-1
[Peer]
PublicKey = XXXXXXX
PresharedKey = XXXXXXX
AllowedIPs = 10.3.2.2/32
#Client Net-2
[Peer]
PublicKey = XXXXXXX
PresharedKey = XXXXXXX
AllowedIPs = 10.3.2.3/32`
./wormhole registry -t XXXXXXX
Client Net-1:
`### Client Net-1
[Interface]
PrivateKey = XXXXXXX
Address = 10.3.2.2/32
DNS = 8.8.8.8
MTU = 1500
[Peer]
PublicKey = XXXXXXX
PresharedKey = XXXXXXX
Endpoint = 148.135.40.164:50500
AllowedIPs = 10.3.2.0/24`
./wormhole node -a 10.3.2.1:1638 -t XXXXXXX
Client Net-2:
`### Client Net-2
[Interface]
PrivateKey = XXXXXXX
Address = 10.3.2.3/32
DNS = 8.8.8.8
MTU = 1500
[Peer]
PublicKey = XXXXXXX
PresharedKey = XXXXXXX
Endpoint = 148.135.40.164:50500
AllowedIPs = 10.3.2.0/24`
./wormhole node -a 10.3.2.1:1638 -t XXXXXXX
In this way, the client cannot obtain other nodes except the server node.
2024/02/01 12:30:07 -------device handler-----
2024/02/01 12:30:08 Device name: wg0
2024/02/01 12:30:08 PublicKey: XXXXXXX
2024/02/01 12:30:08 Type: Linux kernel
2024/02/01 12:30:08 PeerCount: 1
2024/02/01 12:30:08 =======peer handler======
2024/02/01 12:30:08 endpoint:148.135.40.164:50500,publicKey:XXXXXXXLastHandshakeTime:2024-02-01 12:29:49.323391482 +0800 CST