两台梅林:
一台 ip 192.168.0.1 ,作为 wireguard 服务器, 192.168.6.2 连接他;
一台 ip 192.168.2.1 ,作为客户端,连接服务器 192.168.6.2 ;
192.168.6.0/24 设备可以访问 192.168.0.1/24 ,以及 192.168.0.1 的上级任意路由,比如 192.168.10.0/24 ;
192.168.6.0/24 设备可以访问 192.168.2.0/24 ,但是不能访问 192.168.2.1 的上级路由器,比如 192.168.12.0/24
通过查询 iptable 规则,FOREWARD 表一摸一样
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
num pkts bytes target prot opt in out source destination
1 1585K 734M IPSEC_DROP_SUBNET_ICMP all -- * * 0.0.0.0/0 0.0.0.0/0
2 1585K 734M IPSEC_STRONGSWAN all -- * * 0.0.0.0/0 0.0.0.0/0
3 31466 1841K TCPMSS tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcpflags: 0x06/0x02 TCPMSS clamp to PMTU
4 1562K 732M ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
5 22979 1679K WGSF all -- * * 0.0.0.0/0 0.0.0.0/0
6 16498 1297K OVPNSF all -- * * 0.0.0.0/0 0.0.0.0/0
7 0 0 DROP all -- !br0 ppp0 0.0.0.0/0 0.0.0.0/0
8 0 0 DROP all -- !br0 eth4 0.0.0.0/0 0.0.0.0/0
9 4 224 ACCEPT all -- br0 br0 0.0.0.0/0 0.0.0.0/0
10 988 42138 DROP all -- * * 0.0.0.0/0 0.0.0.0/0 state INVALID
11 564 31554 ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 ctstate DNAT
12 14942 1223K WGCF all -- * * 0.0.0.0/0 0.0.0.0/0
13 14942 1223K OVPNCF all -- * * 0.0.0.0/0 0.0.0.0/0
14 14942 1223K VPNCF all -- * * 0.0.0.0/0 0.0.0.0/0
15 14942 1223K ACCEPT all -- br0 * 0.0.0.0/0 0.0.0.0/0
16 0 0 DROP all -- * * 0.0.0.0/0 0.0.0.0/0
仅有作为服务器的 192.168.0.1 ,wireguard 的规则被放到了 WGSF ,WGSI 里
Chain WGSF (1 references)
num pkts bytes target prot opt in out source destination
1 6413 378K ACCEPT all -- * wgs1 0.0.0.0/0 0.0.0.0/0
2 68 4080 ACCEPT all -- wgs1 * 0.0.0.0/0 0.0.0.0/0
Chain WGSI (1 references)
num pkts bytes target prot opt in out source destination
1 0 0 ACCEPT udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpt:59999
2 570 29640 ACCEPT all -- wgs1 * 0.0.0.0/0 0.0.0.0/0
作为客户端的 192.168.2.1 ,wireguard 规则被放到了 WGCF ,WGCI 里
Chain WGCF (1 references)
num pkts bytes target prot opt in out source destination
1 0 0 TCPMSS tcp -- * wgc1 0.0.0.0/0 0.0.0.0/0 tcpflags: 0x06/0x02 TCPMSS clamp to PMTU
2 0 0 ACCEPT all -- * wgc1 0.0.0.0/0 0.0.0.0/0
3 6082 365K ACCEPT all -- wgc1 * 0.0.0.0/0 0.0.0.0/0
4 0 0 TCPMSS tcp -- * wgc2 0.0.0.0/0 0.0.0.0/0 tcpflags: 0x06/0x02 TCPMSS clamp to PMTU
5 0 0 ACCEPT all -- * wgc2 0.0.0.0/0 0.0.0.0/0
6 458 27480 ACCEPT all -- wgc2 * 0.0.0.0/0 0.0.0.0/0
Chain WGCI (1 references)
num pkts bytes target prot opt in out source destination
1 0 0 ACCEPT all -- wgc1 * 0.0.0.0/0 0.0.0.0/0
2 855 44460 ACCEPT all -- wgc2 * 0.0.0.0/0 0.0.0.0/0
个人粗浅的理解,应该没有限制才对?
那么唯一的区别就是做位客户端也收到 VPN Director 限制
但是 VPN Director 规则好像只能指定出口
我已经指定远程 ip 192.168.6.0/24 走 WGC2 ,但是只能是让 192.168.2.0/24 和 192.168.6.0/24 互访。
请教我应该如何设置能让 192.168.6.0/24 设备能够访问 192.168.12.0/24 ?
一台 ip 192.168.0.1 ,作为 wireguard 服务器, 192.168.6.2 连接他;
一台 ip 192.168.2.1 ,作为客户端,连接服务器 192.168.6.2 ;
192.168.6.0/24 设备可以访问 192.168.0.1/24 ,以及 192.168.0.1 的上级任意路由,比如 192.168.10.0/24 ;
192.168.6.0/24 设备可以访问 192.168.2.0/24 ,但是不能访问 192.168.2.1 的上级路由器,比如 192.168.12.0/24
通过查询 iptable 规则,FOREWARD 表一摸一样
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
num pkts bytes target prot opt in out source destination
1 1585K 734M IPSEC_DROP_SUBNET_ICMP all -- * * 0.0.0.0/0 0.0.0.0/0
2 1585K 734M IPSEC_STRONGSWAN all -- * * 0.0.0.0/0 0.0.0.0/0
3 31466 1841K TCPMSS tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcpflags: 0x06/0x02 TCPMSS clamp to PMTU
4 1562K 732M ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
5 22979 1679K WGSF all -- * * 0.0.0.0/0 0.0.0.0/0
6 16498 1297K OVPNSF all -- * * 0.0.0.0/0 0.0.0.0/0
7 0 0 DROP all -- !br0 ppp0 0.0.0.0/0 0.0.0.0/0
8 0 0 DROP all -- !br0 eth4 0.0.0.0/0 0.0.0.0/0
9 4 224 ACCEPT all -- br0 br0 0.0.0.0/0 0.0.0.0/0
10 988 42138 DROP all -- * * 0.0.0.0/0 0.0.0.0/0 state INVALID
11 564 31554 ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 ctstate DNAT
12 14942 1223K WGCF all -- * * 0.0.0.0/0 0.0.0.0/0
13 14942 1223K OVPNCF all -- * * 0.0.0.0/0 0.0.0.0/0
14 14942 1223K VPNCF all -- * * 0.0.0.0/0 0.0.0.0/0
15 14942 1223K ACCEPT all -- br0 * 0.0.0.0/0 0.0.0.0/0
16 0 0 DROP all -- * * 0.0.0.0/0 0.0.0.0/0
仅有作为服务器的 192.168.0.1 ,wireguard 的规则被放到了 WGSF ,WGSI 里
Chain WGSF (1 references)
num pkts bytes target prot opt in out source destination
1 6413 378K ACCEPT all -- * wgs1 0.0.0.0/0 0.0.0.0/0
2 68 4080 ACCEPT all -- wgs1 * 0.0.0.0/0 0.0.0.0/0
Chain WGSI (1 references)
num pkts bytes target prot opt in out source destination
1 0 0 ACCEPT udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpt:59999
2 570 29640 ACCEPT all -- wgs1 * 0.0.0.0/0 0.0.0.0/0
作为客户端的 192.168.2.1 ,wireguard 规则被放到了 WGCF ,WGCI 里
Chain WGCF (1 references)
num pkts bytes target prot opt in out source destination
1 0 0 TCPMSS tcp -- * wgc1 0.0.0.0/0 0.0.0.0/0 tcpflags: 0x06/0x02 TCPMSS clamp to PMTU
2 0 0 ACCEPT all -- * wgc1 0.0.0.0/0 0.0.0.0/0
3 6082 365K ACCEPT all -- wgc1 * 0.0.0.0/0 0.0.0.0/0
4 0 0 TCPMSS tcp -- * wgc2 0.0.0.0/0 0.0.0.0/0 tcpflags: 0x06/0x02 TCPMSS clamp to PMTU
5 0 0 ACCEPT all -- * wgc2 0.0.0.0/0 0.0.0.0/0
6 458 27480 ACCEPT all -- wgc2 * 0.0.0.0/0 0.0.0.0/0
Chain WGCI (1 references)
num pkts bytes target prot opt in out source destination
1 0 0 ACCEPT all -- wgc1 * 0.0.0.0/0 0.0.0.0/0
2 855 44460 ACCEPT all -- wgc2 * 0.0.0.0/0 0.0.0.0/0
个人粗浅的理解,应该没有限制才对?
那么唯一的区别就是做位客户端也收到 VPN Director 限制
但是 VPN Director 规则好像只能指定出口
我已经指定远程 ip 192.168.6.0/24 走 WGC2 ,但是只能是让 192.168.2.0/24 和 192.168.6.0/24 互访。
请教我应该如何设置能让 192.168.6.0/24 设备能够访问 192.168.12.0/24 ?