Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add subnet to config #2

Closed
syphyr opened this issue Apr 14, 2020 · 6 comments
Closed

Add subnet to config #2

syphyr opened this issue Apr 14, 2020 · 6 comments

Comments

@syphyr
Copy link

syphyr commented Apr 14, 2020

If the subnet is not added to the Address, then the new route does now show up when typing "route", on Linux.

syphyr@37ea9a4

@ViRb3
Copy link
Owner

ViRb3 commented Apr 14, 2020

🎉 This issue has been resolved in version 1.0.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@ViRb3 ViRb3 added the released label Apr 14, 2020
@syphyr
Copy link
Author

syphyr commented Apr 20, 2020

There is still an issue with the IPv4 subnet mask. When I use "172.16.0.2/32" for IPv4, it is still not getting added to the routing table. Perhaps it is better to use "172.16.0.2/12" for the subnet mask since it should cover the entire private ip range used.

"route with 172.16.0.2/12"
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default _gateway 0.0.0.0 UG 600 0 0 wlo1
link-local 0.0.0.0 255.255.0.0 U 1000 0 0 wlo1
172.16.0.0 0.0.0.0 255.240.0.0 U 0 0 0 vpn1
192.168.1.0 0.0.0.0 255.255.255.0 U 600 0 0 wlo1

If "172.16.0.2/32" is used, then "172.16.0.0" is not added to the routing table.

syphyr@454d147

@ViRb3 ViRb3 reopened this Apr 21, 2020
@ViRb3 ViRb3 removed the released label Apr 21, 2020
@ViRb3
Copy link
Owner

ViRb3 commented Apr 21, 2020

From the unofficial WireGuard docs:

Address

Defines what address range the local node should route traffic for. Depending on whether the node is a simple client joining the VPN subnet, or a bounce server that's relaying traffic between multiple clients, this can be set to a single IP of the node itself (specified with CIDR notation), e.g. 192.0.2.3/32), or a range of IPv4/IPv6 subnets that the node can route traffic for.

Examples

  • Node is a client that only routes traffic for itself
    Address = 192.0.2.3/32

  • Node is a public bounce server that can relay traffic to other peers
    When the node is acting as the public bounce server, it should set this to be the entire subnet that it can route traffic, not just a single IP for itself.
    Address = 192.0.2.1/24

What is your use case exactly? What are you trying to route?

@syphyr
Copy link
Author

syphyr commented Apr 21, 2020

I don't have any special use case. I just noticed that "172.16.0.2/32" does not show up in the routing table, but "172.16.0.2/12" and "172.16.0.2/24" do. So, it seems like the routing table does not accept "/32" as a subnet mask. Either way, "172.16.0.2/32" still seems to work functionally. The address with "/32" just does not show up in routing table when I type "route".

@syphyr
Copy link
Author

syphyr commented Apr 21, 2020

I guess it is irrelevant that the address shows up in the routing table. The most common use case would be a client that only routes traffic for itself, so "172.16.0.2/32" seems to be correct in most cases. I think you have it correct, the more that I think about it.

@ViRb3
Copy link
Owner

ViRb3 commented Apr 24, 2020

I also believe that the client doesn't need to route anything but itself when operating in client mode, so no changes are necessary. Thanks for the input though!

@ViRb3 ViRb3 closed this as completed Apr 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants