当前位置: 技术问答>linux和unix
请问linux dhcpd 分发多网段地址错误
来源: 互联网 发布时间:2017-02-23
本文导语: 我有多个vlan 在h3c s7506R上 dhcp server 1 ip 192.168.1.23 int vlan 100 ip address 10.0.100.1 255.255.255.0 dhcp server 1 int vlan 200 ip address 10.0.200.1 255.255.255.0 dhcp server 1 int vlan 300 ip address 10.0.300.1 255.255.255.0 dhcp server 1 int ...
我有多个vlan 在h3c s7506R上
dhcp server 1 ip 192.168.1.23
int vlan 100
ip address 10.0.100.1 255.255.255.0
dhcp server 1
int vlan 200
ip address 10.0.200.1 255.255.255.0
dhcp server 1
int vlan 300
ip address 10.0.300.1 255.255.255.0
dhcp server 1
int vlan 192
ip address 192.168.1.0 255.255.255.0
dhcp server 1
linux 服务器eth0 ip 192.168.1.23
单网卡
/etc/dhcpd.conf
ddns-update-style none;
ignore client-updates;
shared-network net{
subnet 10.0.100.0 netmask 255.255.255.0 {
option routers 10.0.100.1;
option subnet-mask 255.255.255.0;
option domain-name-servers 10.0.100.2;
option domain-name-servers 10.0.100.3;
range dynamic-bootp 10.0.100.10 10.0.100.200;
default-lease-time 21600;
max-lease-time 43200;
}
subnet 10.0.200.0 netmask 255.255.255.0 {
option routers 10.0.200.1;
option subnet-mask 255.255.255.0;
option domain-name-servers 10.0.100.2;
option domain-name-servers 10.0.100.3;
range dynamic-bootp 10.0.200.100 10.0.200.200;
default-lease-time 21600;
max-lease-time 43200;
}
subnet 10.0.300.0 netmask 255.255.255.0 {
option routers 10.0.300.1;
option subnet-mask 255.255.255.0;
option domain-name-servers 10.0.100.2;
option domain-name-servers 10.0.100.3;
range dynamic-bootp 10.0.300.10 10.0.300.200;
default-lease-time 21600;
max-lease-time 43200;
}
}
subnet 192.168.1.0 netmask 255.255.255.0 {
option routers 192.168.1.1;
option subnet-mask 255.255.255.0;
option domain-name-servers 10.0.100.2;
option domain-name-servers 10.0.100.3;
range dynamic-bootp 192.168.1.100 192.168.1.200;
default-lease-time 21600;
max-lease-time 43200;
}
问题是我在vlan 192能获得正确ip 192.168.1.100,将pc插到其他vlan中,在vlan 100和vlan 300都是获得vlan 200的ip地址10.0.200.200.
为什么在一个shared-network中会分到错误的ip??
dhcp server 1 ip 192.168.1.23
int vlan 100
ip address 10.0.100.1 255.255.255.0
dhcp server 1
int vlan 200
ip address 10.0.200.1 255.255.255.0
dhcp server 1
int vlan 300
ip address 10.0.300.1 255.255.255.0
dhcp server 1
int vlan 192
ip address 192.168.1.0 255.255.255.0
dhcp server 1
linux 服务器eth0 ip 192.168.1.23
单网卡
/etc/dhcpd.conf
ddns-update-style none;
ignore client-updates;
shared-network net{
subnet 10.0.100.0 netmask 255.255.255.0 {
option routers 10.0.100.1;
option subnet-mask 255.255.255.0;
option domain-name-servers 10.0.100.2;
option domain-name-servers 10.0.100.3;
range dynamic-bootp 10.0.100.10 10.0.100.200;
default-lease-time 21600;
max-lease-time 43200;
}
subnet 10.0.200.0 netmask 255.255.255.0 {
option routers 10.0.200.1;
option subnet-mask 255.255.255.0;
option domain-name-servers 10.0.100.2;
option domain-name-servers 10.0.100.3;
range dynamic-bootp 10.0.200.100 10.0.200.200;
default-lease-time 21600;
max-lease-time 43200;
}
subnet 10.0.300.0 netmask 255.255.255.0 {
option routers 10.0.300.1;
option subnet-mask 255.255.255.0;
option domain-name-servers 10.0.100.2;
option domain-name-servers 10.0.100.3;
range dynamic-bootp 10.0.300.10 10.0.300.200;
default-lease-time 21600;
max-lease-time 43200;
}
}
subnet 192.168.1.0 netmask 255.255.255.0 {
option routers 192.168.1.1;
option subnet-mask 255.255.255.0;
option domain-name-servers 10.0.100.2;
option domain-name-servers 10.0.100.3;
range dynamic-bootp 192.168.1.100 192.168.1.200;
default-lease-time 21600;
max-lease-time 43200;
}
问题是我在vlan 192能获得正确ip 192.168.1.100,将pc插到其他vlan中,在vlan 100和vlan 300都是获得vlan 200的ip地址10.0.200.200.
为什么在一个shared-network中会分到错误的ip??
|
class "vlan100"{
match if substring (option agent.circuit-id,2,2) = 00:64;
}
class "vlan200"{
match if substring (option agent.circuit-id,2,2) = 00:C8;
}
subnet 10.0.100.0 netmask 255.255.255.0 {
pool {
option routers 10.0.100.1;
option subnet-mask 255.255.255.0;
option domain-name-servers 10.0.100.2;
option domain-name-servers 10.0.100.3;
range dynamic-bootp 10.0.100.10 10.0.100.200;
default-lease-time 21600;
max-lease-time 43200;
allow members of "vlan100";
}
}
subnet 10.0.200.0 netmask 255.255.255.0 {
pool {
option routers 10.0.200.1;
option subnet-mask 255.255.255.0;
option domain-name-servers 10.0.100.2;
option domain-name-servers 10.0.100.3;
range dynamic-bootp 10.0.200.100 10.0.200.200;
default-lease-time 21600;
max-lease-time 43200;
allow members of "vlan200";
}
}
match if substring (option agent.circuit-id,2,2) = 00:64;
}
class "vlan200"{
match if substring (option agent.circuit-id,2,2) = 00:C8;
}
subnet 10.0.100.0 netmask 255.255.255.0 {
pool {
option routers 10.0.100.1;
option subnet-mask 255.255.255.0;
option domain-name-servers 10.0.100.2;
option domain-name-servers 10.0.100.3;
range dynamic-bootp 10.0.100.10 10.0.100.200;
default-lease-time 21600;
max-lease-time 43200;
allow members of "vlan100";
}
}
subnet 10.0.200.0 netmask 255.255.255.0 {
pool {
option routers 10.0.200.1;
option subnet-mask 255.255.255.0;
option domain-name-servers 10.0.100.2;
option domain-name-servers 10.0.100.3;
range dynamic-bootp 10.0.200.100 10.0.200.200;
default-lease-time 21600;
max-lease-time 43200;
allow members of "vlan200";
}
}