Sharing Connection to other PCs (Via Wired Ethernet) [duplicate]
Solution 1:
Sharing internet connection via ethernet is one step more than doing it wirelessly. Here are the steps:
PC Sharing Connection
PC that will share connection
-
Open your Network Manager via the Network Icon on the Unity Panel:
-
Go all the way down to the Edit Connections option and click on it.
-
You will appear on the Wired Tab. Each Wired connection is by default related to each Ethernet Wired NIC card you have. For example if you have 2 Wired NICs you will see 2 options here. In the image below you see one since this is a Laptop and they normally have one. Select the Wired connection you wish to edit and double click on it or select the EDIT button.
-
You will appear on the Wired Tab (Again). This time, go to the IPv4 Settings if you are using IPv4 or IPv6 if you are using that one. On the Method option select Share to Other Computers. Now SAVE. You are done.
This will do all the stuff that was normally done 6 or 7 years ago with all the terminal commands and iptable stuff.
Now just connect the 2 computers and you are done.
NOTE: If both computers have a Wired Gigabit Ethernet NIC then you can actually connect them directly since most 1000BASE-T have automatic MDI/MDI-X. If not just connect them to your switch, router, hub, whatever and that is all.
Client PC
PC That will receive Shared Internet Connection (Depends on Network Setup)
-
Open your Network Manager via the Network Icon on the Unity Panel:
-
Go all the way down to the Edit Connections option and click on it.
-
You will appear on the Wired Tab. Each Wired connection is by default related to each Ethernet Wired NIC card you have. For example if you have 2 Wired NICs you will see 2 options here. In the image below you see one since this is a Laptop and they normally have one. Select the Wired connection you wish to edit and double click on it or select the EDIT button.
-
You will appear on the Wired Tab (Again). This time, go to the IPv4 Settings if you are using IPv4 or IPv6 if you are using that one. On the Method option select Manual. The options in Addresses will be editable now. Add the IP you want, the Mask you need and the IP of the PC that is sharing the connection. In this case I said that the IP of the Client PC will be 192.168.0.2, the Mask is 255.255.255.0 to imply that is a Class C (LAN) network and 192.168.0.1 to mention that the computer sharing the connection has the IP 192.168.0.1 with it. Additionally add the same IP of the computer sharing the connection to the DNS Servers (As shown in the image).
You can also (Depending on the network setup) select instead of Manual, select Automatic and just put the IP of the computer sharing the Internet in the DNS Servers section.
Note that this depends on the network setup. For example if you have both PCs connected to a switch or router, the switch/router will take care of the Client, so you only need to setup the PC Sharing Internet and just connect both to the switch/router. If by chance you are connecting the PCs directly together then it is better to do the additional setup of the Client.
In most cases, you will not need to setup the client, just connect to the network and done. Ubuntu will take care of everything. I just added the Client part for specific cases where problems might arise.
This should cover all the possible scenarios in a home LAN when one wants to share the internet connection over Wired cable.
Solution 2:
Yes, it's actually quite easy.
- Open the Network Menu on your panel and select "Edit connections"
- Select the wired connection and click Properties.
- In this dialog, open the IPv4 tab.
- In the "Method" combo, select "Shared with other computers".
Now, whatever is connected to the wired network port will get access to whatever internet connection you use.