r/Cisco • • 16d ago

IOS configure replace add dhcp snooping vlan issue

Hi!

Have any of you managed to use configure replace to add or remove dhcp snooping vlans without it removing active snooping entries?

The switch does a 'no ip dhcp snooping vlan <vlan list>' before setting up the new config line resulting in a loss of snooping entries for the vlans contained in the no line when doing a configure replace with a new config.

I am managing full switch configs using jinja2 templating and running configure replace via napalm.

Just want to know if anyone else have seen similar issues and fixes without using configure merge tactics?

4 Upvotes

5 comments sorted by

1

u/First-Masterpiece753 15d ago

Did u try with 26.2 latest ?

1

u/Qwiko 15d ago

Have not tried with 26.2. Just 17.15. Do you know if anything have changed in a recent version?

2

u/p1kk05 16d ago

Maybe try the dhcp snooping database feature

1

u/mohammad_abusaa 15d ago

Yeah, that’s just how configure replace works. It compares the two configs line by line, and IOS collapses all the snooping VLANs into one ip dhcp snooping vlan x,y,z line. So any change to the list turns into “remove the whole line, add the new one.” Removing it turns snooping off on those VLANs, and their bindings go with it. As far as I know, there’s no setting in configure replace that changes this.

A few ways around it:

  1. Make the line never change. Enable snooping on a fixed, wide range (e.g., ip dhcp snooping vlan 1-4094 or whatever range you’ll ever use) and keep it the same in every template. Adding or removing VLANs then doesn’t touch that line. Before you do this, check trust on your uplinks and server ports, and check option 82. Snooping inserts option 82 by default, and some upstream relays and servers drop those requests, so you may need no ip dhcp snooping information option.
  2. Render whatever the switch has now. Have the template pull the current snooping VLAN list from the device, so replace sees no difference on that line. Then add or remove VLANs with a separate ip dhcp snooping vlan 30 / no ip dhcp snooping vlan 30. Those only touch that one VLAN. I know you said no merge, but it’s only for this one line, and everything else stays full replace.
  3. Snooping database as a safety net. This is what p1kk05 suggested. Bindings get saved to flash, and you can load them back with renew ip dhcp snooping database. The catch is that it writes on a delay, so timing matters. I’d test it in a lab before relying on it.

Also, before pushing, run configure replace flash:<file> list (or show archive config differences) so you can see exactly which commands it’s going to apply. That makes these surprises easier to catch.

0

u/Crazyachmed 16d ago

Meh, I never liked the clusterfuck of the IOS (XE) config. So much guesswork... I would try to resolve the deltas with my own script and only execute ne needed commands. But, yeah, that is a lot of work.

We have gone the route of generating full configs and "copy to startup + reload"