When loading a configuration from a file, route-maps with BGP communities get mangled and updated with "replace":
# test.config
interfaces {
ethernet eth0 {
address "dhcp"
ipv6 {
address {
autoconf
}
}
}
}
policy {
route-map TEST {
rule 10 {
action "permit"
set {
community {
add 65000:1
}
large-community {
add 4200000000:100:1
}
}
}
}
}jvoss@test# load test.conf
Loading configuration from 'test.conf'
Load complete. Use 'commit' to make changes effective.
[edit]
jvoss@test# compare
+ TEST {
+ rule 10 {
+ action "permit"
+ set {
+ community {
+ replace ""
+ }
+ large-community {
+ replace ""
+ }
+ }
+ }
+ }This appears to be caused by the migration script src/migration-scripts/policy/3-to-4 deleting every rule regardless of migration state:
https://github.com/vyos/vyos-1x/blob/ac60fe7d1840b8768542ee4b3f28f46544c290f2/src/migration-scripts/policy/3-to-4#L54
Refactoring this to delete existing configuration only when migrate took action resolves the issue.
After refactor:
jvoss@test# load test.conf
Loading configuration from 'test.conf'
Load complete. Use 'commit' to make changes effective.
[edit]
jvoss@test# compare
+ TEST {
+ rule 10 {
+ action "permit"
+ set {
+ community {
+ add "65000:1"
+ }
+ large-community {
+ add "4200000000:100:1"
+ }
+ }
+ }
+ }
jvoss@test# commit
[edit]
jvoss@test#