<

Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x

How to setup a local Area Network between two Ubuntu servers

Published on
5,789 Points
2,689 Views
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 192.168.1.1"  and

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

4. While still on server [S2], type "ping 192.168.1.1" 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
         address 192.168.1.2
         netmask 255.255.255.0
         network 192.168.1.0
         broadcast 192.168.1.255

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@192.168.1.1//bckupfolder/file.tar.gz -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].
1
Comment
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 2

Author Comment

by:Eric Mulovhedzi
Nice,

Thanks.
0
 
LVL 62

Expert Comment

by:gheist
In last ten years adapters are madie with auto-MDI/x PHYs, so cros-over cables are not needed.
0

Featured Post

Linux Academy Android App Now Supports Chromecast

We have some fantastic news for our Android fans. We’re so excited to announce that the Linux Academy Android app is now available with Chromecast support. That’s right – simply download the latest update of the Linux Academy App and start casting your favorite course videos!

Join & Write a Comment

If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month