Skip to content

Instantly share code, notes, and snippets.

@jaredkrinke
Created December 26, 2024 17:22
Show Gist options
  • Select an option

  • Save jaredkrinke/6f31aaa030e08e6faf827322281125d4 to your computer and use it in GitHub Desktop.

Select an option

Save jaredkrinke/6f31aaa030e08e6faf827322281125d4 to your computer and use it in GitHub Desktop.
Raspberry Pi as gateway, with static IPs (output interface is "wg0" in this example; replace `_` with `/` in filenames)
interface eth0
static ip_address=172.16.0.1/24
#!/bin/sh
nft add table nat
nft 'add chain nat postrouting { type nat hook postrouting priority 100 ; }'
nft add rule nat postrouting ip saddr 172.16.0.0/24 oifname wg0 masquerade
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment