summaryrefslogtreecommitdiff
path: root/templates/protocols/bgp
diff options
context:
space:
mode:
authorStig Thormodsrud <stig@vyatta.com>2008-08-04 16:50:59 -0700
committerStig Thormodsrud <stig@vyatta.com>2008-08-04 16:50:59 -0700
commitd4f59395af97f25c80045c616065d58ee831d962 (patch)
treefb0e0213ec825fe08de0e7e35e72726418aaf3c2 /templates/protocols/bgp
parentc82e59744a3c5500305d5c4938b012ee7c1b0800 (diff)
downloadvyatta-cfg-quagga-d4f59395af97f25c80045c616065d58ee831d962.tar.gz
vyatta-cfg-quagga-d4f59395af97f25c80045c616065d58ee831d962.zip
Add IPv6 support to bgp cli.
Diffstat (limited to 'templates/protocols/bgp')
-rw-r--r--templates/protocols/bgp/node.tag/ipv6/aggregate-address/node.def23
-rw-r--r--templates/protocols/bgp/node.tag/ipv6/aggregate-address/node.tag/summary-only/node.def1
-rw-r--r--templates/protocols/bgp/node.tag/ipv6/network/node.def15
-rw-r--r--templates/protocols/bgp/node.tag/ipv6/node.def1
-rw-r--r--templates/protocols/bgp/node.tag/neighbor/node.def26
-rw-r--r--templates/protocols/bgp/node.tag/neighbor/node.tag/remote-as/node.def39
-rw-r--r--templates/protocols/bgp/node.tag/network/node.def30
7 files changed, 105 insertions, 30 deletions
diff --git a/templates/protocols/bgp/node.tag/ipv6/aggregate-address/node.def b/templates/protocols/bgp/node.tag/ipv6/aggregate-address/node.def
new file mode 100644
index 00000000..cb260727
--- /dev/null
+++ b/templates/protocols/bgp/node.tag/ipv6/aggregate-address/node.def
@@ -0,0 +1,23 @@
+tag:
+type: ipv6net
+help: Set a BGP IPv6 aggregate network
+comp_help:
+ <h:h:h:h:h:h:h:h/x> IPv6 aggregate network
+
+syntax:expression: exec "${vyatta_sbindir}/check_prefix_boundary $VAR(@)"
+
+delete: touch /tmp/`echo $VAR(@) | sed 's!/!!'`.$PPID
+
+end: vyatta-vtysh -n -c "configure terminal" \
+ -c "router bgp $VAR(../../@)" \
+ -c "no ipv6 bgp aggregate-address $VAR(@)";
+ if [ -f "/tmp/`echo $VAR(@) | sed 's!/!!'`.$PPID" ]; then
+ rm -rf /tmp/`echo $VAR(@) | sed 's!/!!'`.$PPID;
+ else
+ if [ -n "$VAR(./summary-only)" ]; then
+ cond="$cond summary-only";
+ fi;
+ vyatta-vtysh -c "configure terminal" \
+ -c "router bgp $VAR(../../@)" \
+ -c "ipv6 bgp aggregate-address $VAR(@) $cond";
+ fi;
diff --git a/templates/protocols/bgp/node.tag/ipv6/aggregate-address/node.tag/summary-only/node.def b/templates/protocols/bgp/node.tag/ipv6/aggregate-address/node.tag/summary-only/node.def
new file mode 100644
index 00000000..7aaf0620
--- /dev/null
+++ b/templates/protocols/bgp/node.tag/ipv6/aggregate-address/node.tag/summary-only/node.def
@@ -0,0 +1 @@
+help: Set to announce the aggregate summary network only
diff --git a/templates/protocols/bgp/node.tag/ipv6/network/node.def b/templates/protocols/bgp/node.tag/ipv6/network/node.def
new file mode 100644
index 00000000..cfe2d8a7
--- /dev/null
+++ b/templates/protocols/bgp/node.tag/ipv6/network/node.def
@@ -0,0 +1,15 @@
+multi:
+type: ipv6net
+help: Set a BGP IPv6 network
+comp_help:
+ <h:h:h:h:h:h:h:h/x> IPv6 network
+
+syntax:expression: exec "${vyatta_sbindir}/check_prefix_boundary $VAR(@)"
+
+create: vyatta-vtysh -c "configure terminal" \
+ -c "router bgp $VAR(../../@)" \
+ -c "ipv6 bgp network $VAR(@)";
+
+delete: vyatta-vtysh -c "configure terminal" \
+ -c "router bgp $VAR(../../@)" \
+ -c "no ipv6 bgp network $VAR(@)";
diff --git a/templates/protocols/bgp/node.tag/ipv6/node.def b/templates/protocols/bgp/node.tag/ipv6/node.def
new file mode 100644
index 00000000..1a8f732e
--- /dev/null
+++ b/templates/protocols/bgp/node.tag/ipv6/node.def
@@ -0,0 +1 @@
+help: Set a BGP IPv6 settings
diff --git a/templates/protocols/bgp/node.tag/neighbor/node.def b/templates/protocols/bgp/node.tag/neighbor/node.def
index 4e2e2793..2699782b 100644
--- a/templates/protocols/bgp/node.tag/neighbor/node.def
+++ b/templates/protocols/bgp/node.tag/neighbor/node.def
@@ -1,10 +1,22 @@
tag:
type: txt
help: Set a BGP neighbor
-comp_help: \1 <x.x.x.x>\tBGP neighbor IP address
-syntax:expression: exec "/opt/vyatta/sbin/vyatta-bgp.pl --check-peer-name $VAR(@)"
-update: if [ -n "`echo $VAR(@) | sed 's/[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}//'`" ]; then
- vyatta-vtysh -c "configure terminal" -c "router bgp $VAR(../@)" -c "neighbor $VAR(@) peer-group" ;
- fi ;
-delete: /opt/vyatta/sbin/vyatta-bgp.pl --check-peer-groups --peergroup $VAR(@) --as $VAR(../@);
- vyatta-vtysh -c "configure terminal" -c "router bgp $VAR(../@)" -c "no neighbor $VAR(@)"
+comp_help:
+ <x.x.x.x> BGP neighbor IP address
+ <h:h:h:h:h:h:h:h> BGP neighbor IPv6 address
+
+syntax:expression: exec "/opt/vyatta/sbin/vyatta-bgp.pl \
+ --check-peer-name $VAR(@)"
+
+update: if /opt/vyatta/sbin/vyatta-bgp.pl --check-if-peer-group \
+ --peergroup $VAR(@); then
+ vyatta-vtysh -c "configure terminal" \
+ -c "router bgp $VAR(../@)" \
+ -c "neighbor $VAR(@) peer-group";
+ fi;
+
+delete: /opt/vyatta/sbin/vyatta-bgp.pl --check-peer-groups \
+ --peergroup $VAR(@) --as $VAR(../@);
+ vyatta-vtysh -c "configure terminal" \
+ -c "router bgp $VAR(../@)" \
+ -c "no neighbor $VAR(@)"
diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/remote-as/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/remote-as/node.def
index 10b33281..0381d22b 100644
--- a/templates/protocols/bgp/node.tag/neighbor/node.tag/remote-as/node.def
+++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/remote-as/node.def
@@ -1,10 +1,33 @@
type: u32
+priority: 1
help: Set neighbor BGP AS number
-comp_help: \1 <1-4294967294>\tAS number
-syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 4294967294; "remote-as must be between 1 and 4294967294"
-update: vyatta-vtysh -c "configure terminal" -c "router bgp $VAR(../../@)" \
- -c "neighbor $VAR(../@) remote-as $VAR(@)"
-# commented out because deleting anything after remote-as will cause a failure in Quagga
-# this is a temporary fix until node ordering is enabled
-#delete: vyatta-vtysh -c "configure terminal" -c "router bgp $VAR(../../@)" \
-# -c "no neighbor $VAR(../@) remote-as $VAR(@)"
+comp_help:
+ <1-4294967294> AS number
+
+syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 4294967294; \
+ "remote-as must be between 1 and 4294967294"
+
+update: vyatta-vtysh -c "configure terminal" \
+ -c "router bgp $VAR(../../@)" \
+ -c "neighbor $VAR(../@) remote-as $VAR(@)";
+ if /opt/vyatta/sbin/vyatta-validate-type.pl -q ipv6 $VAR(../@)
+ then
+ vyatta-vtysh -c "configure terminal" \
+ -c "router bgp $VAR(../../@)" \
+ -c "no neighbor $VAR(../@) activate" \
+ -c "address-family ipv6" \
+ -c "neighbor $VAR(../@) activate";
+ fi
+
+#remote-as needs to be set 1st & deleted last - comment out for now
+#delete: vyatta-vtysh -c "configure terminal" \
+# -c "router bgp $VAR(../../@)" \
+# -c "no neighbor $VAR(../@) remote-as $VAR(@)";
+delete: if /opt/vyatta/sbin/vyatta-validate-type.pl -q ipv6 $VAR(../@)
+ then
+ vyatta-vtysh -c "configure terminal" \
+ -c "router bgp $VAR(../../@)" \
+ -c "neighbor $VAR(../@) activate" \
+ -c "address-family ipv6" \
+ -c "no neighbor $VAR(../@) activate";
+ fi
diff --git a/templates/protocols/bgp/node.tag/network/node.def b/templates/protocols/bgp/node.tag/network/node.def
index fe253baa..e263d4e3 100644
--- a/templates/protocols/bgp/node.tag/network/node.def
+++ b/templates/protocols/bgp/node.tag/network/node.def
@@ -2,27 +2,27 @@ tag:
type: ipv4net
help: Set a BGP network
comp_help: \1 <x.x.x.x/x>\tnetwork
+
syntax:expression: exec "${vyatta_sbindir}/check_prefix_boundary $VAR(@)"
+
commit:expression: !($VAR(./backdoor/) != "" && $VAR(./route-map/) != "");
"protocols bgp $VAR(../@) network $VAR(@): May specify route-map or backdoor but not both"
+
delete: touch /tmp/`echo $VAR(@) | sed 's!/!!'`.$PPID
-end: vyatta-vtysh --noerror -c "configure terminal" -c "router bgp $VAR(../@)" -c "no network $VAR(@)";
- if [ -f "/tmp/`echo $VAR(@) | sed 's!/!!'`.$PPID" ]; then
+end: vyatta-vtysh -n -c "configure terminal" \
+ -c "router bgp $VAR(../@)" \
+ -c "no network $VAR(@)";
+ if [ -f "/tmp/`echo $VAR(@) | sed 's!/!!'`.$PPID" ]; then
rm -rf /tmp/`echo $VAR(@) | sed 's!/!!'`.$PPID;
- else
- # uncomment and replace the call to vyatta-check-typeless-node.pl pending bug 2525
- #if [ -n \"$VAR(./backdoor/)\" ]; then
- # COND=\"backdoor\";
- #fi;
- ${vyatta_sbindir}/vyatta-check-typeless-node.pl "protocols bgp $VAR(../@) network $VAR(@) backdoor";
- if [ $? -eq 0 ]; then
- cond="backdoor ";
- fi ;
-
+ else
+ if [ -n "$VAR(./backdoor/)" ]; then
+ cond="backdoor";
+ fi;
if [ -n "$VAR(./route-map/@)" ]; then
cond="route-map $VAR(./route-map/@)";
fi;
-
- vyatta-vtysh -c "configure terminal" -c "router bgp $VAR(../@)" -c "network $VAR(@) $cond";
- fi;
+ vyatta-vtysh -c "configure terminal" \
+ -c "router bgp $VAR(../@)" \
+ -c "network $VAR(@) $cond";
+ fi;