DEV Community

Cover image for How to Share Internet Connection on Linux (Server to Client via Ethernet)
B Mithilesh
B Mithilesh

Posted on

1

How to Share Internet Connection on Linux (Server to Client via Ethernet)

Sharing an Internet connection on Linux between two computers using an Ethernet cable might seem tricky at first, but it’s straightforward once you know the steps. Whether you’re troubleshooting, setting up a local network, or just exploring Linux networking, this guide has you covered.


📡 Steps to Configure Internet Sharing on the Server

1. Open Network Connections

  • Click on the network icon in the system tray or panel.
  • Select "Edit Connections..." from the dropdown menu.

2. Edit the Wired Connection

  • In the Network Connections dialog, locate and double-click your Wired Connection.
  • This is the connection that will be used to share Internet access. 👉 Leave the wireless connection untouched if it’s the one connected to the Internet.

3. Modify IPv4 Settings

  • Navigate to the "IPv4 Settings" tab.
  • Set the Method to "Shared to other computers".
  • Save and close the settings.

4. Reconnect the Wired Network

  • Disconnect and reconnect the Wired Network so it gets a new IP address.
  • Make sure the server and client are physically connected via an Ethernet cable.

5. Retrieve Connection Information

  • Click on "Connection Information" in the network menu.
  • Note down the IP address and network mask assigned to the wired connection. (Example: 10.42.0.1/255.255.255.0).

🖧 Steps to Configure the Client Computer

1. Open Network Connections

  • On the client computer, click the network icon and select "Edit Connections...".

2. Edit the Wired Connection

  • Locate and double-click your Wired Connection.

3. Modify IPv4 Settings

  • Navigate to the "IPv4 Settings" tab.
  • Set the Method to "Manual".
  • Assign an IP address on the same subnetwork as the server. 👉 Example: 10.42.0.69
  • Use the IP and network mask from the server for:
    • Netmask: 255.255.255.0
    • Gateway: 10.42.0.1
    • DNS Servers: 10.42.0.1

4. Reconnect the Wired Network

  • Disconnect and reconnect the Wired Network to apply the new settings.

🚀 Final Step

Pat yourself on the back and surf away! 🎉


📢 Additional Notes

  • Make sure the Ethernet cable is connected before reconnecting the networks on both computers.
  • If Internet sharing doesn’t work as expected, verify the server’s firewall settings to ensure proper traffic routing.

Let me know if you have any questions or if this guide worked for you in the comments! 👇

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (1)

Collapse
 
nedtechie profile image
Nedim Hadzimahmutovic

Screenshots please :)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay