How to setup a local Area Network between two Ubuntu servers

Published on
6,404 Points
1 Endorsement
Last Modified:
Note: for this to work properly you need to use a Cross-Over network cable.

1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provider's network that provides you or your server with internet access.

2. On server [S1], type "ifconfig eth1"  and

3.  On server [S2], type "ifconfig eth1"

4. While still on server [S2], type "ping" to see if you can see server [S1] successfully.

One can also type just "ifconfig" to see all their existing network connections

Thats all.

NB: By default this local area network configurations are not persistent unlike the public IP address once so every-time you restart a server the configuration is going to be lost. In order to by-pass this you do the following:

1. Go and edit file "/etc/network/interfaces"

    i.e. sudo nano /etc/network/interfaces # you can also use "ed" instead "nano" or "vi"

2. Add line "auto eth1" below "auto eth0" settings

3. Add these lines right after your "eth1 auto"

   iface eth1 inet static

Open in new window

4. Restart the network: sudo /etc/init.d/networking restart

5. Then restart the server and see if it works

That's all.

In case you want to copy data to and fro here is the command that you can use:

wget -b ftp://username:password@ -O /bckupfolder/`date +"%Y-%m-%d"`/file.tar.gz;

Open in new window

this transfers a file called "file.tar.gz" from server [S1] into server [S2] into a folder called "backupfolder" so this command has to be run in server [S2].
Enjoy this complimentary article view.

Get unlimited access to our entire library of technical procedures, guides, and tutorials written by certified industry professionals.

Get 7 days free
Click here to view the full article

Using this article for work? Experts Exchange can benefit your whole team.

Learn More
Experts Exchange is a tech solutions provider where users receive personalized tech help from vetted certified professionals. These industry professionals also write and publish relevant articles on our site.
Ask questions about what you read
If you have a question about something within an article, you can receive help directly from the article author. Experts Exchange article authors are available to answer questions and further the discussion.
Learn from the best.