A端(流量节点):
[Interface]
PrivateKey = uDpppS+O0XUGUZWM4rhiGAx6yiEriT7MBc5ImmL0Wn0=
ListenPort = 4784 (A端监听端口)
PostUp = ip addr add 192.168.11.2/24(B端ipip0的ip) dev wg0;iptables -t nat -A POSTROUTING -o wg0 -j MASQUERADE
PostDown = iptables -t nat -D POSTROUTING -o wg0 -j MASQUERADE
MTU = 1400
[Peer]
PublicKey = xyzSAqC7a5sQZu/I2qFyLyV9jt2JW/2IyOU+uG9EVSE=
Endpoint = 212.95.137.174:2342 (B端的公网IP和监听端口)
AllowedIPs = 0.0.0.0/0 **允许所有
PersistentKeepalive = 25
B端(跨境节点):
[Interface]
PrivateKey = kK5Mdf857Ra6Tjq4Cg4u+miHTgiUXZFGP/qHfE7uCUI=
ListenPort = 2342 (B端监听端口)
PostUp = ip addr add 192.168.11.3/24(A端的ipip0的ip) dev wg0;iptables -t nat -A POSTROUTING -o eth0(B端的出口网卡) -j MASQUERADE
PostDown = iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
MTU = 1400
[Peer]
PublicKey = lOhrqPx52WrdFGpajwO42c/8zrD7udPVbf7BypBNOlw=
Endpoint = 221.130.184.91:4784 (A端的公网IP和监听端口)
AllowedIPs = 192.168.11.0/24 **只允许A-B之间的ipip隧道的地址
PersistentKeepalive = 25
Categories:
系统运维