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