summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2022-11-04 11:33:27 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2022-11-04 11:33:27 +0000
commit666631223ac177142cd704044534b3e0874fbfff (patch)
tree3d03149eeaa7fdc0ada0f4224a0870cfa85498f0
parent654af599ebc313525ff036d22fc3aa70f63f5635 (diff)
Extend l3vpn test to insert and remove a route
Also add some scaffolding for IPv6 testing but currently IPv6 is broken because mpe(4) is unable to configure a local IPv6 address.
-rw-r--r--regress/usr.sbin/bgpd/integrationtests/bgpd.l3vpn.rdomain1.conf11
-rw-r--r--regress/usr.sbin/bgpd/integrationtests/bgpd.l3vpn.rdomain2.conf14
-rw-r--r--regress/usr.sbin/bgpd/integrationtests/l3vpn.sh29
3 files changed, 49 insertions, 5 deletions
diff --git a/regress/usr.sbin/bgpd/integrationtests/bgpd.l3vpn.rdomain1.conf b/regress/usr.sbin/bgpd/integrationtests/bgpd.l3vpn.rdomain1.conf
index b980ac9a66d..a8d3a51df46 100644
--- a/regress/usr.sbin/bgpd/integrationtests/bgpd.l3vpn.rdomain1.conf
+++ b/regress/usr.sbin/bgpd/integrationtests/bgpd.l3vpn.rdomain1.conf
@@ -5,9 +5,10 @@ log updates
vpn "RDOM13" on mpe13 {
rd 4200000001:13
- import-target rt 4200000001:44
+ import-target rt 4200000002:44
export-target rt 4200000001:42
network 192.168.42.0/24
+ network 2001:db8:42:42::/64
}
neighbor 10.12.57.2 {
@@ -18,5 +19,13 @@ neighbor 10.12.57.2 {
remote-as 4200000002
}
+neighbor 2001:db8:57::2 {
+ announce IPv6 unicast
+ announce IPv6 vpn
+
+ descr "RDOMAIN2v6"
+ remote-as 4200000002
+}
+
allow from any
allow to any
diff --git a/regress/usr.sbin/bgpd/integrationtests/bgpd.l3vpn.rdomain2.conf b/regress/usr.sbin/bgpd/integrationtests/bgpd.l3vpn.rdomain2.conf
index dce98f353c1..f532070adac 100644
--- a/regress/usr.sbin/bgpd/integrationtests/bgpd.l3vpn.rdomain2.conf
+++ b/regress/usr.sbin/bgpd/integrationtests/bgpd.l3vpn.rdomain2.conf
@@ -4,19 +4,29 @@ router-id 10.12.57.1
log updates
vpn "RDOM14" on mpe14 {
- rd 4200000001:14
+ rd 4200000002:14
import-target rt 4200000001:42
- export-target rt 4200000001:44
+ export-target rt 4200000002:44
network 192.168.44.0/24
+ network 2001:db8:42:44::/64
}
neighbor 10.12.57.1 {
announce IPv4 unicast
announce IPv4 vpn
+ announce IPv6 vpn
descr "RDOMAIN1"
remote-as 4200000001
}
+neighbor 2001:db8:57::1 {
+ announce IPv6 unicast
+ announce IPv6 vpn
+
+ descr "RDOMAIN1v6"
+ remote-as 4200000001
+}
+
allow from any
allow to any
diff --git a/regress/usr.sbin/bgpd/integrationtests/l3vpn.sh b/regress/usr.sbin/bgpd/integrationtests/l3vpn.sh
index 66752505ef1..a9a365d74e0 100644
--- a/regress/usr.sbin/bgpd/integrationtests/l3vpn.sh
+++ b/regress/usr.sbin/bgpd/integrationtests/l3vpn.sh
@@ -1,5 +1,5 @@
#!/bin/ksh
-# $OpenBSD: l3vpn.sh,v 1.1 2022/11/03 15:39:54 claudio Exp $
+# $OpenBSD: l3vpn.sh,v 1.2 2022/11/04 11:33:26 claudio Exp $
set -e
@@ -16,6 +16,8 @@ RDOMAINS="${RDOMAIN1} ${RDOMAIN2} ${RDOMAIN3} ${RDOMAIN4}"
IFACES="${PAIR1} ${PAIR2} ${MPE1} ${MPE2}"
PAIR1IP=10.12.57.1
PAIR2IP=10.12.57.2
+PAIR1IP6=2001:db8:57::1
+PAIR2IP6=2001:db8:57::2
error_notify() {
set -x
@@ -70,11 +72,16 @@ set -x
echo setup
ifconfig ${PAIR1} rdomain ${RDOMAIN1} ${PAIR1IP}/29 mpls up
ifconfig ${PAIR2} rdomain ${RDOMAIN2} ${PAIR2IP}/29 mpls up
+ifconfig ${PAIR1} inet6 ${PAIR1IP6}/64
+ifconfig ${PAIR2} inet6 ${PAIR2IP6}/64
ifconfig ${PAIR1} patch ${PAIR2}
ifconfig lo${RDOMAIN1} inet 127.0.0.1/8
ifconfig lo${RDOMAIN2} inet 127.0.0.1/8
ifconfig mpe${RDOMAIN3} rdomain ${RDOMAIN3} mplslabel 42 192.168.237.242/32
ifconfig mpe${RDOMAIN4} rdomain ${RDOMAIN4} mplslabel 44 192.168.237.244/32
+# currently mpe fails to do inet6 because it is missing multicast
+#ifconfig mpe${RDOMAIN3} inet6 2001:db8:242::242/64
+#ifconfig mpe${RDOMAIN4} inet6 2001:db8:244::244/64
ifconfig lo${RDOMAIN3} inet 127.0.0.1/8
ifconfig lo${RDOMAIN4} inet 127.0.0.1/8
@@ -87,10 +94,28 @@ route -T ${RDOMAIN2} exec ${BGPD} \
sleep 3
-echo Check setup
+echo Check initial networks
+route -T ${RDOMAIN1} exec bgpctl show
route -T ${RDOMAIN1} exec bgpctl show rib
route -T ${RDOMAIN1} exec bgpctl show fib table 13
+route -T ${RDOMAIN3} show
route -T ${RDOMAIN3} get 192.168.44/24 > /dev/null
route -T ${RDOMAIN4} get 192.168.42/24 > /dev/null
+#route -T ${RDOMAIN3} get -inet6 2001:db8:42:44::/64 > /dev/null
+#route -T ${RDOMAIN4} get -inet6 2001:db8:42:42::/64 > /dev/null
+
+echo Add new network
+route -T ${RDOMAIN2} exec bgpctl network add 192.168.45.0/24 rd 4200000002:14
+#route -T ${RDOMAIN2} exec bgpctl network add 2001:db8:42:45::/64 rd 4200000002:14
+sleep 1
+route -T ${RDOMAIN3} get 192.168.45/24 > /dev/null
+#route -T ${RDOMAIN3} get -inet6 2001:db8:42:45::/64 > /dev/null
+
+echo Remove new network
+route -T ${RDOMAIN2} exec bgpctl network del 192.168.45.0/24 rd 4200000002:14
+#route -T ${RDOMAIN2} exec bgpctl network del 2001:db8:42:45::/64 rd 4200000002:14
+sleep 1
+! route -T ${RDOMAIN3} get 192.168.45/24 > /dev/null
+#! route -T ${RDOMAIN3} get -inet6 2001:db8:42:45::/64 > /dev/null
exit 0