[ale] kvm port forwarding confusion, kindly help

Jim Kinney jim.kinney at gmail.com
Tue Jun 2 23:42:39 EDT 2015


On Jun 2, 2015 8:07 PM, "Narahari 'n' Savitha" <savithari at gmail.com> wrote:
>
> Friends:
>
> I setup KVM and have created two VM's.  I also setup the NAT way of
connecting (uffffff)
>
> Now I have some confusion.
>
> On the host, I can do
>
> ssh user at 192.168.100.101
>
> It connects.
>
> I also do
>
> ssh user at 192.168.100.102
>
> It connects
>
>
> As you can see both connect on port 22,   How is that possible ?

I see two different IPs so it's just like two different machines on the LAN.

should I have to do some kind of port forwarding ?  How does KVM allow both
VM's to run on port 22 ?
>
> ======================
>
> Secondly which is more important, for port forwarding to work so I can
connect to the vm's directly
>
> Is IPTABLES the only way to set the host up to forward traffic ?
>
> or
>
> Can I use stuff specific to KVM where I can do port forwarding to
specific vm ip's (5555 on host  forwards to 192.168.100.101 port 22 but
4444 on host forwards to 192.168.100.102) ?
>
> Virtual box and VMware allow this and there are nice tools to configure
at the Hypervisor level.  Does KVM allow this thru KVM-NAT-CONFIG ?

You'll need to setup a bridged network for KVM to use for the VMs. The gui
tool virt-manager has this in the advanced configurations. Basically the
physical NIC now listens to all the virtual IPs and forwards the traffic
unchanged. This will allow non-host traffic to reach the VMs. In standard
mode, the VMs are NATed automagically by the virtual switch creating IPs
using dhcp.

>
> Most examples I have googled lead me to the IPTABLES approach and I sure
there must be a different more simple non-monsterous (read iptables) way.
>
> Thank You for your time and attention.
>
> -N
>
>
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ale.org/pipermail/ale/attachments/20150602/b4547777/attachment.html>


More information about the Ale mailing list