I have a dedi with an IP range of 123.123.123.1/24, the problem is the gateway address: 111.111.111.254 and it's on completely different subnet. I have already setup a bridge and KVM virtualization.
/etc/dhcpd.conf on host node.
subnet 0.0.0.0 netmask 0.0.0.0 {
authoritative;
default-lease-time 21600000;
max-lease-time 432000000;
}
ddns-update-style ad-hoc;
host kvm111.0 {
hardware ethernet 02:00:00:ce:fd:ab;
option routers 111.111.111.254;
option subnet-mask 255.255.255.0;
fixed-address 123.123.123.2;
option domain-name-servers 8.8.8.8,8.8.4.4;
}
Then I setup a KVM virtual machine (VM) on that HWID, with Windows OS and dhcp on. It's working good. The Windows VM got 123.123.123.2 IP with the gateway in 111.111.111.254.
But when I change the OS of VM to Debian 6, it doesn't work. I login to VM and found that the gateway is not assigned. When I type route add default gw 111.111.111.254 the answer is:
SIOADDCART: no such process
That's because the gateway is in different subnet than the assigned IP address. So I had to do this on the VM:
route add 111.111.111.254/32 dev eth0
route add default gw 111.111.111.254
and then it will work. But since I want an automation via the host node (not doing it manually via VM), I had to do it via /etc/dhcpd.conf
Does anyone know how to do route add 111.111.111.254/32 dev eth0 via /etc/dhcpd.conf ?