tedd
V2EX  ›  Vagrant

如何让本机中启动的vagrant box被内网中的其他机器访问到呢

  •  
  •   tedd · Oct 22, 2013 · 8088 views
    This topic created in 4591 days ago, the information mentioned may be changed or developed.
    本机vagrant box已启动,端口转发的是2222,在本机ssh 127.0.0.1:2222即可,本机内网IP 192.168.1.100

    在内网中另外一个机器(能够ping通192.168.1.100)尝试ssh 进入192.168.1.100:2222 失败,请问要如何让本机中启动的vagrant box被内网中的其他机器访问到呢
    5 replies    1970-01-01 08:00:00 +08:00
    tarsier
        1
    tarsier  
       Oct 22, 2013 via Android   ❤️ 1
    再做一次端口转发呗
    mlc880926
        2
    mlc880926  
       Oct 22, 2013   ❤️ 1
    使用 bridge 模式不就行了
    Livid
        3
    Livid  
    MOD
    PRO
       Oct 22, 2013 via iPhone   ❤️ 1
    打开 Vagrantfile,注释里就有。
    tedd
        4
    tedd  
    OP
       Oct 23, 2013
    感谢各位,已在vagrangfile里面取消了public access的备注,现在内网中的电脑也能ssh进去了 :D

    但有个很奇怪的问题,我回到家后,拨上公司vpn,能ping通host machine,但是就是ping不通vagrant box的ip地址(在公司的内网中其他电脑没有这个问题),就更别说ssh进去了...

    @tarsier
    @mlc880926
    @mlc880926
    @Livid
    mlc880926
        5
    mlc880926  
       Oct 23, 2013
    因为你的 vpn 只作用于物理机,你的虚拟机的网卡并没有拨通 vpn 啊
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5490 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 01:45 · PVG 09:45 · LAX 18:45 · JFK 21:45
    ♥ Do have faith in what you're doing.