From 01cf5fd4a0af1dcf25f1b5db2b6976faf6d55ce3 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Mon, 5 Nov 2018 02:17:20 +0100 Subject: T924: fix the peer-group route-map import command. --- scripts/bgp/vyatta-bgp.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/bgp/vyatta-bgp.pl b/scripts/bgp/vyatta-bgp.pl index 856d3dcd..5b443301 100755 --- a/scripts/bgp/vyatta-bgp.pl +++ b/scripts/bgp/vyatta-bgp.pl @@ -990,7 +990,7 @@ my %qcom = ( set => 'router bgp #3 ; address-family ipv4 unicast ; neighbor #5 route-map #10 out', del => 'router bgp #3 ; address-family ipv4 unicast ; no neighbor #5 route-map #10 out', }, - 'protocols bgp var peer-group var route-map import' => { + 'protocols bgp var peer-group var address-family ipv4-unicast route-map import' => { set => 'router bgp #3 ; address-family ipv4 unicast ; neighbor #5 route-map #10 in', del => 'router bgp #3 ; address-family ipv4 unicast ; no neighbor #5 route-map #10 in', }, -- cgit v1.2.3 From 4e78ba48dffad1075d0bf4bdf3ebfc7f5367eac9 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Fri, 9 Nov 2018 15:02:44 +0100 Subject: T982: move IPv4-specific soft-reconfiguration option to "address-family ipv4-unicast" and fix the vtysh commands. --- scripts/bgp/vyatta-bgp.pl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/bgp/vyatta-bgp.pl b/scripts/bgp/vyatta-bgp.pl index 5b443301..a90462ff 100755 --- a/scripts/bgp/vyatta-bgp.pl +++ b/scripts/bgp/vyatta-bgp.pl @@ -482,6 +482,14 @@ my %qcom = ( set => 'router bgp #3 ; address-family ipv4 unicast ; neighbor #5 route-server-client', del => 'router bgp #3 ; address-family ipv4 unicast ; no neighbor #5 route-server-client', }, + 'protocols bgp var neighbor var address-family ipv4-unicast soft-reconfiguration' => { + set => undef, + del => undef, + }, + 'protocols bgp var neighbor var address-family ipv4-unicast soft-reconfiguration inbound' => { + set => 'router bgp #3 ; address-family ipv4 unicast ; neighbor #5 soft-reconfiguration inbound', + del => 'router bgp #3 ; address-family ipv4 unicast ; no neighbor #5 soft-reconfiguration inbound', + }, 'protocols bgp var neighbor var remote-as' => { set => 'router bgp #3 ; neighbor #5 remote-as #7 ; neighbor #5 activate', del => 'router bgp #3 ; no neighbor #5 remote-as #7', @@ -547,14 +555,6 @@ my %qcom = ( set => 'router bgp #3 ; neighbor #5 shutdown', del => 'router bgp #3 ; no neighbor #5 shutdown', }, - 'protocols bgp var neighbor var soft-reconfiguration' => { - set => undef, - del => undef, - }, - 'protocols bgp var neighbor var soft-reconfiguration inbound' => { - set => 'router bgp #3 ; neighbor #5 soft-reconfiguration inbound', - del => 'router bgp #3 ; no neighbor #5 soft-reconfiguration inbound', - }, 'protocols bgp var neighbor var strict-capability-match' => { set => 'router bgp #3 ; neighbor #5 strict-capability-match', del => 'router bgp #3 ; no neighbor #5 strict-capability-match', -- cgit v1.2.3 From f9333394d44924d7776b3baf26ac1885d139f61d Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Sun, 11 Nov 2018 10:32:37 +0100 Subject: T968: correct the hash for the IPv4 prefix-list commands. --- scripts/bgp/vyatta-bgp.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/bgp/vyatta-bgp.pl b/scripts/bgp/vyatta-bgp.pl index a90462ff..31f97dea 100755 --- a/scripts/bgp/vyatta-bgp.pl +++ b/scripts/bgp/vyatta-bgp.pl @@ -446,11 +446,11 @@ my %qcom = ( set => 'router bgp #3 ; address-family ipv4 unicast ; neighbor #5 next-hop-self', del => 'router bgp #3 ; address-family ipv4 unicast ; no neighbor #5 next-hop-self', }, - 'protocols bgp var neighbor var prefix-list' => { + 'protocols bgp var neighbor var address-family ipv4-unicast prefix-list' => { set => undef, del => undef, }, - 'protocols bgp var neighbor address-family ipv4-unicast var prefix-list export' => { + 'protocols bgp var neighbor var address-family ipv4-unicast prefix-list export' => { set => 'router bgp #3 ; address-family ipv4 unicast ; neighbor #5 prefix-list #10 out', del => 'router bgp #3 ; address-family ipv4 unicast ; no neighbor #5 prefix-list #10 out', }, -- cgit v1.2.3 From 6480b0036050ce669bfd5de2e8b709dd0c0cfdba Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Sun, 11 Nov 2018 16:49:45 +0100 Subject: T964: update commands for community lists. --- scripts/policy/vyatta-policy.pl | 19 ++++++++++--------- templates/policy/community-list/node.def | 10 +--------- .../node.tag/rule/node.tag/regex/node.def | 10 +--------- .../large-community-list/node.tag/rule/node.def | 4 ++-- 4 files changed, 14 insertions(+), 29 deletions(-) diff --git a/scripts/policy/vyatta-policy.pl b/scripts/policy/vyatta-policy.pl index c5e781ba..7d3edb58 100755 --- a/scripts/policy/vyatta-policy.pl +++ b/scripts/policy/vyatta-policy.pl @@ -49,6 +49,7 @@ sub check_peer_syntax { sub is_community_list { my $list = shift; + # Migration to the new syntax blocked by FRR #3308 my $count = `$VTYSH -c \"show ip community-list $list\" | grep -c $list`; if ( $count > 0 ) { return 1; @@ -61,7 +62,7 @@ sub is_community_list { sub is_extcommunity_list { my $list = shift; - my $count = `$VTYSH -c \"show ip extcommunity-list $list\" | grep -c $list`; + my $count = `$VTYSH -c \"show bgp extcommunity-list $list\" | grep -c $list`; if ( $count > 0 ) { return 1; } @@ -78,10 +79,10 @@ sub update_ext_community_list { # remove the old rules if ( is_extcommunity_list($name) ) { - my $clist = `$VTYSH -c \"show ip extcommunity-list $name\" | grep -v \"expanded list $name\"`; + my $clist = `$VTYSH -c \"show bgp extcommunity-list $name\" | grep -v \"expanded list $name\"`; my @oldrules = split(/\n/, $clist); foreach my $oldrule (@oldrules) { - system("$VTYSH -c \"conf t\" -c \"no ip extcommunity-list expanded $name $oldrule\""); + system("$VTYSH -c \"conf t\" -c \"no bgp extcommunity-list expanded $name $oldrule\""); } } @@ -102,7 +103,7 @@ sub update_ext_community_list { if (!($regex =~ /(.*):(.*)/) and (isIpAddress($1)or($1=~/^\d+$/) ) and ($2=~/^\d+$/)) { die "extcommunity-list $name rule $rule: Malformed extcommunity-list regex"; } - system("$VTYSH -c \"conf t\" -c \"ip extcommunity-list expanded $name $action $regex\""); + system("$VTYSH -c \"conf t\" -c \"bgp extcommunity-list expanded $name $action $regex\""); } exit(0); @@ -119,7 +120,7 @@ sub update_community_list { my $clist = `$VTYSH -c \"show ip community-list $num\" | grep -v \"access list $num\"`; my @oldrules = split(/\n/, $clist); foreach my $oldrule (@oldrules) { - system("$VTYSH -c \"conf t\" -c \"no ip community-list $num $oldrule\""); + system("$VTYSH -c \"conf t\" -c \"no bgp community-list expanded $num $oldrule\""); } } @@ -140,7 +141,7 @@ sub update_community_list { unless $regex; system( -"$VTYSH -c \"configure terminal\" -c \"ip community-list $num $action $regex\" " +"$VTYSH -c \"configure terminal\" -c \"bgp community-list expanded $num $action $regex\" " ); } @@ -151,7 +152,7 @@ sub is_as_path_list { my $list = shift; my $count = - `$VTYSH -c \"show ip as-path-access-list $list\" | grep -c $list`; + `$VTYSH -c \"show bgp as-path-access-list $list\" | grep -c $list`; if ( $count > 0 ) { return 1; } @@ -168,7 +169,7 @@ sub update_as_path { # remove the old rule if ( is_as_path_list($word) ) { system( -"$VTYSH -c \"configure terminal\" -c \"no ip as-path access-list $word\" " +"$VTYSH -c \"configure terminal\" -c \"no bgp as-path access-list $word\" " ); } @@ -188,7 +189,7 @@ sub update_as_path { unless $regex; system( -"$VTYSH -c \"configure terminal\" -c \"ip as-path access-list $word $action $regex\" " +"$VTYSH -c \"configure terminal\" -c \"bgp as-path access-list $word $action $regex\" " ); } diff --git a/templates/policy/community-list/node.def b/templates/policy/community-list/node.def index 5d4dc0bb..af96bbe0 100644 --- a/templates/policy/community-list/node.def +++ b/templates/policy/community-list/node.def @@ -1,14 +1,6 @@ tag: priority: 470 -type: u32 +type: txt help: Border Gateway Protocol (BGP) community-list filter -syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 500; " -community-list must be - <1-99>\tBGP community list (standard) - <100-500>\tBGP community list (expanded) " - -val_help: u32:1-99; BGP community list (standard) -val_help: u32:100-500; BGP community list (expanded) - end: /opt/vyatta/sbin/vyatta-policy.pl --update-community-list $VAR(@) diff --git a/templates/policy/community-list/node.tag/rule/node.tag/regex/node.def b/templates/policy/community-list/node.tag/rule/node.tag/regex/node.def index 8d903b33..48943dcd 100644 --- a/templates/policy/community-list/node.tag/rule/node.tag/regex/node.def +++ b/templates/policy/community-list/node.tag/rule/node.tag/regex/node.def @@ -1,13 +1,5 @@ type: txt help: Regular expression to match against a community list -val_help: Community list regular expression - -syntax:expression: exec " \ -if [ $VAR(../../@) -ge 1 ] && [ $VAR(../../@) -le 99 ]; then \ - if [ -n \"`echo $VAR(@) | sed 's/[0-9]*:[0-9]*//g' | sed -e 's/internet//g' -e 's/local-AS//g' -e 's/no-advertise//g' -e 's/no-export//g'`\" ]; then \ - echo regex $VAR(@) is invalid for a standard community list; \ - exit 1 ; \ - fi ; \ -fi ; " +val_help: Community list regular expression or one of: internet, local-AS, no-advertise, no-export commit:expression: $VAR(../action/@) != ""; "You must specify an action" diff --git a/templates/policy/large-community-list/node.tag/rule/node.def b/templates/policy/large-community-list/node.tag/rule/node.def index cdea7e30..6cb593b7 100644 --- a/templates/policy/large-community-list/node.tag/rule/node.def +++ b/templates/policy/large-community-list/node.tag/rule/node.def @@ -13,8 +13,8 @@ end: if cli-shell-api existsActive policy large-community-list $VAR(../@) rule $VAR(@); then orig_action=$(cli-shell-api returnActiveValue policy large-community-list $VAR(../@) rule $VAR(@) action) orig_regex=$(cli-shell-api returnActiveValue policy large-community-list $VAR(../@) rule $VAR(@) regex) - vtysh -c "configure terminal" -c "no ip large-community-list expanded $VAR(../@) $orig_action $VAR(@) regex $orig_regex" + vtysh -c "configure terminal" -c "no bgp large-community-list expanded $VAR(../@) $orig_action $VAR(@) regex $orig_regex" fi if [[ ${COMMIT_ACTION} != 'DELETE' ]]; then - vtysh -c "configure terminal" -c "ip large-community-list expanded $VAR(../@) $VAR(./action/@) $VAR(@) regex $VAR(./regex/@)" + vtysh -c "configure terminal" -c "bgp large-community-list expanded $VAR(../@) $VAR(./action/@) $VAR(@) regex $VAR(./regex/@)" fi -- cgit v1.2.3