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

Support IPMasquerade #121

Open
waipeng opened this issue Nov 11, 2024 · 0 comments
Open

Support IPMasquerade #121

waipeng opened this issue Nov 11, 2024 · 0 comments

Comments

@waipeng
Copy link

waipeng commented Nov 11, 2024

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: all
  • Ruby: all
  • Distribution: all
  • Module version: v4.1.0

How to reproduce (e.g Puppet code you use)

Use the following example

include wireguard

wireguard::interface { 'wg1':
  dport     => 51820,
  addresses => [{'Address' => '192.0.2.1/24'}],
  peers     => [
    {
       public_key  => 'foo==',
       preshared_key => '/22q9I+RpWRsU+zshW8skv1p00TvnEE6fTvPJuI2Cp4=',
       allowed_ips => ['192.0.2.2'],
    },
  ],
}

What are you seeing

The code creates the following /etc/systemd/network/wg1.network

[Match]
Name=wg1

[Network]
DHCP=no
IPv6AcceptRA=false
IPForward=yes

# for networkd >= 244 KeepConfiguration stops networkd from
# removing routes on this interface when restarting
KeepConfiguration=yes

[Address]
Address=192.0.2.1/24

Since systemd-networkd can do IP masquerade, we can get that all built in if we have the follow

[Network]
DHCP=no
IPv6AcceptRA=false
IPMasquerade=ipv4
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

1 participant