Linux系统中配置DHCP服务器中继代理
假设一台计算机做软路由,有三个网卡,连接3个不同的网段,192.168.1.1/24, 192.168.2.1/24,192.168.3.1/24;其中192.168.1.1/24这个网段有一个DHCP服务器,那怎么样设置可以使192.168.2.1/24和192.168.3.1/24这两个网段分配IP呢?
首先得在dhcp.conf文件中添加超级作用域:
ddns-update-style interim; ;指定DHCP支持的DNS动态更新为interim
ignore client-updates; ;指定不允许客户机更新DNS记录。
shared-network xxxdhcp { ;超级作用域名为xxxdhcp
option subnet-mask 255.255.255.0;
option domain-name-servers 192.168.1.2,192.168.1.10,192.168.4.1;
option broadcast-address 192.168.1.255;
default-lease-time 86400;
max-lease-time 172800;
}
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.21 192.168.1.49;
option routers 192.168.1.1;
host pc1 {
hardware ethernet MAC;
fixed-address 192.168.1.20;
}
}
subnet 192.168.2.0 netmask 255.255.255.0 {
range 192.168.2.21 192.168.2.49;
option routers 192.168.2.1;
host pc1 {
hardware ethernet MAC;
fixed-address 192.168.2.20;
}
}
subnet 192.168.3.0 netmask 255.255.255.0 {
range 192.168.3.21 192.168.3.49;
option routers 192.168.3.1;
host pc1 {
hardware ethernet MAC;
fixed-address 192.168.3.20;
}
}
linux下的DHCP客户端:/etc/sysconfig/network-scripts/ifcfg-eth0把BOOTPROTO="none"修改为BOOTPROTO="dhcp"
如果需要在系统启动时自动引导启动联网,/etc/sysconfig/networking下的networking=yes。
首先得在dhcp.conf文件中添加超级作用域:
ddns-update-style interim; ;指定DHCP支持的DNS动态更新为interim
ignore client-updates; ;指定不允许客户机更新DNS记录。
shared-network xxxdhcp { ;超级作用域名为xxxdhcp
option subnet-mask 255.255.255.0;
option domain-name-servers 192.168.1.2,192.168.1.10,192.168.4.1;
option broadcast-address 192.168.1.255;
default-lease-time 86400;
max-lease-time 172800;
}
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.21 192.168.1.49;
option routers 192.168.1.1;
host pc1 {
hardware ethernet MAC;
fixed-address 192.168.1.20;
}
}
subnet 192.168.2.0 netmask 255.255.255.0 {
range 192.168.2.21 192.168.2.49;
option routers 192.168.2.1;
host pc1 {
hardware ethernet MAC;
fixed-address 192.168.2.20;
}
}
subnet 192.168.3.0 netmask 255.255.255.0 {
range 192.168.3.21 192.168.3.49;
option routers 192.168.3.1;
host pc1 {
hardware ethernet MAC;
fixed-address 192.168.3.20;
}
}
linux下的DHCP客户端:/etc/sysconfig/network-scripts/ifcfg-eth0把BOOTPROTO="none"修改为BOOTPROTO="dhcp"
如果需要在系统启动时自动引导启动联网,/etc/sysconfig/networking下的networking=yes。
相关推荐
zhangzhicheng 2008-04-25
diediexiaomi 2020-08-11
thlm0 2020-06-08
wq0 2020-05-25
服务器端攻城师 2020-04-14
HHLee 2020-02-17
huangzonggui 2020-02-16
xcznb 2020-02-13
vanturman 2020-01-23
leodengzx 2020-01-06
huangzonggui 2019-12-14
huangzonggui 2019-12-06
sapliang 2019-12-06
leodengzx 2019-12-07
OwenJi 2019-12-02
thlm0 2019-11-30
thlm0 2019-11-11
agou专家书院 2019-11-08
jzhf0 2015-05-04
xcznb 2007-12-19
charthyf 2007-12-13
鹏鹏之家 2007-11-28
thone00 2007-11-14
犇骉 2007-10-26
tianshijianbing 2008-04-18
sxlongwork 2019-10-12
书弋江山 2011-02-13
amorfait 2010-11-09
xcznb 2010-10-04
勿六七 2010-08-29
wenshifang 2010-08-27
云端轻躺 2010-08-23
sdfshfh 2010-04-16
勿六七 2009-10-31