How to configure a LAN connection between two Ubuntu machines?

6,877

Solution 1

If both are directly connected to the router and can access internet, then they already are in LAN. Maybe you want to share files and folders, right?

If so, its easy: right-click any folder you want to share, go to "Sharing Options", check the "Share this folder" box, choose a share name, and youre basically done.

If Samba support is not already installed by default, Ubuntu will offer you to install it on-the-fly. Just accept it. Oh, by the way: "Samba" is what enables Ubuntu (and other Linux distros) to share folders and files in a LAN, using the same protocol used by Windows. Meaning any folders you share will also be accessible by Windows machines in your LAN (if there is any)

Solution 2

I'm a little unsure how far you want the guide to go. But if you simply want Internet connection / local file sharing:

With the computer you are connecting to your router:

Click on your network indicator (top right of your screen...) and select 'Edit Connections'. In the wired tab hit the button 'Add'. Give the connection a helpful name, and under the 'IPv4 Settings' tab choose "Shared to other computers" in the drop down 'Method' box. Save the chances and close the connection editor. Connected this computer to the Internet.

Connected up the second machine. On the first 'internet'ed' machine just make sure (using the network indicator) that the Wired Connection you've just created is chosen.

This GUI method should be able to cope with most more-complex setups too.

Share:
6,877

Related videos on Youtube

newforubuntulinux
Author by

newforubuntulinux

Updated on September 18, 2022

Comments

  • newforubuntulinux
    newforubuntulinux over 1 year

    I have installed Ubuntu on two of my desktops PC's. I have not installed any addon packages or anything related to network as yet. Please guide my on how to set up a LAN between these two machines.

    Is there any GUI program to do this instead of Terminal? I have the ethernet cable connected to a router which in turn is connected to my DSL modem to provide internet access to both my PC's.

    • Admin
      Admin almost 13 years
      Ok, first things first: is internet working for both? Can both browse webpages, etc? Is your only issue on how to share folders and/or printers with each other?
    • Admin
      Admin almost 13 years
      What exactly do you want to use the LAN for? What you described already places the computers in a LAN.
    • Admin
      Admin almost 13 years
      Your router may also be set up to not let the machines talk to each other. Usually that's only with wireless, but make sure the machines are able to ping each other. You can do that from the System -> Administration -> Network Tools menu.
  • MestreLion
    MestreLion almost 13 years
    As I have understood, both computers are directly connected to the router. So no need to share the wired connection, as they are probaly already "internet'ed" by the router. I think this is only a matter of SaMBa-sharing folders.
  • thomasmichaelwallace
    thomasmichaelwallace almost 13 years
    indeed - i think a little bit of confirmation is needed @newforubuntulinux please...
  • newforubuntulinux
    newforubuntulinux almost 13 years
    Yes both Computers are able to browse internet web pages. I want to share folders between the 2 machines. Thanks everyone for the effort to answer my question.
  • MestreLion
    MestreLion almost 13 years
    @newforubuntulinux: if any of the answers solved your issue, please choose one as the accepted answer. If not, feel free to edit your question and add more information on why they didnt work, and we well be pleased to help you further.
  • newforubuntulinux
    newforubuntulinux almost 13 years
    Thank you for the help. Does both the computers need to have samba installed? like comp1 shares file to comp2, i do your suggestion in comp1, do i have to perform the same on comp2 just to access comp1's files? Note: comp2 need not share files to comp1.
  • MestreLion
    MestreLion almost 13 years
    @newforubuntulinux: Youre welcome. If comp2 will only access comp1's shared files, then no, no further setup is necessary. In File Manager (Nautilus is the proper name) just click Network in the left panel and browse till comp1's files.