Find the answer to your Linux question:
Results 1 to 7 of 7
so on the host i'm trying to connect to, i have installed ssh server and it was working fine until i changed the /etc/network/interfaces file to set a static IP ...
  1. #1
    Just Joined!
    Join Date
    Dec 2009
    Posts
    24

    [SOLVED] SSH can't find a route to host after i set a static IP

    so on the host i'm trying to connect to, i have installed ssh server and it was working fine until i changed the /etc/network/interfaces file to set a static IP and then ran
    Code:
     sudo /etc/init.d/networking restart
    but now when i try to connect with SSH using the new static IP i get
    Code:
    ssh: connect to host 192.168.2.10 port 22: No route to host

  2. #2
    Linux Guru coopstah13's Avatar
    Join Date
    Nov 2007
    Location
    NH, USA
    Posts
    3,149
    so, show us what you put in /etc/network/interfaces

    i'm guessing you forgot something

  3. #3
    Just Joined!
    Join Date
    Dec 2009
    Posts
    24
    this is what i added;
    Code:
    iface eth0 inet static
    address 192.168.2.10
    netmask 255.255.255.0
    gateway 192.168.2.1

  4. #4
    Linux Engineer Freston's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    1,047
    Sometimes all you need is to reset the switch

    But assuming that doesn't help:
    You have reconfigured the SSH server. Looks good to me.

    But how about the client? Is that one configured properly... Is it in the same subnet? Is the server reachable from the clients gateway? What is different between settings through DHCP and static in terms of IP address/range and gateway? How are they connected physically (router/switch/wireless/cross-cable/usb)?
    Can't tell an OS by it's GUI

  5. #5
    Just Joined!
    Join Date
    Dec 2009
    Posts
    24
    Quote Originally Posted by Freston View Post
    But how about the client? Is that one configured properly... Is it in the same subnet? Is the server reachable from the clients gateway? What is different between settings through DHCP and static in terms of IP address/range and gateway? How are they connected physically (router/switch/wireless/cross-cable/usb)?
    yes they do have the same subnet. and they are connected via router.
    but i believe the client has a dynamic IP if that has anything to do with it.

  6. #6
    Linux Engineer Freston's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    1,047
    Quote Originally Posted by itachisxeyes
    but i believe the client has a dynamic IP if that has anything to do with it.
    Not necessarily, no. It is perfectly possible to have both static and dynamic addresses in the same network.

    Just to be sure pull the plug from the router, and keep it out of ~20 seconds. It may seem silly, but some develop problems over time and need their full reboot.


    How does it work the other way around? Can you ping the client from the server?
    Can't tell an OS by it's GUI

  7. #7
    Just Joined!
    Join Date
    Dec 2009
    Posts
    24
    ah, well i rebooted client, server, and router. which seems to have done the trick, thank you for all your help (^_^)
    i feel quiet silly for not trying that first.

Posting Permissions

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