Allow using different source IP on WireGuard Interface #616

Open
opened 2025-11-20 05:14:45 -05:00 by saavagebueno · 0 comments
Owner

Originally created by @wizpresso-steve-cy-fan on GitHub (Feb 8, 2024).

Is your feature request related to a problem? Please describe.
I want to forward my LAN IP address without having to use NAT masquerade, because k8s will nag about wrong origin source IP.

Describe the solution you'd like
Let's assume my LAN CIDR is 10.96.0.0/16, I want to interconnect to AWS at 172.31.0.0/16, I have a netbird box at the address 10.96.252.1 for LAN, and another netbird box at 172.31.0.55 for AWS, so I tried to change the following on the LAN netbird box:

ip route change 172.31.0.0/16 dev wt0 scope link src 10.96.252.1

And also this for AWS netbird box:

ip route change 10.96.0.0/16 dev wt0 scope link src 172.31.0.55

I have both side routing open while I also have turned off masquerading.

But the problem is, after I changed the source address, I got a "permission denied" error with mtr, and strace result shows it is "-1 (operations not permitted)". I cannot think of why it is not working, because vanilla Wireguard actually works, so it seems like some netbird policy forced the source address to not be something else.

Describe alternatives you've considered
Keep using masquerade at the cost of not having the source IP.

Additional context
This is needed for our AWS RDS access.

Originally created by @wizpresso-steve-cy-fan on GitHub (Feb 8, 2024). **Is your feature request related to a problem? Please describe.** I want to forward my LAN IP address without having to use NAT masquerade, because k8s will nag about wrong origin source IP. **Describe the solution you'd like** Let's assume my LAN CIDR is 10.96.0.0/16, I want to interconnect to AWS at 172.31.0.0/16, I have a netbird box at the address 10.96.252.1 for LAN, and another netbird box at 172.31.0.55 for AWS, so I tried to change the following on the LAN netbird box: ``` ip route change 172.31.0.0/16 dev wt0 scope link src 10.96.252.1 ``` And also this for AWS netbird box: ``` ip route change 10.96.0.0/16 dev wt0 scope link src 172.31.0.55 ``` I have both side routing open while I also have turned off masquerading. But the problem is, after I changed the source address, I got a "permission denied" error with mtr, and strace result shows it is "-1 (operations not permitted)". I cannot think of why it is not working, because vanilla Wireguard actually works, so it seems like some netbird policy forced the source address to not be something else. **Describe alternatives you've considered** Keep using masquerade at the cost of not having the source IP. **Additional context** This is needed for our AWS RDS access.
saavagebueno added the feature-requestnetworking labels 2025-11-20 05:14:45 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/netbird#616