假如你的DHCP服务只监听一个网卡,这个网卡绑定多个IP,比如 192.168.0.1,192.168.1.1
而想要DHCP同时可以分配2个网段的IP请求,像下面这样的配置(dhcpd.conf)
| subnet 192.168.0.0 netmask 255.255.255.0 { range 192.168.0.100 192.168.0.200 ; option routers 192.168.0.1 ; option domain-name-servers 192.168.2.1,202.112.31.58 ; } subnet 192.168.1.0 netmask 255.255.255.0 { range 192.168.1.100 192.168.2.200 ; option routers 192.168.1.1 ; option domain-name-servers 192.168.2.1,202.112.31.58 ; } |
| shared-network network_tag { ... } |
| Client Area A -----Switch -----VLAN 1-----------, Client Area B -----Switch -----VLAN 2-------- Switch ----Trunk --- DHCP Server Client Area C -----Switch -----VLAN 3-----------' |
| 1:/etc/network/interface auto eth0 iface eth0 inet static address 192.168.0.1 netmask 255.255.255.0 network 192.168.0.0 broadcast 192.168.0.255 gateway 192.168.0.254 auto eth0:0 iface eth0:0 inet static address 192.168.1.1 netmask 255.255.255.0 network 192.168.0.0 broadcast 192.168.0.255 gateway 192.168.1.254 2:/etc/dhcpd.conf default-lease-time 21600; max-lease-time 21600; option domain-name-servers 222.92.109.230,61.177.7.1,61.147.37.1; option domain-name "glfsoft.com"; shared-network network_tag { subnet 192.168.0.0 netmask 255.255.255.0 { # range 192.168.0.21 192.168.0.31; option broadcast-address 192.168.0.255; option subnet-mask 255.255.255.0; option routers 192.168.0.254; next-server 192.168.0.254; host kook { hardware ethernet 00:1A:4B:58:36:9D; fixed-address 192.168.0.9; } } subnet 192.168.1.0 netmask 255.255.255.0 { # range 192.168.1.21 192.168.1.31; option broadcast-address 192.168.1.255; option subnet-mask 255.255.255.0; option routers 192.168.1.254; next-server 192.168.1.254; host kook2 { hardware ethernet 00:E0:A0:11:BE:21; fixed-address 192.168.1.9; } } } |
最新相关文章
发表评论