|
Re: Matching option agent.remote-id: msg#00384network.dhcp.isc.dhcp-server
*** From dhcp-server -- To unsubscribe, see the end of this message. *** After some trial and error I just fixed this. For those interested, the correct syntax is: if binary-to-ascii(16, 8, ":", substring (option agent.remote-id,4,5)) = "aa:b1:cc:26:30" { option routers xxx.xxx.188.1; } else { option routers xxx.xxx.191.1; } Cheers, Nicolai van der Smagt On Wed, 2003-01-29 at 14:50, Nicolai van der Smagt wrote: > *** From dhcp-server -- To unsubscribe, see the end of this message. *** > > Hello, > > We have been running a config for Cisco DSL NAS (NRP), with this bit in > it (Redhat 7.3, dhcp-3.0pl2): > > class "default-economy" { > spawn with option agent.remote-id; > lease limit 1; > } > > This works fine, each DSL line get's no more than 1 lease. > We are now adding more NAS'es, and like customers from all NAS'es to > receive a single IP address from the pool, but we like to decide what > 'option routers' to hand out based on the NAS IP address. > > Our option 82 looks like this: > > 1:1:0:0:aa:b1:cc:26:30:4:0:2b; > > where bytes 5-9 (aa:b1:cc:26:30) are unique for each NAS. We have tried > many different ways to match this, and base 'option routers' on it > (using different classes, subclasses, 'if substring' statements). This > is the last thing we tried: > > subnet xxx.xxx.128.0 netmask 255.255.128.0 { > if ( substring (option agent.remote-id,4,5) = "aa:b1:cc:26:30" ) > { > option routers xxx.xxx.188.1; > } else { > option routers xxx.xxx.191.1; > } > authoritive; > option subnet-mask 255.255.128.0; > option domain-name "x.nl"; > option domain-name-servers ns1.x.nl, ns2.x.nl; > pool { > allow members of "default-economy"; > range xxx.xxx.188.10 xxx.xxx.188.254; > range xxx.xxx.189.10 xxx.xxx.189.254; > range xxx.xxx.190.10 xxx.xxx.190.254; > range xxx.xxx.191.10 xxx.xxx.191.254; > } > } > > (Yes the subnet is a /17, we use proxyarp on the NAS'es) > > Somehow the matching never works, and the routers option in the lease is > always xxx.xxx.191.1. It's not the syntax of the 'if substring' > statement I think, as we tried this with classes as well, something like > this: > > class "test1" { > match if (same expr as above) > match option agent.remote-id > option routers xxx.xxx.188.1 > lease limit 1 > } > > class "test2" { > match if (different expression) > match option agent.remote-id > option routers xxx.xxx.191.1 > lease limit 1 > } > > subnet { > allow members of test1 > allow members of test2 > } > > In this case we got a 'no free leases' in the logfile, I think meaning > that the option agent.remote-id hadn't matched either of the classes. > > Can anyone advice what we might be doing wrong? > -- Attached file included as plaintext by Ecartis -- -- File: signature.asc -- Desc: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQA+OD0+lptd+vdAeegRAo72AJ91MIi0ZfhcgLcMy0uKU8P1ovUl7gCfVpMj rgnOlGvLw4V0e9CFgHKaRAI= =s+ir -----END PGP SIGNATURE----- ----------------------------------------------------------------------- List Archives : http://www.isc.org/ml-archives/dhcp-server/ Unsubscribe : http://www.isc.org/dhcp-lists.html -or- : mailto:dhcp-server-request@xxxxxxx?Subject=unsubscribe ----------------------------------------------------------------------- |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Out of free leases.: 00384, Keith Woodworth |
|---|---|
| Next by Date: | Re: Matching option agent.remote-id: 00384, Ted Lemon |
| Previous by Thread: | Matching option agent.remote-idi: 00384, Nicolai van der Smagt |
| Next by Thread: | Re: Matching option agent.remote-id: 00384, Ted Lemon |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |