DHCP multiple pool [SOLVED]


#1

Hi!
I’m trying to setup a dual DHCP pool on my internal ethernet adapter.
Following the vyatta documentation, I’ve found that it’s necessary to define a “vif” with an address, wich will be one of the pool’s default gateway. The thing is, I can get an IP address only when using one pool.
Ideally, I would like to use 10.0.5.0/25 and 10.0.5.128/25. Thinking this was the problem, I’m testing with 10.0.5.0/24 and 10.0.6.0/24

ethernet eth0 {
address 10.0.5.1/24
description Internal
duplex auto
hw-id 00:10:b5:9e:e0:1f
smp_affinity auto
speed auto
vif
address 10.0.6.1/24

Now for the DHCP configuration (I’m using statip mapping to be sure that my laptop can get an IP on both subnets, depending on which its registered

dhcp-server {
disabled false
global-parameters “deny unknown-clients;”
shared-network-name test1 {
authoritative enable
subnet 10.0.5.0/24 {
default-router 10.0.5.1
dns-server 192.168.100.1
lease 200
start 10.0.5.50 {
stop 10.0.5.60
}
static-mapping temp {
ip-address 10.0.5.59
mac-address 00:c0:9f:e1:7d:23
}
}
}
shared-network-name test2 {
authoritative enable
subnet 10.0.6.0/24 {
default-router 10.0.6.1
dns-server 192.168.100.1
lease 200
start 10.0.6.50 {
stop 10.0.6.60
}
static-mapping temp {
ip-address 10.0.6.50
mac-address 00:c0:9f:e1:7d:23
}
}
}
}

after many tests, It seems that I’m only able to use on network or another. Can’t get IP when both pools are defined.
Is it necessary any other thing besides defining the VIF at the internal interface.
I don’t know what else to do…
Thanks!


#2

Why do you need 2 dhcp pool?

You CAN’T have 2 on the same segment. (exception is having 2 DHCP on 2 servers that servers the same pool for redundancy purpose)

The vif statement actually create a VLAN, since your computer is not in this VLAN it cannot use that pool
Although you could setup VLAN interfaces on your machine, most Operating Systems allow it, but if you’re not (very) familiar with VLANs I would strongly advise you to NOT do so.


#3

Thank you very much for the reply. A bit after I understood why i shouldn’t use a “vif” address, as I am using the same physical network (for now).
So I managed to split my network and set 2 addresses 10.0.5.1/25 and 10.0.5.129/25. This way I can set them to be the default router on each pool. I intended to split the networks so in the near future i can ask the network guys to create another vlan. One question though…should the VIF be the same as the future created VLAN ID?
Thanks


#4

Correct the number behind the vif is the VLAN number

So if you set for example :

you will have an new interface eth1.40 that will handle incoming packet tagged for VLAN40, and packet going out this interface will be tagged for VLAN40

Note that outside the “interfaces” stanza this interface is referred as “eth1.40” and not “eth1 vif 40” (this could be confusing, especially for people used to sub interfaces).


#5

Thanks!