VPS---net.ipv4.ip_forward = 1 ---wg0.conf [Interface] PrivateKey = VPS PrivateKey Address = 30.100.100.1/24 ListenPort = 54321
[Peer] PublicKey = Client A PublicKey AllowedIPs = 30.100.100.2/32
[Peer] PublicKey = Client B PublicKey AllowedIPs = 30.100.100.3/32,20.20.20.0/24
Client A---wg0.conf [Interface] PrivateKey = Client A PrivateKey Address = 30.100.100.2/24
[Peer] PublicKey = VPS PublicKey AllowedIPs = 30.100.100.0/32 Endpoint = 1.2.3.4:54321 PersistentKeepalive = 25
Client B---net.ipv4.ip_forward = 1 ---wg0.conf [Interface] PrivateKey = Client B PrivateKey Address = 30.100.100.3/24
[Peer] PublicKey = VPS PublicKey AllowedIPs = 30.100.100.0/32 Endpoint = 1.2.3.4:54321 PersistentKeepalive = 25
如图所示:系统基本为 Debian/ubuntu ,在 ClientC 没有公网 IP 和不用安装 WireGuard 的情况下(在 RouterB 下还有其他设备:如 ClientD[提供 FTP 服务]),ClientA 如何透过 ClientB 访问 ClientC(D.E.F...) 所提供的服务,请各位帮帮忙把详细的设置和命令告诉一下,谢谢。
1
smallparking 2022-09-16 14:21:39 +08:00 via Android
tailscale
|
2
olaloong 2022-09-16 14:36:12 +08:00
Client A 的 AllowedIPs 里加上 20.20.20.0/24 ,或者手动加路由表 试试
还不行的话检查 Client B 的 iptables ,FORWARD 什么的得放行 |
3
olaloong 2022-09-16 14:38:22 +08:00
我是把 4 张局域网连接起来的,在各自局域网的路由上做了 WireGuard ,网下所有设备可以用各自局域网 ip 互访
不过时间长了,配置有点忘了 |
4
aver4vex 2022-09-16 15:12:16 +08:00
我是在 clientb 上用 firewalld 做流量重定向,
firewall-cmd --zone=public --add-masquerade firewall-cmd --zone=public --add-forward-port=port=13389:proto=tcp:toport=3389:toaddr=192.168.0.4 |
5
lsww 2022-09-16 16:53:05 +08:00
tailscale 是神器,直接把家里 NAS 用 RADIDRIVE 挂到了本地。
|