I am trying to port forward over NAT to a VM in a home network with this guide. (https://aboullaite.me/kvm-qemo-forward-ports-with-iptables/) However, there is a part that requires me to substitute ${Guest_ipaddr}. Should I substitute the local IP of the VM or the host? A short explanation why this variable is used in place of (which was used as the example for the local IP of the VM) would be great.

1 Answer 1


The article is not very reader-friendly. When he says : "Now, The first step toward setting up a public IP to our VM, is to get it MAC address." he was probably trying to say : "Now, The first step toward setting up a static IP to our VM, is to get it MAC address, so that the embedded DHCP server of KVM will remember that MAC and assign always the same IP on the specific VM (or you can just go and administer the network configuration of the VM itself, for example if it is CentOS edit the file /etc/sysconfig/network-scripts/ifcfg-eth0 or whatever name you have , it could be en0p9 etc)"

So basically what he wants to do is assure that his guest VM will always have the IP , even though he avoided to do a proper network configuration when he installed the VM (he left the VM as a dhcp client), or even later by editing the network configuration and using a static IP for the VM. And it seems that the ${Guest_ipaddr} is just a left-over from some script that he has somewhere, and you can use the value if you are following his example to the letter. But if you are using the default network that KVM provides, your VM should have an IP in the network, so adjust your values accordingly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.