Skip to content

Instantly share code, notes, and snippets.

@brannondorsey
Last active May 11, 2023 08:35
Show Gist options
  • Save brannondorsey/1fc8e1d03ad9889279ebb370ec91e973 to your computer and use it in GitHub Desktop.
Save brannondorsey/1fc8e1d03ad9889279ebb370ec91e973 to your computer and use it in GitHub Desktop.
Ubuntu internet sharing and LAN over Ethernet between two+ machines

Its easy to setup a LAN between two Ubuntu machines connected over ethernet. If one of those machines, which we will call the server, is also connected to the internet via another device (like a wireless card) it will automagically share its internet connection as well. Begin by connecting the client and server machines via ethernet.

On the server machine, click the network icon on the top right and select "Edit Connections > Wired connection 1 > Edit > IPv4 Settings" and change "Method" to "Shared to other computers". Then open the network icon menu again and click "Wired connection 1" to ensure that the connection has been established. Running ifconfig in the terminal should show that the wired interface has an ip address.

On the client machine, click the network icon on the top right and select "Wired connection 1". All done. Run ifconfig on this machine as well to see the ip address you've been assigned.

@NotC0puting
Copy link

thank you so much!!!

@saqibshafin
Copy link

Thank you so so much, mister!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment