Tuesday, October 18, 2016

Connecting two Linux computers with a network cable


    First we need to connect the two machines with a network cable.

    Then we need to change the ip address of the Linux machines in order to take the both    machines to a same network.

    Now let’s change the ip address of machine A.

      First we will assign the new ip address.

      For that we need to find the Ethernet to which the machine is connected. Type in the        terminal,
-       sudo ifconfig

               


        Then we can find the Ethernet. Normally it is mentioned as eth0/ eth1/eth2 likewise. Here it is eth0. We have used ‘sudo’ to get super admin permission.
  
After finding the Ethernet will assign the ip address. 

-        sudo ifconfig eth0 192.168.10.1 up
                                            And we are giving the ip address 192.168.10.1 to machine A. At last we use ‘up’ to activate the ip address.

After assigning the ip address we should check whether it has changed or not.

-       sudo ifconfig
     

Do the same process for the machine B with relevant Ethernet and ip address.We can check whether they have connected by making a ping.
                      In machine A terminal,
                   -       Ping 192.168.10.2
  
    
                  If it gets reply from the machine B, the machines are connected properly. Here the ttl value is 64 as it is a reply from a Linux machine.



-Thank You-