Allow Remote Access to Virtual Machine with Iptables

To allow remote access to VM in the same LAN
Enable ip forwarding:

# echo 1 > /proc/sys/net/ipv4/ip_forward


To make it permanent:

# echo "net.ipv4.ip_forward=1" >> /etc/sysctl.conf


To allow external connections to a VM port:
Open ssh port:

# iptables -I  INPUT -i virbr0 -p tcp -m tcp --dport 22 -j ACCEPT


In the remote host (that is on the same LAN) where the VM network is 192.168.100.0/255.255.255.0 and the VM host is: 192.168.1.1

# route add -net 192.168.100.0/24 gw 192.168.1.1


And that's it!! be happier than me 'cause i always forget about this.