mac 修改dhcp服务器,Mac电脑如何设置DHCP

Disabled

Label

com.apple.bootpd

Program

/usr/libexec/bootpd

ProgramArguments

/usr/libexec/bootpd

-Dv

Sockets

Listeners

SockFamily

IPv4

SockServiceName

bootps

SockType

dgram

inetdCompatibility

Wait

3)加载启动脚本命令:sudo /bin/launchctl load -w /System/Library/LaunchDaemons/bootps.plist

4)去除启动脚本命令:sudo /bin/launchctl unload -w /System/Library/LaunchDaemons/bootps.plist

设置bootpd的运行方式

1)bootpd有两个配置文件,一个是bootps.plist用于指导dhcp和bootp服务的工作方式,另一个是bootptab,用于设置地址池。(注意,此处的bootps.plist与上一个步骤的plist文件同名,但作用完全不同,前者的目的是设置开机启动bootpd程序,本文件的目地是指导bootpd程序的运行方式)

2)bootps.plist的路径:/etc/bootps.plist

3)bootps.plist配置文件内容:

Subnets

allocate

allow

8C:FA:BA:01:E6:F3

6C:FD:B9:C8:7E:2B

B8:09:8A:83:22:A3

10:dd:b1:c6:b4:37

60:92:17:A2:C2:65

E0:06:E6:1B:AE:A0

E8:8D:28:DF:13:0C

64:09:80:D8:5B:98

b8:98:f7:11:a4:79

70:72:3C:53:CE:BA

00:0a:f5:10:fb:2c

b8:98:f7:aa:1e:0d

28:b2:bd:af:07:62

68:3e:34:4c:ca:cb

9C:44:3D:1E:68:F4

A8:15:4D:F5:4A:AC

68:3e:34:4c:ca:cb

54:EE:75:27:6C:D4

dhcp_domain_name

ns1.drugsales.com

dhcp_domain_name_server

192.168.1.1

dhcp_router

192.168.1.1

lease_max

86400

lease_min

86400

name

vulcan

net_address

192.168.1.0

net_mask

255.255.255.0

net_range

192.168.1.100

192.168.1.200

bootp_enabled

detect_other_dhcp_server

1

dhcp_enabled

en0

reply_threshold_seconds

0

4)bootptab文件内容(路径也是/etc/bootptab):

%%

# machine entries have the following format:

#

# hostname hwtype hwaddr ipaddr bootfile

vulcan-macmini 1 10:dd:b1:c6:b4:37 192.168.1.2

vulcan-iphone5s160:92:17:A2:C2:65192.168.1.100

tangling-pc1E0:06:E6:1B:AE:A0192.168.1.101

tangling-iphone51E8:8D:28:DF:13:0C192.168.1.102

tangMum-xiaomi164:09:80:D8:5B:98192.168.1.103

iPad318C:FA:BA:01:E6:F3192.168.1.104

vulcan-huawei170:72:3C:53:CE:BA192.168.1.105

vulcan-u2100:0a:f5:10:fb:2c192.168.1.106

vulcan-u41b8:98:f7:aa:1e:0d192.168.1.107

vulcan-win8-wifi128:b2:bd:af:07:62192.168.1.108

vulcan-win8-eth154:EE:75:27:6C:D4192.168.1.109

mum-mobile1d0:2d:b3:8e:48:4c192.168.1.110

vulcan-meilan168:3e:34:4c:ca:cb192.168.1.111

android-tvbox19C:44:3D:1E:68:F4192.168.1.112

yangzhenxue-iphone5s1B8:09:8A:83:22:A3192.168.1.113

yangzhenxue-hasee16C:FD:B9:C8:7E:2B192.168.1.114

5)手动启动bootpd的命令:bootpd -Ddv,D表示要启动DHCP模式,d表示前台运行并把调试信息重定向到标准输出,v表示输出更加全面的调试信息。

6)使用苹果系统自带的“控制台”工具程序可以查看bootpd的运行日志。

7)bootpd的日志文件输出到/var/log/system.log文件中。

如果输出以下调试信息,恭喜你,这说明bootpd的启动是没有问题的:

Jan  4 00:05:16 bogon bootpd[3185]: server starting

Jan  4 00:05:16 bogon bootpd[3185]: re-reading /etc/bootptab

Jan  4 00:05:16 bogon bootpd[3185]: Loaded 16 entries from bootptab (0 bad)

Jan  4 00:05:16 bogon bootpd[3185]: server name bogon

Jan  4 00:05:16 bogon bootpd[3185]: interface en0: ip 192.168.1.2 mask 255.255.255.0

常见错误信息:

1.bootpd[1091]: bind call failed: Permission denied

2.bootpd[1290]: bind call failed: Address already in use,说明地址已经被绑定,很可能有bootpd的另一个实例在运行。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值