跳到主要内容

temp

Master

[Interface]
PrivateKey = AD0BEBsakjm+bUw6jSpytA9Cwdgi2cSJFa+FSvFoAHg=
Address = 10.200.0.1/24
ListenPort = 51922
PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -A FORWARD -o %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -D FORWARD -o %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE

[Peer]
PublicKey = /h0xwUuwYBXEsA3kWnt1iSp8dY0DQSnvShOHjPQCP1g=
EndPoint = 47.115.231.16:51922
AllowedIPs = 10.200.0.2/32

[Peer]
PublicKey = ZJWXqNE1IxBH0AgR5GMq2r18xEMp4hzNfqyhr7V+mzc=
EndPoint = 43.139.64.55:51922
AllowedIPs = 10.200.0.3/32

[Peer]
PublicKey = rCsTa7tYRNAEXOsbmkwIYtw4iv6GFtSZPZL5FpxLGmA=
EndPoint = 159.75.162.230:51922
AllowedIPs = 10.200.0.4/32

[Peer]
PublicKey = xmAUBV7U8weQ0QgqAvbTbNCUmXgQvQnzz/cqMlkpSAk=
AllowedIPs = 10.200.0.105/32

Node1

[Interface]
PrivateKey = eG6qk/OXd8qYOekriU5yze2p7oW4MWTlI6QBTEEKl24=
Address = 10.200.0.2/32
ListenPort = 51922

[Peer]
PublicKey = i3ydNkIfi8fq59qo/V9p3ubsxGjwaCBhg7XDuhjqMHc=
Endpoint = 106.52.246.251:51922
AllowedIPs = 10.200.0.1/32

[Peer]
PublicKey = ZJWXqNE1IxBH0AgR5GMq2r18xEMp4hzNfqyhr7V+mzc=
Endpoint = 43.139.64.55:51822
AllowedIPs = 10.200.0.3/32

[Peer]
PublicKey = rCsTa7tYRNAEXOsbmkwIYtw4iv6GFtSZPZL5FpxLGmA=
Endpoint = 159.75.162.230:51922
AllowedIPs = 10.200.0.4/32
curl -sfL https://rancher-mirror.rancher.cn/k3s/k3s-install.sh | INSTALL_K3S_MIRROR=cn K3S_URL=https://10.200.0.1:6443 K3S_TOKEN=K103227e448f2eb5a204214b5bdba12a7787151c57e992188625ac1a3881e9ffdcd::server:1ee4969b0e26ac02ef06db31ba2765c6 sh -s - --node-external-ip 47.115.231.16 --node-ip 10.200.0.2 --flannel-iface wg0

Node2

[Interface]
Address = 10.200.0.3/32
PrivateKey = YAWsQlmiAj4DdCa1jBYS2VmxLdbQISj7uxicKzQdRmE=
ListenPort = 51922

[Peer]
PublicKey = i3ydNkIfi8fq59qo/V9p3ubsxGjwaCBhg7XDuhjqMHc=
EndPoint = 106.52.246.251:51922
AllowedIPs = 10.200.0.1/32

[Peer]
PublicKey = /h0xwUuwYBXEsA3kWnt1iSp8dY0DQSnvShOHjPQCP1g=
EndPoint = 47.115.231.16:51922
AllowedIPs = 10.200.0.2/32

[Peer]
PublicKey = rCsTa7tYRNAEXOsbmkwIYtw4iv6GFtSZPZL5FpxLGmA=
EndPoint = 159.75.162.230:51922
AllowedIPs = 10.200.0.4/32
curl -sfL https://rancher-mirror.rancher.cn/k3s/k3s-install.sh | INSTALL_K3S_MIRROR=cn K3S_URL=https://10.200.0.1:6443 K3S_TOKEN=K103227e448f2eb5a204214b5bdba12a7787151c57e992188625ac1a3881e9ffdcd::server:1ee4969b0e26ac02ef06db31ba2765c6 sh -s - --node-external-ip 43.139.64.55 --node-ip 10.200.0.3 --flannel-iface wg0

客户端配置参考:

[Interface]
PrivateKey = EMqHKcbPyT/UwFb3ukNPzFzsQOPkiCUDQyvJ8BqxqW0=
Address = 10.200.0.106/32

[Peer]
PublicKey = i3ydNkIfi8fq59qo/V9p3ubsxGjwaCBhg7XDuhjqMHc=
AllowedIPs = 10.200.0.0/24
Endpoint = 106.52.246.251:51922