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

By | 11/04/2018

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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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;
}

ใส่ความเห็น