瞻博网络 ZTP DHCP 服务器设置

网络工程 dhcp 杜松 杜松-srx 瞻博网络
2022-02-08 01:18:59

我目前正在尝试将 DHCP 配置为 ztp 设置的一部分。现在我的拓扑如下:

ex2200(me0,10.0.20.2)->(ge-0/0/1,10.0.20.1)srx100(fe-0/0/2,10.0.80.1)<-(eth0,10.0.80.2)centos6.7_dhcp_server

我在 10.0.80.0/24 子网中有 dhcp 服务器,我希望它为 10.0.20.0/24 子网分配 IP 地址。

set vendor-string = option vendor-class-identifier;
option space ZTPDEMO;
option ZTPDEMO.image-file-name code 0 = text;
option ZTPDEMO.config-file-name code 1 = text;
option ZTPDEMO.image-file-type code 2 = text;
option ZTPDEMO.transfer-mode code 3 = text;
option ZTPDEMO-encapsulation code 43 = encapsulate ZTPDEMO;
option ZTPDEMO.image-file-type "symlink";
option option-150 code 150 = ip-address;

host CAN1 {
 hardware ethernet 80:ac:ac:4c:84:ff;
 fixed-address 10.0.20.3;
 option host-name "to-mdf-ex22-sw5";
 option vendor-class-identifier "Juniper-ex2200-48p-4g;
 option option-150 10.0.80.2;
 option ZTPDEMO.transfer-mode "http";
 option ZTPDEMO.config-file-name "to-mdf-ex22-sw5-config.txt";
 option ZTPDEMO.image-file-name "jinstall-ex-2200-15.1R5.5-domestic-signed.tgz";
}
subnet 10.0.20.0 netmask 255.255.255.0 {
 option domain-name-servers 8.8.8.8;
 option routers 10.0.20.1;
 default-lease-time 600;
 max-lease-time 7200;
 authoritative;
 option ZTPDEMO.transfer-mode "http";
 pool {
        range dynamic-bootp 10.0.20.3 10.0.20.254;
        option OPTION-150 10.0.80.2;
        option P61.config-file-name "default-ex2200-c-12p.config";
      }
}

这是我收到的错误:

Feb 15 06:26:35 localhost dhcpd: Internet Systems Consortium DHCP Server 4.1.1-P1
Feb 15 06:26:35 localhost dhcpd: Copyright 2004-2010 Internet Systems Consortium.
Feb 15 06:26:35 localhost dhcpd: All rights reserved.
Feb 15 06:26:35 localhost dhcpd: For info, please visit https://www.isc.org/software/dhcp/
Feb 15 06:26:35 localhost dhcpd: Not searching LDAP since ldap-server, ldap-port and ldap-base-dn were not specified in the config file
Feb 15 06:26:35 localhost dhcpd: Wrote 0 deleted host decls to leases file.
Feb 15 06:26:35 localhost dhcpd: Wrote 0 new dynamic host decls to leases file.
Feb 15 06:26:35 localhost dhcpd: Wrote 0 leases to leases file.
Feb 15 06:26:35 localhost dhcpd: 
Feb 15 06:26:35 localhost dhcpd: No subnet declaration for eth0 (10.0.80.2).
Feb 15 06:26:35 localhost dhcpd: ** Ignoring requests on eth0.  If this is not what
Feb 15 06:26:35 localhost dhcpd:    you want, please write a subnet declaration
Feb 15 06:26:35 localhost dhcpd:    in your dhcpd.conf file for the network segment
Feb 15 06:26:35 localhost dhcpd:    to which interface eth0 is attached. **
Feb 15 06:26:35 localhost dhcpd: 
Feb 15 06:26:35 localhost dhcpd: 
Feb 15 06:26:35 localhost dhcpd: Not configured to listen on any interfaces!
Feb 15 06:26:35 localhost dhcpd: 
Feb 15 06:26:35 localhost dhcpd: This version of ISC DHCP is based on the release available
Feb 15 06:26:35 localhost dhcpd: on ftp.isc.org.  Features have been added and other changes
Feb 15 06:26:35 localhost dhcpd: have been made to the base software release in order to make
Feb 15 06:26:35 localhost dhcpd: it work better with this distribution.
Feb 15 06:26:35 localhost dhcpd: 
Feb 15 06:26:35 localhost dhcpd: Please report for this software via the CentOS Bugs Database:
Feb 15 06:26:35 localhost dhcpd:     http://bugs.centos.org/
Feb 15 06:26:35 localhost dhcpd: 
Feb 15 06:26:35 localhost dhcpd: exiting.
[root@localhost dhcp]# service ssh start

其他一些花絮:iptables 已关闭,端口在服务器上静态配置:eth0 10.0.80.2 255.255.255.0,网关 10.0.80.1。

有人知道我做错了什么吗?

1个回答

好的,找到解决方案。扩展子网,并在 srx 上进行了一些配置更改(为错误的系列配置了端口)。