|
|
前几天用iptables作了个共享感觉还不错.但是单位有30多台电脑一台台指定ip地址也麻烦,于是开始想作个dhcp,那想到几天没有成功,后来在论坛上看见一个兄弟的dhcp.conf,他说他的这个配置也不能启动.一时抓狂,把他的cp过来居然启动成功,狂喜,现在贴出来让菜鸟们也来cp,老鸟莫笑,
我的配置是:eth0:192.168.0.1接adsl eth1:192.168.0.2接hub.操作系统redhat 9
ddns-update-style interim;
ignore client-updates;
subnet 192.168.0.0 netmask 255.255.255.0 { #网段和掩码,这个括号千万要有
option routers 192.168.0.1; #默认路由如果没有请添加:route add -host 255.255.255.255 dev eth1
option subnet-mask 255.255.255.0; #这句用途我也不懂
# option nis-domain "domain.org";
option domain-name "domain.org"; #生搬硬套居然能用
option domain-name-servers 202.98.160.68; #我所在城市电信的dns.填上你的.可不能生搬硬套
option broadcast-address 192.168.0.255; #广播地址
# option time-offset -18000;
range 192.168.0.100 192.168.0.150; #分配的地址范围
default-lease-time 21600; #申请的时间
max-lease-time 43200;
} #这个括号千万要有,不然会报"semicolon expected"错误
哈哈到这里保存吧,启动看看
winxp下ipconfig /renew
Ethernet adapter 本地连接:
Connection-specific DNS Suffix . : domain.org
Description . . . . . . . . . . . : Realtek RTL8139 Family PCI Fast Ethe
rnet NIC
Physical Address. . . . . . . . . : 00-D0-F8-0B-D1-C9
Dhcp Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
IP Address. . . . . . . . . . . . : 192.168.0.150
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.0.1
DHCP Server . . . . . . . . . . . : 192.168.0.2
DNS Servers . . . . . . . . . . . : 202.98.160.68
Lease Obtained. . . . . . . . . . : 2005年4月17日 17:16:48
Lease Expires . . . . . . . . . . : 2005年4月17日 23:16:48 |
|