diff options
6 files changed, 22 insertions, 9 deletions
diff --git a/interface-templates/ip/source-validation/node.def b/interface-templates/ip/source-validation/node.def index 036bf0c2..3ddb6aa5 100644 --- a/interface-templates/ip/source-validation/node.def +++ b/interface-templates/ip/source-validation/node.def @@ -3,8 +3,8 @@ # The max value from conf/{all,interface}/rp_filter is used # when doing source validation on the {interface}. -priority: 500 type: txt + help: Policy for source validation by reversed path, as specified in RFC3704 val_help: strict; Enable Strict Reverse Path Forwarding as defined in RFC3704 @@ -33,8 +33,12 @@ update: fi echo "Global value is $global" fi - sudo sh -c "echo $new > \ - /proc/sys/net/ipv4/conf/$IFNAME/rp_filter" + if [ -d /sys/class/net/$VAR(../@) ] ; then + sudo sh -c "echo $new > \ + /proc/sys/net/ipv4/conf/$IFNAME/rp_filter" + fi delete: - sudo sh -c "echo 0 > /proc/sys/net/ipv4/conf/$IFNAME/rp_filter" + if [ -d /sys/class/net/$VAR(../@) ] ; then + sudo sh -c "echo 0 > /proc/sys/net/ipv4/conf/$IFNAME/rp_filter" + fi diff --git a/scripts/bgp/vyatta-bgp.pl b/scripts/bgp/vyatta-bgp.pl index f475995f..1fc1e3c1 100755 --- a/scripts/bgp/vyatta-bgp.pl +++ b/scripts/bgp/vyatta-bgp.pl @@ -315,6 +315,10 @@ my %qcom = ( set => 'router bgp #3 ; neighbor #5 allowas-in #8', del => 'router bgp #3 ; no neighbor #5 allowas-in ; neighbor #5 allowas-in', }, + 'protocols bgp var neighbor var as-override' => { + set => 'router bgp #3 ; neighbor #5 as-override', + del => 'router bgp #3 ; no neighbor #5 as-override', + }, 'protocols bgp var neighbor var attribute-unchanged' => { set => 'router bgp #3 ; no neighbor #5 attribute-unchanged ; neighbor #5 attribute-unchanged ?as-path ?med ?next-hop', del => 'router bgp #3 ; no neighbor #5 attribute-unchanged ?as-path ?med ?next-hop', diff --git a/templates/policy/prefix-list/node.tag/rule/node.def b/templates/policy/prefix-list/node.tag/rule/node.def index 03692419..edc2db07 100644 --- a/templates/policy/prefix-list/node.tag/rule/node.def +++ b/templates/policy/prefix-list/node.tag/rule/node.def @@ -37,7 +37,9 @@ end: len=`echo $VAR(./prefix/@) | awk -F/ '{ print $2 }'` ; if [ -f "/tmp/protocols-$VAR(../@)-$VAR(@).$PPID" ]; then rm -f "protocols-$VAR(../@)-$VAR(@).$PPID" ; else - vtysh -c "configure terminal" \ - -c "ip prefix-list $VAR(../@) seq $VAR(@) $VAR(./action/@) $VAR(./prefix/@) $cond " ; + if ! vtysh -c "configure terminal" \ + -c "ip prefix-list $VAR(../@) seq $VAR(@) $VAR(./action/@) $VAR(./prefix/@) $cond " ; then + exit 1 ; + fi; fi ; exit 0 ; diff --git a/templates/policy/prefix-list6/node.tag/rule/node.def b/templates/policy/prefix-list6/node.tag/rule/node.def index 2f73ebc3..b5c2aed5 100644 --- a/templates/policy/prefix-list6/node.tag/rule/node.def +++ b/templates/policy/prefix-list6/node.tag/rule/node.def @@ -36,7 +36,9 @@ end: len=`echo $VAR(./prefix/@) | awk -F/ '{ print $2 }'` ; fi; if [ ${COMMIT_ACTION} = 'SET' -o ${COMMIT_ACTION} = 'ACTIVE' ]; then - vtysh -c "configure terminal" \ - -c "ipv6 prefix-list $VAR(../@) seq $VAR(@) $VAR(./action/@) $VAR(./prefix/@) $cond " ; + if ! vtysh -c "configure terminal" \ + -c "ipv6 prefix-list $VAR(../@) seq $VAR(@) $VAR(./action/@) $VAR(./prefix/@) $cond " ; then + exit 1 ; + fi; fi; exit 0 ; diff --git a/templates/policy/route-map/node.tag/rule/node.tag/match/metric/node.def b/templates/policy/route-map/node.tag/rule/node.tag/match/metric/node.def index 7f99c2c7..fd14bb6f 100644 --- a/templates/policy/route-map/node.tag/rule/node.tag/match/metric/node.def +++ b/templates/policy/route-map/node.tag/rule/node.tag/match/metric/node.def @@ -1,6 +1,6 @@ type: u32 help: Metric of route to match -val_help: u32:1-65535; Rrute metric +val_help: u32:1-65535; Route metric syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 65535; "metric must be between 1 and 65535" commit:expression: $VAR(../../action/) != ""; "you must specify an action" diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/as-override/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/as-override/node.def new file mode 100644 index 00000000..7f67513e --- /dev/null +++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/as-override/node.def @@ -0,0 +1 @@ +help: AS for routes sent to this neighbor to be the local AS |