Skip to content

Instantly share code, notes, and snippets.

@fionn
Last active April 17, 2018 01:35
Show Gist options
  • Save fionn/45c0f4f7223fb8fb87923b2d5c5babbe to your computer and use it in GitHub Desktop.
Save fionn/45c0f4f7223fb8fb87923b2d5c5babbe to your computer and use it in GitHub Desktop.
Set kernel parameters to forward traffic
#!/bin/bash
if [[ $(id -u) -ne 0 ]]; then
echo "You must be root"
exit 1
fi
sysctl -w net.ipv4.ip_forward=1
sysctl -w net.ipv6.conf.all.forwarding=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment