Config DHCP Server ให้แจก IP ตาม MAC Address

By | 11/04/2018
Spread the love

เนื่องจากต้องติดตั้ง VM จำนวนหลายสิบ VM ไหนจะต้อง set env, set password อะไรต่อมิอะไร แต่ที่เหมือนจะง่ายสุดก็ตรงการ fix ip นี่แหละ
ตัวอย่างเบื่องต้น 13VM

[cc lang=”c”]
subnet 192.168.45.0 netmask 255.255.255.0 {
option routers 192.168.45.225;
option subnet-mask 255.255.255.240;
option domain-name “i7hosting.net”;
option domain-name-servers 8.8.8.8, 8.8.4.4;
option time-offset -18000; # Eastern Standard Time
range 192.168.45.226 192.168.45.238;
}

host vm01 {
hardware ethernet 0e:e0:4b:b4:28:01;
fixed-address 192.168.45.226;
}
host vm02 {
hardware ethernet 0e:e0:4b:b4:28:02;
fixed-address 192.168.45.227;
}
host vm03 {
hardware ethernet 0e:e0:4b:b4:28:03;
fixed-address 192.168.45.228;
}
host vm04 {
hardware ethernet 0e:e0:4b:b4:28:04;
fixed-address 192.168.45.229;
}
host vm05 {
hardware ethernet 0e:e0:4b:b4:28:05;
fixed-address 192.168.45.230;
}
host vm06 {
hardware ethernet 0e:e0:4b:b4:28:06;
fixed-address 192.168.45.231;
}
host vm07 {
hardware ethernet 0e:e0:4b:b4:28:07;
fixed-address 192.168.45.232;
}
host vm08 {
hardware ethernet 0e:e0:4b:b4:28:08;
fixed-address 192.168.45.233;
}
host vm09 {
hardware ethernet 0e:e0:4b:b4:28:09;
fixed-address 192.168.45.234;
}
host vm10 {
hardware ethernet 0e:e0:4b:b4:28:10;
fixed-address 192.168.45.235;
}
host vm11 {
hardware ethernet 0e:e0:4b:b4:28:11;
fixed-address 192.168.45.236;
}
host vm12 {
hardware ethernet 0e:e0:4b:b4:28:12;
fixed-address 192.168.45.237;
}
host vm13 {
hardware ethernet 0e:e0:4b:b4:28:13;
fixed-address 192.168.45.238;
}
[/cc]

ใส่ความเห็น