<p dir="ltr"><br>
On Jun 2, 2015 8:07 PM, "Narahari 'n' Savitha" <<a href="mailto:savithari@gmail.com">savithari@gmail.com</a>> wrote:<br>
><br>
> Friends:<br>
><br>
> I setup KVM and have created two VM's. I also setup the NAT way of connecting (uffffff)<br>
><br>
> Now I have some confusion.<br>
><br>
> On the host, I can do <br>
><br>
> ssh <a href="mailto:user@192.168.100.101">user@192.168.100.101</a><br>
><br>
> It connects.<br>
><br>
> I also do <br>
><br>
> ssh <a href="mailto:user@192.168.100.102">user@192.168.100.102</a><br>
><br>
> It connects<br>
><br>
><br>
> As you can see both connect on port 22, How is that possible ?</p>
<p dir="ltr">I see two different IPs so it's just like two different machines on the LAN.</p>
<p dir="ltr">should I have to do some kind of port forwarding ? How does KVM allow both VM's to run on port 22 ?<br>
><br>
> ======================<br>
><br>
> Secondly which is more important, for port forwarding to work so I can connect to the vm's directly <br>
><br>
> Is IPTABLES the only way to set the host up to forward traffic ?<br>
><br>
> or<br>
><br>
> 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) ?<br>
><br>
> 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 ?</p>
<p dir="ltr">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.</p>
<p dir="ltr">><br>
> 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.<br>
><br>
> Thank You for your time and attention.<br>
><br>
> -N<br>
><br>
><br>
><br>
> _______________________________________________<br>
> Ale mailing list<br>
> <a href="mailto:Ale@ale.org">Ale@ale.org</a><br>
> <a href="http://mail.ale.org/mailman/listinfo/ale">http://mail.ale.org/mailman/listinfo/ale</a><br>
> See JOBS, ANNOUNCE and SCHOOLS lists at<br>
> <a href="http://mail.ale.org/mailman/listinfo">http://mail.ale.org/mailman/listinfo</a><br>
><br>
</p>