我有一个有趣的情况。
我正在尝试使用基于 Linux 的机器,通过与“全局”DHCP 服务器并行运行 DHCP 服务来允许 Mac 进行 Netboot(类似于 PXE 引导)。
本地 DHCP 服务器分发私有子网中的 IP,例如 10.168.0.10-10.168.254-254,而“全局”DHCP 服务器分发 IP 范围 10.0.0.1 - 10.0.1.254 中的 IP。
本地 DHCP 范围只应该在 Preboot Execution Environment 和 Netboot 中使用。本地 DHCP 服务器是我可以控制的,但我无权访问全局 DHCP 服务器。
我有一个过滤器,只允许具有供应商字符串“AAPLBSDPC/i386”和“PXEClient”的成员。
PXE 工作正常,但 Netboot 有一个怪癖。
尚未连接到网络的 Apple 系统可以正常启动网络。但是一旦它从全局 DHCP 服务器中获取了一个“真实的”IP 地址,它就会“保存”它并在下次我们希望它进行网络启动时请求它(本地 dhcp 服务器不会给它)。
这就是我要的:
Mar 30 10:52:28 dev01 dhcpd: DHCPDISCOVER from 34:15:xx:xx:xx:xx via eth1
Mar 30 10:52:29 dev01 dhcpd: DHCPOFFER on 10.168.222.46 to 34:15:xx:xx:xx:xx via eth1
Mar 30 10:52:31 dev01 dhcpd: DHCPREQUEST for 10.168.222.46 (10.168.0.1) from 34:15:xx:xx:xx:xx via eth1
Mar 30 10:52:31 dev01 dhcpd: DHCPACK on 10.168.222.46 to 34:15:xx:xx:xx:xx via eth1
Mar 30 10:52:32 dev01 in.tftpd[5890]: tftp: client does not accept options
Mar 30 10:52:53 dev01 in.tftpd[5891]: tftp: client does not accept options
Mar 30 10:52:53 dev01 in.tftpd[5893]: tftp: client does not accept options
Mar 30 10:52:54 dev01 in.tftpd[5895]: tftp: client does not accept options
当它已经有一个“存储的”IP时,这是我得到的:
Mar 30 10:51:29 dev01 dhcpd: DHCPDISCOVER from 00:25:xx:xx:xx:xx via eth1
Mar 30 10:51:30 dev01 dhcpd: DHCPOFFER on 10.168.222.45 to 00:25:xx:xx:xx:xx via eth1
Mar 30 10:51:31 dev01 dhcpd: DHCPREQUEST for 10.0.0.61 (10.0.0.1) from 00:25:xx:xx:xx:xx via eth1: ignored (not authoritative).
你有什么建议吗?将不胜感激。
编辑:我认为如果 DHCP 服务器在 Apple 类中,它应该对请求进行 NACK……我可以在过滤掉 Apple Netbooting 系统的类中粘贴“权威”声明吗?
[从本地 DHCP 服务器中删除 tcpdump]
我尝试用组合键来击打婴儿车,但没有奏效。它仍然在 DHCP 日志中报告相同的内容。我现在正在研究 DHCP 配置中的其他随机选项。
编辑:
有趣的是,如果我进入操作系统,关闭 en0,然后重新启动并尝试 NetBooting(因此释放 IP?)。Netboot 将从本地服务器和 Netboot 正确获取 IP。
您对为什么这样做有任何想法吗?
(我想感谢你到目前为止所做的所有努力,你真的很有帮助。)
这是通过 Netboot 客户端的镜像端口进行的端口跟踪。
图例(以防万一):
IP 地址
- 10.0.* 是全球 IP 范围 [公共 LAN]
- 10.168.* 是本地 IP 范围 [Private LAN/For Netboot/PXE]
苹果电脑
- 34:15:xx:... 是 Netboot 客户端
- 00:1e:xx:... 是本地 DHCP 服务器
- 00:24:xx:... 是全局 DHCP 服务器
当它不起作用时跟踪:
tcpdump: listening on en0, link-type EN10MB (Ethernet), capture size 65535 bytes
15:01:10.765615 34:15:xx:xx:xx:xx > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 590: (tos 0x0, ttl 16, id 163, offset 0, flags [none], proto UDP (17), length 576)
0.0.0.0.68 > 255.255.255.255.67: [udp sum ok] BOOTP/DHCP, Request from 34:15:xx:xx:xx:xx, length 548, xid 0x2b93, secs 5, Flags [none] (0x0000)
Client-Ethernet-Address 34:15:xx:xx:xx:xx
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message Option 53, length 1: Discover
Parameter-Request Option 55, length 5:
Subnet-Mask, Default-Gateway, BF, Vendor-Option
Vendor-Class
Client-ID Option 61, length 7: ether 34:15:xx:xx:xx:xx
Vendor-Class Option 60, length 28: "AAPLBSDPC/i386/MacBookPro5,3"
Vendor-Option Option 43, length 4: 2.2.1.1
END Option 255, length 0
PAD Option 0, length 0, occurs 252
15:01:10.784087 00:24:xx:xx:xx:xx > 34:15:xx:xx:xx:xx, ethertype 802.1Q (0x8100), length 346: vlan 1, p 0, ethertype IPv4, (tos 0x0, ttl 255, id 17248, offset 0, flags [none], proto UDP (17), length 328)
10.0.129.254.67 > 10.0.128.63.68: [udp sum ok] BOOTP/DHCP, Reply, length 300, xid 0x2b93, Flags [none] (0x0000)
Your-IP 10.0.128.63
Server-IP 10.0.178.10
Gateway-IP 10.0.129.254
Client-Ethernet-Address 34:15:xx:xx:xx:xx
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message Option 53, length 1: Offer
Subnet-Mask Option 1, length 4: 255.255.254.0
RN Option 58, length 4: 1296000
RB Option 59, length 4: 2268000
Lease-Time Option 51, length 4: 2592000
Server-ID Option 54, length 4: 10.0.178.10
Default-Gateway Option 3, length 4: 10.0.129.254
END Option 255, length 0
PAD Option 0, length 0, occurs 20
15:01:11.527910 00:1e:xx:xx:xx:xx > 34:15:xx:xx:xx:xx, ethertype 802.1Q (0x8100), length 416: vlan 1, p 0, ethertype IPv4, (tos 0x10, ttl 128, id 0, offset 0, flags [none], proto UDP (17), length 398)
10.168.0.1.67 > 10.168.0.11.68: [udp sum ok] BOOTP/DHCP, Reply, length 370, xid 0x2b93, secs 5, Flags [none] (0x0000)
Your-IP 10.168.0.11
Server-IP 10.168.0.1
Client-Ethernet-Address 34:15:xx:xx:xx:xx
sname "10.168.0.1"
file "macnbi-i386/booter"
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message Option 53, length 1: Offer
Server-ID Option 54, length 4: 10.168.0.1
Lease-Time Option 51, length 4: 86400
Subnet-Mask Option 1, length 4: 255.255.0.0
Default-Gateway Option 3, length 4: 10.168.0.1
RP Option 17, length 76: "http://10.0.128.1/Netboot/NetBootSP0/NetRestore.nbi/NetInstall-Restore.dmg"
Vendor-Option Option 43, length 6: 8.4.129.0.0.103
Vendor-Class Option 60, length 14: "AAPLBSDPC/i386"
END Option 255, length 0
15:01:12.865888 34:15:xx:xx:xx:xx > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 590: (tos 0x0, ttl 16, id 39430, offset 0, flags [none], proto UDP (17), length 576)
0.0.0.0.68 > 255.255.255.255.67: [udp sum ok] BOOTP/DHCP, Request from 34:15:xx:xx:xx:xx, length 548, xid 0x2b93, secs 5, Flags [none] (0x0000)
Client-Ethernet-Address 34:15:xx:xx:xx:xx
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message Option 53, length 1: Request
Parameter-Request Option 55, length 5:
Subnet-Mask, Default-Gateway, BF, Vendor-Option
Vendor-Class
Client-ID Option 61, length 7: ether 34:15:xx:xx:xx:xx
Vendor-Class Option 60, length 28: "AAPLBSDPC/i386/MacBookPro5,3"
Requested-IP Option 50, length 4: 10.0.128.63
Server-ID Option 54, length 4: 10.0.178.10
Vendor-Option Option 43, length 4: 2.2.1.1
END Option 255, length 0
PAD Option 0, length 0, occurs 240
15:01:12.868182 00:24:xx:xx:xx:xx > 34:15:xx:xx:xx:xx, ethertype 802.1Q (0x8100), length 346: vlan 1, p 0, ethertype IPv4, (tos 0x0, ttl 255, id 17251, offset 0, flags [none], proto UDP (17), length 328)
10.0.129.254.67 > 10.0.128.63.68: [udp sum ok] BOOTP/DHCP, Reply, length 300, xid 0x2b93, Flags [none] (0x0000)
Your-IP 10.0.128.63
Gateway-IP 10.0.129.254
Client-Ethernet-Address 34:15:xx:xx:xx:xx
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message Option 53, length 1: ACK
RN Option 58, length 4: 1296000
RB Option 59, length 4: 2268000
Lease-Time Option 51, length 4: 2592000
Server-ID Option 54, length 4: 10.0.178.10
Subnet-Mask Option 1, length 4: 255.255.254.0
Default-Gateway Option 3, length 4: 10.0.129.254
END Option 255, length 0
PAD Option 0, length 0, occurs 20
15:01:12.868185 34:15:xx:xx:xx:xx > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 60: Ethernet (len 6), IPv4 (len 4), Request who-has 10.0.128.63 tell 0.0.0.0, length 46
15:01:13.367995 34:15:xx:xx:xx:xx > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 60: Ethernet (len 6), IPv4 (len 4), Request who-has 10.0.128.63 tell 10.0.128.63, length 46
15:01:13.868312 34:15:xx:xx:xx:xx > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 60: Ethernet (len 6), IPv4 (len 4), Request who-has 10.0.129.254 tell 10.0.128.63, length 46
15:01:13.868854 00:24:xx:xx:xx:xx > 34:15:xx:xx:xx:xx, ethertype 802.1Q (0x8100), length 64: vlan 1, p 0, ethertype ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.0.129.254 is-at 00:24:xx:xx:xx:xx, length 46
15:01:13.868857 34:15:xx:xx:xx:xx > 00:24:xx:xx:xx:xx, ethertype IPv4 (0x0800), length 89: (tos 0x0, ttl 16, id 39236, offset 0, flags [none], proto UDP (17), length 75)
10.0.128.63.15789 > 10.168.0.1.69: [udp sum ok] 47 RRQ "macnbi-i386/booter" octet blksize 512 tsize 0
15:01:18.968010 34:15:xx:xx:xx:xx > 00:24:xx:xx:xx:xx, ethertype IPv4 (0x0800), length 89: (tos 0x0, ttl 16, id 41750, offset 0, flags [none], proto UDP (17), length 75)
10.0.128.63.15790 > 10.168.0.1.69: [udp sum ok] 47 RRQ "macnbi-i386/booter" octet blksize 512 tsize 0
15:01:24.067221 34:15:xx:xx:xx:xx > 00:24:xx:xx:xx:xx, ethertype IPv4 (0x0800), length 89: (tos 0x0, ttl 16, id 30380, offset 0, flags [none], proto UDP (17), length 75)
10.0.128.63.15791 > 10.168.0.1.69: [udp sum ok] 47 RRQ "macnbi-i386/booter" octet blksize 512 tsize 0
看起来你是对的;它确实收到了多个回复,但我不确定这是否是它没有选择一个而不是另一个的原因。
这是一个成功的网络启动尝试的 tcpdump:
tcpdump: listening on en0, link-type EN10MB (Ethernet), capture size 65535 bytes
15:31:26.287342 34:15:xx:xx:xx:xx > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 590: (tos 0x0, ttl 16, id 44354, offset 0, flags [none], proto UDP (17), length 576)
0.0.0.0.68 > 255.255.255.255.67: [udp sum ok] BOOTP/DHCP, Request from 34:15:xx:xx:xx:xx, length 548, xid 0x32cc, secs 5, Flags [none] (0x0000)
Client-Ethernet-Address 34:15:xx:xx:xx:xx
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message Option 53, length 1: Discover
Parameter-Request Option 55, length 5:
Subnet-Mask, Default-Gateway, BF, Vendor-Option
Vendor-Class
Client-ID Option 61, length 7: ether 34:15:xx:xx:xx:xx
Vendor-Class Option 60, length 28: "AAPLBSDPC/i386/MacBookPro5,3"
Vendor-Option Option 43, length 4: 2.2.1.1
END Option 255, length 0
PAD Option 0, length 0, occurs 252
15:31:26.289057 00:24:xx:xx:xx:xx > 34:15:xx:xx:xx:xx, ethertype 802.1Q (0x8100), length 64: vlan 1, p 0, ethertype IPv4, (tos 0x0, ttl 127, id 1530, offset 0, flags [none], proto ICMP (1), length 39)
10.0.178.10 > 10.0.128.63: ICMP echo request, id 512, seq 22420, length 19
15:31:26.624305 00:1e:xx:xx:xx:xx > 34:15:xx:xx:xx:xx, ethertype 802.1Q (0x8100), length 416: vlan 1, p 0, ethertype IPv4, (tos 0x10, ttl 128, id 0, offset 0, flags [none], proto UDP (17), length 398)
10.168.0.1.67 > 10.168.0.11.68: [udp sum ok] BOOTP/DHCP, Reply, length 370, xid 0x32cc, secs 5, Flags [none] (0x0000)
Your-IP 10.168.0.11
Server-IP 10.168.0.1
Client-Ethernet-Address 34:15:xx:xx:xx:xx
sname "10.168.0.1"
file "macnbi-i386/booter"
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message Option 53, length 1: Offer
Server-ID Option 54, length 4: 10.168.0.1
Lease-Time Option 51, length 4: 86400
Subnet-Mask Option 1, length 4: 255.255.0.0
Default-Gateway Option 3, length 4: 10.168.0.1
RP Option 17, length 76: "http://10.0.128.1/Netboot/NetBootSP0/NetRestore.nbi/NetInstall-Restore.dmg"
Vendor-Option Option 43, length 6: 8.4.129.0.0.103
Vendor-Class Option 60, length 14: "AAPLBSDPC/i386"
END Option 255, length 0
15:31:27.301638 00:24:xx:xx:xx:xx > 34:15:xx:xx:xx:xx, ethertype 802.1Q (0x8100), length 64: vlan 1, p 0, ethertype IPv4, (tos 0x0, ttl 127, id 1532, offset 0, flags [none], proto ICMP (1), length 39)
10.0.178.10 > 10.0.128.63: ICMP echo request, id 512, seq 22676, length 19
15:31:28.387589 34:15:xx:xx:xx:xx > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 590: (tos 0x0, ttl 16, id 29575, offset 0, flags [none], proto UDP (17), length 576)
0.0.0.0.68 > 255.255.255.255.67: [udp sum ok] BOOTP/DHCP, Request from 34:15:xx:xx:xx:xx, length 548, xid 0x32cc, secs 5, Flags [none] (0x0000)
Client-Ethernet-Address 34:15:xx:xx:xx:xx
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message Option 53, length 1: Request
Parameter-Request Option 55, length 5:
Subnet-Mask, Default-Gateway, BF, Vendor-Option
Vendor-Class
Client-ID Option 61, length 7: ether 34:15:xx:xx:xx:xx
Vendor-Class Option 60, length 28: "AAPLBSDPC/i386/MacBookPro5,3"
Requested-IP Option 50, length 4: 10.168.0.11
Server-ID Option 54, length 4: 10.168.0.1
Vendor-Option Option 43, length 4: 2.2.1.1
END Option 255, length 0
PAD Option 0, length 0, occurs 240
15:31:28.802414 00:24:xx:xx:xx:xx > 34:15:xx:xx:xx:xx, ethertype 802.1Q (0x8100), length 346: vlan 1, p 0, ethertype IPv4, (tos 0x0, ttl 255, id 19737, offset 0, flags [none], proto UDP (17), length 328)
10.0.129.254.67 > 10.0.128.63.68: [udp sum ok] BOOTP/DHCP, Reply, length 300, xid 0x32cc, Flags [none] (0x0000)
Your-IP 10.0.128.63
Server-IP 10.0.178.10
Gateway-IP 10.0.129.254
Client-Ethernet-Address 34:15:xx:xx:xx:xx
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message Option 53, length 1: Offer
Subnet-Mask Option 1, length 4: 255.255.254.0
RN Option 58, length 4: 1296000
RB Option 59, length 4: 2268000
Lease-Time Option 51, length 4: 2592000
Server-ID Option 54, length 4: 10.0.178.10
Default-Gateway Option 3, length 4: 10.0.129.254
END Option 255, length 0
PAD Option 0, length 0, occurs 20
15:31:28.899055 00:1e:xx:xx:xx:xx > 34:15:xx:xx:xx:xx, ethertype 802.1Q (0x8100), length 392: vlan 1, p 0, ethertype IPv4, (tos 0x10, ttl 128, id 0, offset 0, flags [none], proto UDP (17), length 374)
10.168.0.1.67 > 10.168.0.11.68: [udp sum ok] BOOTP/DHCP, Reply, length 346, xid 0x32cc, secs 5, Flags [none] (0x0000)
Your-IP 10.168.0.11
Server-IP 10.168.0.1
Client-Ethernet-Address 34:15:xx:xx:xx:xx
sname "10.168.0.1"
file "macnbi-i386/booter"
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message Option 53, length 1: ACK
Server-ID Option 54, length 4: 10.168.0.1
Lease-Time Option 51, length 4: 86400
Subnet-Mask Option 1, length 4: 255.255.0.0
Default-Gateway Option 3, length 4: 10.168.0.1
RP Option 17, length 76: "http://10.0.128.1/Netboot/NetBootSP0/NetRestore.nbi/NetInstall-Restore.dmg"
END Option 255, length 0
15:31:28.899058 34:15:xx:xx:xx:xx > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 60: Ethernet (len 6), IPv4 (len 4), Request who-has 10.168.0.11 tell 0.0.0.0, length 46
15:31:29.398941 34:15:xx:xx:xx:xx > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 60: Ethernet (len 6), IPv4 (len 4), Request who-has 10.168.0.11 tell 10.168.0.11, length 46
15:31:29.899254 34:15:xx:xx:xx:xx > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 60: Ethernet (len 6), IPv4 (len 4), Request who-has 10.168.0.1 tell 10.168.0.11, length 46
15:31:29.899257 00:1e:xx:xx:xx:xx > 34:15:xx:xx:xx:xx, ethertype 802.1Q (0x8100), length 64: vlan 1, p 0, ethertype ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.168.0.1 is-at 00:1e:xx:xx:xx:xx, length 46
15:31:29.899259 34:15:xx:xx:xx:xx > 00:1e:xx:xx:xx:xx, ethertype IPv4 (0x0800), length 89: (tos 0x0, ttl 16, id 38655, offset 0, flags [none], proto UDP (17), length 75)
10.168.0.11.17638 > 10.168.0.1.69: [udp sum ok] 47 RRQ "macnbi-i386/booter" octet blksize 512 tsize 0
15:31:29.899924 00:1e:xx:xx:xx:xx > 34:15:xx:xx:xx:xx, ethertype 802.1Q (0x8100), length 73: vlan 1, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 25574, offset 0, flags [DF], proto UDP (17), length 55)
10.168.0.1.43349 > 10.168.0.11.17638: [udp sum ok] UDP, length 27
15:31:29.900216 34:15:xx:xx:xx:xx > 00:1e:xx:xx:xx:xx, ethertype IPv4 (0x0800), length 60: (tos 0x0, ttl 16, id 59278, offset 0, flags [none], proto UDP (17), length 33)
10.168.0.11.17638 > 10.168.0.1.43349: [udp sum ok] UDP, length 5
15:31:34.900598 00:1e:xx:xx:xx:xx > 34:15:xx:xx:xx:xx, ethertype 802.1Q (0x8100), length 64: vlan 1, p 0, ethertype ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 10.168.0.11 tell 10.168.0.1, length 46
15:31:35.900833 00:1e:xx:xx:xx:xx > 34:15:xx:xx:xx:xx, ethertype 802.1Q (0x8100), length 64: vlan 1, p 0, ethertype ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 10.168.0.11 tell 10.168.0.1, length 46
15:31:36.901071 00:1e:xx:xx:xx:xx > 34:15:xx:xx:xx:xx, ethertype 802.1Q (0x8100), length 64: vlan 1, p 0, ethertype ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 10.168.0.11 tell 10.168.0.1, length 46
看到这个日志你有什么想法?
编辑/更新:
我刚刚添加了更多选项,因此我的本地 DHCP 选项计数为 11,而全局 DHCP 选项计数为 9。它仍然无法从我的本地 DHCP 服务器获取 IP 地址。不知道我能做什么,我不应该每次需要 NetBoot 时都释放 IP。
所以看起来它会接受第一个 DHCP 提议,是否有确保本地 DHCP 服务器首先响应?
你有什么见解可以和我们分享吗?