<div dir="ltr"><div dir="ltr">Hello Gurus<div><br></div><div>I am trying to deploy a series of routers that can use DHCP to provide an IP address to the neighbouring router and once the router is reachable management software will push configuration to it.</div><div><br></div><div>All links between the routers are /31 subnets and it is possible that each router could be configured in each direction, for example if router A is up, then it will offer an address to router B, however if router B is up before A then B will offer an address to A.</div><div><br></div><div>I tried the sample subnet shown below and everything works, if I use the full giaddr in the match statement, however if I try to simplify it to match the class if the giaddr is even or odd doesn't work. My attempt on using a regex to match even/odd is commented out.</div><div><br></div><div>Does anyone have any suggestions on how I could use a different match to hand out different addresses based on if the giaddr is even or odd? Did I make a fundamental mistake in my match statement. I'm willing to use the full match, but would like to simplify if possible.</div><div><br></div><div>Thanks in advance</div><div>Steve</div><div><br></div><div><div>#test subnet</div><div>subnet 11.12.13.44 netmask 255.255.255.254 {</div><div>log(debug, concat ("giaddr: ", binary-to-ascii(10,8, ".", packet(27,1)))) ;</div><div>class "cw" {</div><div>#match if (binary-to-ascii(10,8, ".", packet(27,1)) ~~<br></div><div>#"^\d*[02468]$");</div><div>match if (binary-to-ascii(10,8, ".", packet(24,4)) =</div><div>"11.12.13.44");</div><div>}<br></div><div><br></div><div>pool</div><div>{</div><div>allow members of "cw";</div><div>range 11.12.13.45 11.12.13.45;</div><div>option routers 11.12.13.44;</div><div>option subnet-mask 255.255.255.254;</div><div>}</div><div><br></div><div>pool</div><div>{</div><div>deny members of "cw";</div><div>range 11.12.13.44 11.12.13.44;</div><div>option routers 11.12.13.45;</div><div>option subnet-mask 255.255.255.254;</div><div>}</div><div><br></div><div>}</div></div></div></div>