Skip to content

Instantly share code, notes, and snippets.

@gullz
Last active May 13, 2019 04:15
Show Gist options
  • Save gullz/640c883f3475578b49743144152a0e39 to your computer and use it in GitHub Desktop.
Save gullz/640c883f3475578b49743144152a0e39 to your computer and use it in GitHub Desktop.
Sharing internet in ubuntu
# -------------------------------------------
# Valid only for ubuntu 18.04
# Open /etc/sysctl.conf
#
# Uncomment the line or copy
#
#
# net.ipv4.ip_forward=1
#
# Reload using sudo sysctl -p /etc/sysctl.conf
# -------------------------------------------
iptables -t nat -A POSTROUTING -o ethX -j MASQUERADE
sudo nm-connection-editor
# Create a new ethernet connection with ipv4 shared to other computers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment