Last active
August 24, 2019 11:35
-
-
Save midnight-wonderer/e81552be41a5a23d9d60f982abc8d7b5 to your computer and use it in GitHub Desktop.
Creating Linux NAT router
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SHELL:=/usr/bin/env bash | |
DEFAULT_INTERFACE=$(shell /sbin/route | grep default | grep -Eo "[a-z0-9]+$$") | |
VPC_CIDR=10.0.0.0/16 | |
forward-traffic: | |
/sbin/iptables -t nat -A POSTROUTING -o $(DEFAULT_INTERFACE) -s $(VPC_CIDR) -j MASQUERADE |
Author
midnight-wonderer
commented
Aug 24, 2019
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment