Skip to content

strong recomend using 0.0.0.0/1 128.0.0.0/1 instead of 0.0.0.0/0 in allowips #48

Closed
@youxiaojie

Description

@youxiaojie

after research, I recommend using 0.0.0.0/1 128.0.0.0/1 instead of 0.0.0.0/0 because 0.0.0.0/0 will replace the original default gateway, result in offline when turn wireguard off.

https://unix.stackexchange.com/questions/110716/how-to-understand-the-routing-table-on-an-openvpn-client

After reading [this](https://unix.stackexchange.com/questions/110716/understand-the-route-table), I found some more information. The below lines makes a lot of sense to me now:

0.0.0.0         10.8.0.5        128.0.0.0       UG    0      0        0 tun0
128.0.0.0       10.8.0.5        128.0.0.0       UG    0      0        0 tun0

So, the 1st line is defining 0.0.0.0/128.0.0.0 and second one is defining 128.0.0.0/128.0.0.0. Essentially:

0.0.0.0/128.0.0.0 = 0.0.0.0/1 = 0.0.0.0 TO 127.255.255.255
128.0.0.0/128.0.0.0 = 128.0.0.0/1 = 128.0.0.0 TO 255.255.255.255

So, above 2 routes are covering the entire IPv4 Address range [0.0.0.0 TO 255.255.255.255]. It is a clever way of OpenVPN to add a default route without replacing the original default route and this default route will be routed via tun0.

Metadata

Metadata

Assignees

Labels

invalidThis doesn't seem right

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions