嗨,我正在尝试将路由实例与其他名称相匹配,然后是VPLS-*基本上,任何以V*开头但不是VPLS-*的名称。
我尝试了多次不同的以下迭代,但似乎忽略了以V*开头的所有名称。
set groups ALLOW_MARTIAN_192 routing-instances <"![VPLS-*], V*"> routing-options martians 192.0.0.0/24 orlonger allow有什么帮助吗?
发布于 2019-09-11 01:45:13
我不认为这在Junos应用群正则表达式的范围内是可能的:
为了使用!运算符来否定匹配,您必须在方括号[]中指定一个字符类,但是将像VPLS-这样的字符串放入字符类中,每个字符似乎被视为逻辑或例如:V or P or L or S or -,这意味着任何包含V作为第一个字符的字符都将被匹配和排除。
奇怪的是,虽然这并不完全一致--重新排列VPLS中的字母给出了不同的结果,例如:PVLS-不匹配,但SLPV-匹配--我不明白为什么:
groups {
RI-DESCRIPTION {
routing-instances {
"<[!VPLS-*]*>" {
description "This is from an apply-group";
}
}
}
}
root# show routing-instances | display inheritance no-comments
DIFFERENT-VR {
description "This is from an apply-group";
instance-type virtual-router;
}
PVLS-2 {
instance-type virtual-router;
}
RV-1 {
description "This is from an apply-group";
instance-type virtual-router;
}
SLPV-1 {
description "This is from an apply-group";
instance-type virtual-router;
}
VPLS-1 {
instance-type vpls;
}
VPLS-2 {
instance-type vpls;
}
VREF-2 {
instance-type virtual-router;
}一种解决方案可能是在每个VPLS实例下使用set routing-instance VPLS-xxx apply-groups-except ALLOW_MARTIAN_192 --不幸的是,您必须手动这样做,因为您不能在apply-groups-except配置中使用上的匹配。
https://networkengineering.stackexchange.com/questions/61394
复制相似问题