VirtualBox internal network port forwarding ssh access to quest from host



  • I have 2 VM:

    1. Pfsense bridged and internal network
    2. Ubuntu internal network
      (they can communicate with each other and Ubuntu have access to internet)

    I want to be able access Ubuntu console from my host via ssh so i setup NAT port forwarding on port 22 but its not working, all other access should be blocked except for ssh port 22. i try access Pfsense from my host by putty and its work fine but for some reason i cant access my Ubuntu.

    I create 1 more Ubuntu2 for testing and put it in internal network and i was able to access Ubuntu from it by ssh so i guess that something is blocking my access to internal network from host( i think that access is blocked by default but port forwarding should allow me access to it right?).

    Any ideas what i'm doing wrong?

    Pfsense:
    WAN (wan) ->em0 -> v4/DHCP4: 192.168.0.6/24
    LAN(lan) ->em1-> v4: 192.168.1.1/24

    http://screenshot.sh/m2eUddgpNPKn9 Ubuntu
    http://screenshot.sh/m8X9x7l71uof9 NAT / WAN rules


  • LAYER 8 Global Moderator

    1. Pfsense bridged and internal network
    2. Ubuntu internal network

    Huh?  What network do you have this ubuntu box on the 192.168.1/24 ??  Can you post up your VB networking setup..

    If so what does pfsense have to do with anything unless your trying to access from pfsense WAN network?  You want to connect from your host?  The VM host, your host (workstation)?  So your saying your host that is running VB is on your wan network?  Why would it not be on your lan network?  So your host is behind pfsense firewall?

    But your nat is wrong - what is the dest port you have * this should be 22 if your sending to 22.. Your nat says send every PORT, every one to 22… That sure and the hell not going to work..



  • I didn't make any changes in VB except settings networks adapters and setting static ip in ubuntu.
    http://screenshot.sh/mFx0lRVCzSzGN
    http://screenshot.sh/oAi7I5kFVRmY3

    Ubuntu is in same  internal network as Pfsense.

    well its a task that i want to do i should be able to access my Ubuntu in VR from host and i need to use for that Pfsense.
    Pfsense and Ubuntu shoud are in VB and access is from VB host
    and other communication like ping shoud be blocked trom host -> Ubuntu

    @johnpoz:

    But your nat is wrong - what is the dest port you have * this should be 22 if your sending to 22.. Your nat says send every PORT, every one to 22… That sure and the hell not going to work..

    Why is wrong? i dont know from what port that comunination will come? i just want to receive it on port 22. i think NAT is ok i can get access as long as im in same VB internal network but i can't get connection from host so probably i mess up something with IP setup?

    This is waht PFsense logs show when i try access shh thru putty
    1 when i try to access ubuntu is supose to be 192.168.0.3(host) -> 192.168.1.102 but its somehow doing this wrong
    2 when i try to access Pfsense from host and its works perfect i want to have same efect on Ubuntu but its not working
    http://screenshot.sh/n8dkfPA7uFZA7


  • LAYER 8 Global Moderator

    your dest shoudl be 22.. Agreed you don't know what port the traffic will come form.. But you do know it will be going to 22..


Log in to reply