wiresock / WireSockUI

GUI to use Wiresock VPN Client in application mode
https://www.wiresock.net/
302 stars 14 forks source link

IPs configuration question #74

Closed luweijun1992 closed 3 months ago

luweijun1992 commented 3 months ago

I hope to use wg for Internet access and a single /24 network segment, and the rest is local (i.e. private network segment) AllowedIPs = 0.0.0.0/0, 172.31.255.0/24

[Interface]
PrivateKey = xxx
Address = 172.31.255.21/28
DNS = 172.31.255.1

[Peer]
PublicKey = xxx
AllowedIPs = 0.0.0.0/0, 172.31.255.0/24
Endpoint = x.x.x.x:5060
PersistentKeepalive = 25
DisallowedIPs = 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16

Otherwise, DisallowedIPs needs to be written separately.

[Interface]
PrivateKey = xxx
Address = 172.31.0.181/28
DNS = 172.31.0.220

[Peer]
PublicKey = xxx
AllowedIPs = 0.0.0.0/0
Endpoint = x.x.x.x:5060
PersistentKeepalive = 25
DisallowedIPs = 10.0.0.0/8, 172.16.0.0/13, 172.24.0.0/14, 172.28.0.0/15, 172.30.0.0/16, 192.168.0.0/16
wiresock commented 3 months ago

The route 0.0.0.0/0 already includes all IPv4 addresses, so adding 172.31.255.0/24 to AllowedIPs is redundant. To achieve your desired configuration, remove 172.31.255.0/24 from AllowedIPs and use DisallowedIPs to exclude local networks. This approach will ensure your routing rules are applied correctly without unnecessary overlaps.