networking – Assigning public IP address to a VM hosted on a server behind NAT

I have a pool of public IP addresses ( – 254). I also have a server hosting KVM machines. It has an private ip address which is NATed by the router to the address.

VM hosted on it are routed the same way – router binds addresses to the,xxx and it works, but I want to assign them public IPs directly. They need to work somewhat like vps – you log into them by ssh and ip -a shows only one interface with public IP.

I tried to assign an external ip address to the vm with gateway set to the host internal IP but it didn’t work. Nobody could ping it, including the host, How to setup KVM, the host server and router for it to work?