gravitl / netmaker

Netmaker makes networks with WireGuard. Netmaker automates fast, secure, and distributed virtual networks.
https://netmaker.io
Other
9.51k stars 552 forks source link

[Bug]: Route with wrong interface name when promoting node to egress gateway #1287

Closed Exchizz closed 2 years ago

Exchizz commented 2 years ago

Contact Details

github@mneerup.dk

What happened?

When promoting a node to egress gateway, it prompts for subnet and interface name. If I add 10.255.255.0/24 and "eth0" it creates the following route on all nodes in the network:

bash-5.1# ip -br route show
10.255.255.0/24 dev nm-test-network scope link

For the node I promote to egress gateway I would expect it to use the interface name provided in webui, and not the wireguard interface.

I'm running netmaker in docker with docker-compose (quick install)

Version

v0.14.4

What OS are you using?

Linux

Relevant log output

No response

Contributing guidelines

mattkasun commented 2 years ago

was the egress gateway a normal node? (what os/distro) or the netmaker server node?

creating an egress gateway on the node will not add a new route on the egress node. The route must already exist on the node. netmaker will add iptable rules to forward/NAT traffic to/from the wireguard interface to the existing interface

Exchizz commented 2 years ago

A netmaker server node. (your docker images + docker-compose on ubuntu 20.04.4)

I have tried to move the Egress gateway to a different node (linux, ubuntu 20.04.4). On that node it does not add a route, so it's great :)

afeiszli commented 2 years ago

This was a bug in 0.14.4 for egress on the netmaker server, fixed with 0.14.5.