weixin_40004960
weixin_40004960
2020-12-28 04:42

Connection timeout on bosh ssh

Hello together,

today I used bosh-lite the first time and I can't ssh into my containers. I called "templates/add-route" and the route seems to be added. I deployed the cf-haproxy-boshrelease and everything seems to be fine with the deployment. Both containers are started and have status "running" when I run "bosh vms". But if I try to run "bosh ssh" and then choose one of the jobs, the shell hangs on "Starting interactive shell on job public_haproxy_z1/0" and after a minute it tells "ssh: connect to host 10.244.50.2 port 22: Connection timed out" Does anyone have an idea what could cause this problem?

该提问来源于开源项目:cloudfoundry-attic/bosh-lite

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

8条回答

  • weixin_39703926 weixin_39703926 4月前

    Sounds like 10.244.50.2 is not a good IP. what's the output of bosh vms?

    点赞 评论 复制链接分享
  • weixin_40004960 weixin_40004960 4月前

    Output of bosh vms is:

    | private_haproxy_z1/0 | running | small_z1 | 10.244.50.14 | | public_haproxy_z1/0 | running | small_z1 | 10.244.50.2 |

    Complete Output of the bosh ssh command is:

    
    christian-ThinkPad-L530:~/dev/repos/bosh-lite$ bosh ssh
    1. public_haproxy_z1/0
    2. private_haproxy_z1/0
    Choose an instance: 1
    Acting as user 'admin' on deployment 'cf-haproxy-warden' on 'Bosh Lite Director'
    Enter password (use it to sudo on remote host): *****
    Target deployment is `cf-haproxy-warden'
    
    Setting up ssh artifacts
    
    Director task 9
    
    Task 9 done
    Starting interactive shell on job public_haproxy_z1/0
    ssh: connect to host 10.244.50.2 port 22: Connection timed out
    
    Cleaning up ssh artifacts
    
    Director task 10
    
    Task 10 done
    
    点赞 评论 复制链接分享
  • weixin_39650784 weixin_39650784 4月前

    Let's do a sanity check:

    vagrant ssh ssh vcap.244.50.2

    Does that work?

    On Mon, Sep 21, 2015 at 10:37 AM, Koizumi85 notifications.com wrote:

    https://github.com/cppforlife Output of bosh vms is:

    | private_haproxy_z1/0 | running | small_z1 | 10.244.50.14 | | public_haproxy_z1/0 | running | small_z1 | 10.244.50.2 |

    Complete Output of the bosh ssh command is:

    christian-ThinkPad-L530:~/dev/repos/bosh-lite$ bosh ssh 1. public_haproxy_z1/0 2. private_haproxy_z1/0 Choose an instance: 1 Acting as user 'admin' on deployment 'cf-haproxy-warden' on 'Bosh Lite Director' Enter password (use it to sudo on remote host): * Target deployment is `cf-haproxy-warden'

    Setting up ssh artifacts

    Director task 9

    Task 9 done Starting interactive shell on job public_haproxy_z1/0 ssh: connect to host 10.244.50.2 port 22: Connection timed out

    Cleaning up ssh artifacts

    Director task 10

    Task 10 done

    — Reply to this email directly or view it on GitHub https://github.com/cloudfoundry/bosh-lite/issues/296#issuecomment-142053683 .

    点赞 评论 复制链接分享
  • weixin_40004960 weixin_40004960 4月前

    Yes, this works.

    点赞 评论 复制链接分享
  • weixin_39650784 weixin_39650784 4月前

    Sounds like then add-route did not work for you. Please confirm that proper route is in the route table.

    On Mon, Sep 21, 2015 at 10:49 AM, Koizumi85 notifications.com wrote:

    Yes, this works.

    — Reply to this email directly or view it on GitHub https://github.com/cloudfoundry/bosh-lite/issues/296#issuecomment-142058346 .

    点赞 评论 复制链接分享
  • weixin_40004960 weixin_40004960 4月前

    Output of route command:

    
    Ziel            Router          Genmask         Flags Metric Ref    Use Iface
    default         192.168.1.1     0.0.0.0         UG    0      0        0 eth0
    10.244.0.0      192.168.50.4    255.255.224.0   UG    0      0        0 vboxnet0
    192.168.1.0     *               255.255.255.0   U     1      0        0 eth0
    192.168.50.0    *               255.255.255.0   U     0      0        0 vboxnet0
    
    点赞 评论 复制链接分享
  • weixin_39703926 weixin_39703926 4月前
    
    $ ipcalc 10.244.0.0/19
    Address:   10.244.0.0           00001010.11110100.000 00000.00000000
    Netmask:   255.255.224.0 = 19   11111111.11111111.111 00000.00000000
    Wildcard:  0.0.31.255           00000000.00000000.000 11111.11111111
    =>
    Network:   10.244.0.0/19        00001010.11110100.000 00000.00000000
    HostMin:   10.244.0.1           00001010.11110100.000 00000.00000001
    HostMax:   10.244.31.254        00001010.11110100.000 11111.11111110
    Broadcast: 10.244.31.255        00001010.11110100.000 11111.11111111
    Hosts/Net: 8190                  Class A, Private Internet
    

    Note that IP you have chosen falls outside of 10.244.0.1-10.244.31.254 range. You can change add-route to forward /16 to gw IP which should fix your problem.

    点赞 评论 复制链接分享
  • weixin_39703926 weixin_39703926 4月前

    Fixed in https://github.com/cloudfoundry/bosh-lite/commit/1e82360f0bd00f75a367ddea81a024aebf514a74

    点赞 评论 复制链接分享

相关推荐