iT邦幫忙

0

single DHCP Server 配發多個網段在單一網卡上

yaojie 2013-07-05 17:45:0511383 瀏覽

各位先進 好
最近在測試 Linux DHCP Server multiple Subnets on single interface
架構如下

我在L3 SWITCH上有指定relay 192.168.3.2的DHCP Server

測試結果 VLAN 1 192.168.3.0的Client電腦可正常取得IP
VLAN 2 192.168.2.0 底下的電腦無法取得IP

Linux DHCP Server主機上設定
在即有的eth0上,新增一個eth0:0子介面,IP為192.168.2.253

dhcpd.conf設定內容如下

ddns-update-style interim;
ignore client-updates;
option domain-name-servers 168.95.1.1;
option time-offset -18000;
default-lease-time 18000;
max-lease-time 43200;

shared-network Lan-network {
        allow client-updates;
        allow unknown-clients;
        subnet 192.168.3.0 netmask 255.255.255.0 {
              range 192.168.3.100 192.168.3.200;
                }
        subnet 192.168.2.0 netmask 255.255.255.0 {
             range 192.168.2.1 192.168.2.20;
                }
        }

是不是有少了那些步驟......請有做過的先進指點一下.....

圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

2 個回答

6
macliu
iT邦研究生 5 級 ‧ 2013-07-05 20:56:17
最佳解答

你讓每一段subnet的設定都獨立我記得就可囉
shared-network vlan3 {
allow client-updates;
allow unknown-clients;
subnet 192.168.3.0 netmask 255.255.255.0 {
gateway 192.168.3.254
range 192.168.3.100 192.168.3.200;
}
}

shared-network vlan2 {
allow client-updates;
allow unknown-clients;

subnet 192.168.2.0 netmask 255.255.255.0 {
gateway 192.168.2.254
range 192.168.2.1 192.168.2.20;
}
}

用手機回答的,格式或參數不正確請見諒

4
aaa0911
iT邦研究生 4 級 ‧ 2013-07-09 08:36:48

我要發表回答

立即登入回答