1

I see a few questions similar to my but, they didn't answer my question. I have a router. I have installed Debian in VM and setup a ssh server on it. I want to forward a port for this machine on my router so I can connect from external networks. The adapter is NAT. So how and where I should forward a port. If I have to forward the port for my physical machine should I do something else?

2
  • Can you change the adapter to bridged? That way your VM sits in the local network like your host. What virtualization software are you using?
    – slhck
    Jul 7, 2014 at 14:26
  • Which Hypervisor are you using? VirtualBox, VMWare, KVM, HyperV, ...? And which network mode are you using? NAT or Bridged? And what is the host OS? Jul 7, 2014 at 15:03

1 Answer 1

0

By far the easiest is to use a Bridge connection for your VM. This makes it look like just any other pc on your LAN, it will be assigned an IP address within your LAN, and it will be able to talk bi-directionally with any pc on the LAN, router included. In this case you can directly forward the port to your VM. You can also make this a permanent arrangement, by reserving this IP address for your VM in your router, so that your VM will always be assigned the same address, and you will never have to configure the port forwarding again.

As you see, in this case the solution does not depend on host OS, NAT vs Bridge, type of Hypervisor ... If instead you do not want to use a bridged connection (thus you fall back onto a NAT conenction), the exact procedure to use will depend on these details....

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .