当前位置: 技术问答>linux和unix
Linux DHCP如何绑定指定的网卡???
来源: 互联网 发布时间:2016-05-31
本文导语: 我的服务器上有4个网卡,其中: eth0 --> 从别的DHCP动态获取IP eth1 --> 固定IP(40.40.1.1/255.255.0.0) 分配IP段:40.40.1.1 ~ 40.40.10.254 eth2 --> 固定IP(40.40.11.1/255.255.0.0)分配IP段:40.40.11.1 ~ 40.40.20.254 eth3 --> 固...
我的服务器上有4个网卡,其中:
eth0 --> 从别的DHCP动态获取IP
eth1 --> 固定IP(40.40.1.1/255.255.0.0) 分配IP段:40.40.1.1 ~ 40.40.10.254
eth2 --> 固定IP(40.40.11.1/255.255.0.0)分配IP段:40.40.11.1 ~ 40.40.20.254
eth3 --> 固定IP(40.40.21.1/255.255.0.0)分配IP段:40.40.21.1 ~ 40.40.30.254
如何将DHCP绑定到eth1,eth2,eth3这三张网卡上?
dhcpd.conf里面这样写可以吗?
......
share-network
{
subnet 40.40.0.0 netmask 255.255.0.0
{
range 40.40.11.1 40.40.10.254;
......
}
subnet 40.40.0.0 netmask 255.255.0.0
{
range 40.40.11.1 40.40.20.254;
......
}
subnet 40.40.0.0 netmask 255.255.0.0
{
range 40.40.21.1 40.40.30.254;
......
}
}
eth0 --> 从别的DHCP动态获取IP
eth1 --> 固定IP(40.40.1.1/255.255.0.0) 分配IP段:40.40.1.1 ~ 40.40.10.254
eth2 --> 固定IP(40.40.11.1/255.255.0.0)分配IP段:40.40.11.1 ~ 40.40.20.254
eth3 --> 固定IP(40.40.21.1/255.255.0.0)分配IP段:40.40.21.1 ~ 40.40.30.254
如何将DHCP绑定到eth1,eth2,eth3这三张网卡上?
dhcpd.conf里面这样写可以吗?
......
share-network
{
subnet 40.40.0.0 netmask 255.255.0.0
{
range 40.40.11.1 40.40.10.254;
......
}
subnet 40.40.0.0 netmask 255.255.0.0
{
range 40.40.11.1 40.40.20.254;
......
}
subnet 40.40.0.0 netmask 255.255.0.0
{
range 40.40.21.1 40.40.30.254;
......
}
}
|
subnet 192.168.1.0 netmask 255.255.255.0 {
option routers 192.168.1.254;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.255;
option domain-name-servers 192.168.1.3;
option domain-name "www.cao.com"; #DNS名称#
option domain-name-servers 192.168.1.3;
option time-offset -18000;
range dynamic-bootp 192.168.1.128 192.168.1.255;
default-lease-time 21600;
max-lease-time 43200;
host ns {
hardware ethernet 52:54:AB:34:5B:09;#运行DHCP的网络接口的MAC地址#
fixed-address 192.168.1.9;
}
option routers 192.168.1.254;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.255;
option domain-name-servers 192.168.1.3;
option domain-name "www.cao.com"; #DNS名称#
option domain-name-servers 192.168.1.3;
option time-offset -18000;
range dynamic-bootp 192.168.1.128 192.168.1.255;
default-lease-time 21600;
max-lease-time 43200;
host ns {
hardware ethernet 52:54:AB:34:5B:09;#运行DHCP的网络接口的MAC地址#
fixed-address 192.168.1.9;
}
|
你都是同一个网段,那是没有用的...
route 的时候怎么办....
貌似必须不同网段才行啊...
如果是不同网段,你只需做三步
1、设置每个网卡的 IP
2、配置 dhcp,分配每个网段的 pool
3、启动 dhcp 服务