Created
May 3, 2018 12:02
-
-
Save zukka77/d355d5b004f776e49c17db741a309218 to your computer and use it in GitHub Desktop.
This file contains 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
ip netns add zukns | |
ip link add veth0 type veth peer name veth1 | |
ip link set veth1 netns zukns | |
ip a add 169.254.69.68/31 dev veth0 | |
ip link set veth0 up | |
ip netns exec zukns ip a add 169.254.69.69/31 dev veth1 | |
ip netns exec zukns ip link set veth1 up | |
ip netns exec zukns ip r add default via 169.254.69.68 | |
echo 1 > /proc/sys/net/ipv4/ip_forward | |
iptables -t nat -I POSTROUTING -s 169.254.69.69 -j MASQUERADE | |
iptables -I FORWARD -s 169.254.69.69 -j ACCEPT | |
iptables -I FORWARD -m state --state related,established -j ACCEPT | |
ip netns exec zukns /bin/bash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment