This discussion is archived
5 Replies Latest reply: Mar 29, 2013 11:55 AM by Dude! RSS

Connecting Two Linux Machines

K. Varun Newbie
Currently Being Moderated
Hello Form mates

I have to Linux machines one is OEL5 on a desktop and other OEL4 in laptop, i want to connect two of them by using a cross cable.

oel5(desktop) ip 192.168.1.69
oel4(laptop) ip 192.168.1.66

when i try to connect from desktop or laptop i get this

*[root@srvr69 ~]# ssh 192.168.1.66*
ssh: connect to host 192.168.1.66 port 22: No route to host

i am new to Linux step by step solution please

thank you
  • 1. Re: Connecting Two Linux Machines
    alvaromiranda Explorer
    Currently Being Moderated
    Hello

    1. From each machine, check you can ping the host ip

    provide the output of ifconfig command to check the configuration
  • 2. Re: Connecting Two Linux Machines
    K. Varun Newbie
    Currently Being Moderated
    DESKTOP 192.168.1.69

    [root@srvr69 ~]# ping 192.168.1.69
    PING 192.168.1.69 (192.168.1.69) 56(84) bytes of data.
    64 bytes from 192.168.1.69: icmp_seq=1 ttl=64 time=0.061 ms
    64 bytes from 192.168.1.69: icmp_seq=2 ttl=64 time=0.049 ms
    64 bytes from 192.168.1.69: icmp_seq=3 ttl=64 time=0.047 ms
    64 bytes from 192.168.1.69: icmp_seq=4 ttl=64 time=0.047 ms
    64 bytes from 192.168.1.69: icmp_seq=5 ttl=64 time=0.044 ms
    64 bytes from 192.168.1.69: icmp_seq=6 ttl=64 time=0.041 ms
    64 bytes from 192.168.1.69: icmp_seq=7 ttl=64 time=0.046 ms
    64 bytes from 192.168.1.69: icmp_seq=8 ttl=64 time=0.043 ms
    64 bytes from 192.168.1.69: icmp_seq=9 ttl=64 time=0.044 ms
    64 bytes from 192.168.1.69: icmp_seq=10 ttl=64 time=0.046 ms
    64 bytes from 192.168.1.69: icmp_seq=11 ttl=64 time=0.048 ms


    [root@srvr69 ~]# ping 192.168.1.66
    PING 192.168.1.66 (192.168.1.66) 56(84) bytes of data.
    From 192.168.1.69 icmp_seq=2 Destination Host Unreachable
    From 192.168.1.69 icmp_seq=3 Destination Host Unreachable
    From 192.168.1.69 icmp_seq=4 Destination Host Unreachable
    From 192.168.1.69 icmp_seq=6 Destination Host Unreachable
    From 192.168.1.69 icmp_seq=7 Destination Host Unreachable
    From 192.168.1.69 icmp_seq=8 Destination Host Unreachable

    [root@srvr69 ~]# ifconfig
    eth0 Link encap:Ethernet HWaddr 00:19:D1:78:35:E5
    inet addr:192.168.1.69 Bcast:192.168.1.255 Mask:255.255.255.0
    inet6 addr: fe80::219:d1ff:fe78:35e5/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:29 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:0 (0.0 b) TX bytes:7882 (7.6 KiB)

    lo Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    inet6 addr: ::1/128 Scope:Host
    UP LOOPBACK RUNNING MTU:16436 Metric:1
    RX packets:4953 errors:0 dropped:0 overruns:0 frame:0
    TX packets:4953 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:3055915 (2.9 MiB) TX bytes:3055915 (2.9 MiB)

    peth0 Link encap:Ethernet HWaddr FE:FF:FF:FF:FF:FF
    inet6 addr: fe80::fcff:ffff:feff:ffff/64 Scope:Link
    UP BROADCAST RUNNING NOARP MTU:1500 Metric:1
    RX packets:1 errors:15 dropped:0 overruns:0 frame:15
    TX packets:29 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:60 (60.0 b) TX bytes:5448 (5.3 KiB)

    vif0.0 Link encap:Ethernet HWaddr FE:FF:FF:FF:FF:FF
    inet6 addr: fe80::fcff:ffff:feff:ffff/64 Scope:Link
    UP BROADCAST RUNNING NOARP MTU:1500 Metric:1
    RX packets:29 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:7882 (7.6 KiB) TX bytes:0 (0.0 b)

    virbr0 Link encap:Ethernet HWaddr 00:00:00:00:00:00
    inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0
    inet6 addr: fe80::200:ff:fe00:0/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:41 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:0 (0.0 b) TX bytes:7968 (7.7 KiB)

    xenbr0 Link encap:Ethernet HWaddr FE:FF:FF:FF:FF:FF
    UP BROADCAST RUNNING NOARP MTU:1500 Metric:1
    RX packets:29 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:7476 (7.3 KiB) TX bytes:0 (0.0 b)





    Laptop 192.168.1.66

    [root@srvr66 ~]# ping 192.168.1.66
    PING 192.168.1.66 (192.168.1.66) 56(84) bytes of data.
    64 bytes from 192.168.1.66: icmp_seq=0 ttl=64 time=0.045 ms
    64 bytes from 192.168.1.66: icmp_seq=1 ttl=64 time=0.042 ms
    64 bytes from 192.168.1.66: icmp_seq=2 ttl=64 time=0.038 ms
    64 bytes from 192.168.1.66: icmp_seq=3 ttl=64 time=0.041 ms
    64 bytes from 192.168.1.66: icmp_seq=4 ttl=64 time=0.043 ms
    64 bytes from 192.168.1.66: icmp_seq=5 ttl=64 time=0.042 ms
    64 bytes from 192.168.1.66: icmp_seq=6 ttl=64 time=0.042 ms
    64 bytes from 192.168.1.66: icmp_seq=7 ttl=64 time=0.041 ms


    [root@srvr66 ~]# ping 192.168.1.69
    PING 192.168.1.69 (192.168.1.69) 56(84) bytes of data.
    From 192.168.1.66 icmp_seq=1 Destination Host Unreachable
    From 192.168.1.66 icmp_seq=2 Destination Host Unreachable
    From 192.168.1.66 icmp_seq=3 Destination Host Unreachable
    From 192.168.1.66 icmp_seq=5 Destination Host Unreachable
    From 192.168.1.66 icmp_seq=6 Destination Host Unreachable
    From 192.168.1.66 icmp_seq=7 Destination Host Unreachable

    [root@srvr66 ~]# ifconfig
    eth0 Link encap:Ethernet HWaddr 00:16:D3:A4:0F:91
    inet addr:192.168.1.66 Bcast:192.168.1.255 Mask:255.255.255.0
    inet6 addr: fe80::216:d3ff:fea4:f91/64 Scope:Link
    UP BROADCAST MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:3 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:0 (0.0 b) TX bytes:238 (238.0 b)

    lo Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    inet6 addr: ::1/128 Scope:Host
    UP LOOPBACK RUNNING MTU:16436 Metric:1
    RX packets:1547 errors:0 dropped:0 overruns:0 frame:0
    TX packets:1547 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:2258751 (2.1 MiB) TX bytes:2258751 (2.1 MiB)

    Edited by: K. Varun on Mar 27, 2013 2:47 PM
  • 3. Re: Connecting Two Linux Machines
    Dude! Guru
    Currently Being Moderated
    Try the following, assuming both computers use eth0 Ethernet interface.

    Configure your 2 computers as following, using the appropriate IP address, for instance:
    su - root
    ifconfig eth0 192.168.1.69 netmask 255.255.255.0 up
    You can remove the default route (optional).
    route -n | grep ^0.0.0.0
    route del default gw 192.168.1.250
    SSH is normally open and running, but to be sure...
    service sshd restart
    service iptables stop
    Use ping to verify physical connection to other machine.
    ping 192.168.1.66
    To set your IP configuration back to what it was originally:
    service network restart
    Make sure you have a proper cross-over cable http://en.wikipedia.org/wiki/Ethernet_crossover_cable. If your systems are new, your NIC's could be auto-switching and apply an internal crossover when necessary, so you can even use a regular cable. Ethernet is low voltage, so you cannot damage anything.

    Edited by: Dude on Mar 28, 2013 1:05 PM

    Removing the default route should not be necessary since both TCP/IP addresses are within the same subnet. Hence there is no default gw used or necessary.
  • 4. Re: Connecting Two Linux Machines
    K. Varun Newbie
    Currently Being Moderated
    still i am unable to connect
  • 5. Re: Connecting Two Linux Machines
    Dude! Guru
    Currently Being Moderated
    Then you might have the wrong cable and need a special cross-over UDP cable, or use a switch or hub.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points