Find the answer to your Linux question:
Results 1 to 4 of 4
Like Tree1Likes
  • 1 Post By awc
Hi I am facing the below problem while trying to do ssh from either of the servers. [stan$ zx100 etc]$ ssh fx100 ssh: connect to host fx100 port 22: Network ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2012
    Posts
    2

    Network problems ssh not working.


    Hi

    I am facing the below problem while trying to do ssh from either of the servers.

    [stan$ zx100 etc]$ ssh fx100
    ssh: connect to host fx100 port 22: Network is unreachable

    [stan$fx100 ~]$ ssh zx100
    ssh: connect to host zx100 port 22: Network is unreachable


    I have added the " ip address to hostname" entries in /etc/hosts on both servers. They are the same on both servers.

    And the eth0 interfaces on both servers have been edited with ip addresses and subnet mask. Both servers eth0 have same subnet mask.

    But ping from either machine does not work.

    Can somebody help me in resolving this problem ? what changes I need to make so that I can connect to either machines.

    ------------------------------------------

    [stan$fx100 ~]$ ssh -v zx100

    OpenSSH_4.3p2, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008
    debug1: Reading configuration data /etc/ssh/ssh_config
    debug1: Applying options for *
    debug1: Connecting to zx100 [10.1.36.20] port 22.
    debug1: connect to address 10.1.36.20 port 22: Network is unreachable
    ssh: connect to host zx100 port 22: Network is unreachable

    ----------------------

    [stan$fx100 ~]$ /sbin/ifconfig
    eth0 Link encap:Ethernet HWaddr 00:0C:29:E5:EE:E9
    inet addr:10.1.130.1 Bcast:10.1.130.255 Mask:255.255.255.0
    UP BROADCAST MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
    Interrupt:19 Base address:0x2024

    lo Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    UP LOOPBACK RUNNING MTU:16436 Metric:1
    RX packets:1400 errors:0 dropped:0 overruns:0 frame:0
    TX packets:1400 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:3487475 (3.3 MiB) TX bytes:3487475 (3.3 MiB)


    ------------------------


    [stan$zx100 etc]$ ssh -v fx100
    OpenSSH_4.3p2, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008
    debug1: Reading configuration data /etc/ssh/ssh_config
    debug1: Applying options for *
    debug1: Connecting to fx100 [10.1.130.1] port 22.
    debug1: connect to address 10.1.130.1 port 22: Network is unreachable
    ssh: connect to host fx100 port 22: Network is unreachable

    ---------------------------------------------------

    [stan$zx100 etc]$ /sbin/ifconfig
    eth0 Link encap:Ethernet HWaddr 00:0C:29:9C:8D:F3
    inet addr:10.1.36.20 Bcast:10.1.36.255 Mask:255.255.255.0
    UP BROADCAST MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
    Interrupt:19 Base address:0x2024

    lo Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    UP LOOPBACK RUNNING MTU:16436 Metric:1
    RX packets:1902 errors:0 dropped:0 overruns:0 frame:0
    TX packets:1902 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:3537394 (3.3 MiB) TX bytes:3537394 (3.3 MiB)

  2. #2
    awc
    awc is offline
    Just Joined! awc's Avatar
    Join Date
    Aug 2012
    Location
    North America
    Posts
    40
    Your machines are in different subnets.

    inet addr:10.1.130.1 Bcast:10.1.130.255 Mask:255.255.255.0
    inet addr:10.1.36.20 Bcast:10.1.36.255 Mask:255.255.255.0

    Try putting both boxes in the same subnet, e.g. make the IP's 10.1.130.1 & 10.1.130.2 Update /etc/hosts too if you want to continue trying to use hostnames.

    Not really sure what you mean here

    I have added the " ip address to hostname" entries in /etc/hosts on both servers. They are the same on both servers.
    If problems continue:
    1. Test the ssh server by connecting to the local machine
      Code:
      ssh localhost
    2. Use ip addresses instead of hostnames
    3. Check your firewall settings
    4. Temporarily turn off Selinux
    Dapper Dan likes this.

  3. #3
    Just Joined!
    Join Date
    Aug 2012
    Posts
    2
    I changed the ip addresses as advised by you. and also made entries on /etc/hosts. But the same problem.

    firewall and also the selinux setting have been disabled.


    [stan fx100 ~]# ssh 10.1.0.20
    ssh: connect to host 10.1.0.20 port 22: No route to host


    [stan zx100 ~]$ ssh 10.1.0.21
    ssh: connect to host 10.1.0.21 port 22: No route to host

    /etc/hosts entry on both servers.

    [stan zx100 ~]$ cat /etc/hosts

    # Do not remove the following line, or various programs
    # that require network functionality will fail.
    127.0.0.1 localhost.localdomain localhost
    ::1 localhost6.localdomain6 localhost6


    10.1.0.20 zx100 zx100
    10.1.0.21 fx100 fx100

    ssh localhost works.

    [stan zx100 ~]$ ssh localhost
    stan localhost's password:
    Last login: Mon Aug 6 23:55:58 2012 from localhost.localdomain

    [stan zx100 ~]$

    [stan zx100 ~]$ /sbin/ifconfig -a
    eth0 Link encap:Ethernet HWaddr 00:0C:29:9C:8D:F3
    inet addr:10.1.0.20 Bcast:10.1.0.255 Mask:255.255.255.0
    UP BROADCAST MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
    Interrupt:19 Base address:0x2024

    lo Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    UP LOOPBACK RUNNING MTU:16436 Metric:1
    RX packets:6550 errors:0 dropped:0 overruns:0 frame:0
    TX packets:6550 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:8537442 (8.1 MiB) TX bytes:8537442 (8.1 MiB)


    [stan fx100 ~]# ifconfig -a
    eth0 Link encap:Ethernet HWaddr 00:0C:29:E5:EE:E9
    inet addr:10.1.0.21 Bcast:10.1.0.255 Mask:255.255.255.0
    UP BROADCAST MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
    Interrupt:19 Base address:0x2024

    lo Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    UP LOOPBACK RUNNING MTU:16436 Metric:1
    RX packets:3768 errors:0 dropped:0 overruns:0 frame:0
    TX packets:3768 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:5847029 (5.5 MiB) TX bytes:5847029 (5.5 MiB)

  4. $spacer_open
    $spacer_close
  5. #4
    awc
    awc is offline
    Just Joined! awc's Avatar
    Join Date
    Aug 2012
    Location
    North America
    Posts
    40
    How are these 2 computers connected?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •