simple dhcp config

Aleksej

Well-Known Member
Feb 25, 2018
62
4
48
39
hello.
maybe someone can help.
now all VM's are connected to internet via vmbr0 whitch has a static public ip. i need to configure dhcp on host system to give them public ip's automatically and also static internal ip's. i thought about using built-in nat, but i can't find any documentation where it's config files to configure built-in dhcp for static local addresses and also public.
also i can't redirect ports to vm, as example:
Code:
iptables -t nat -A PREROUTING -i "what interface to use???" -p tcp --dport 3500 -j DNAT --to 10.0.2.15:3500
because this vm is connected using nat, not vmbr[X].
the biggest problem that i can't try to install different dhcp,like isc-dhcp, and often restart host machine.
 
because this vm is connected using nat, not vmbr[X].
this is using the qemu internal nat mode where we have no builtin way to do port forwarding (you could do it manually i think)
see 'man kvm' for details