Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 102 additions & 0 deletions controlplane/controller/internal/controller/fixtures/base.config.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
!
ip multicast-routing
!
router pim sparse-mode
ipv4
rp address 10.0.0.0 239.0.0.0/24 override
!
vrf instance vrf1
ip routing vrf vrf1
!
hardware access-list update default-result permit
!
no ip access-list MAIN-CONTROL-PLANE-ACL
ip access-list MAIN-CONTROL-PLANE-ACL
counters per-entry
10 permit icmp any any
20 permit ip any any tracked
30 permit udp any any eq bfd ttl eq 255
40 permit udp any any eq bfd-echo ttl eq 254
50 permit udp any any eq multihop-bfd micro-bfd sbfd
60 permit udp any eq sbfd any eq sbfd-initiator
70 permit ospf any any
80 permit tcp any any eq ssh telnet www snmp bgp https msdp ldp netconf-ssh gnmi
90 permit udp any any eq bootps bootpc snmp rip ntp ldp ptp-event ptp-general
100 permit tcp any any eq mlag ttl eq 255
110 permit udp any any eq mlag ttl eq 255
120 permit vrrp any any
130 permit ahp any any
140 permit pim any any
150 permit igmp any any
160 permit tcp any any range 5900 5910
170 permit tcp any any range 50000 50100
180 permit udp any any range 51000 51100
190 permit tcp any any eq 3333
200 permit tcp any any eq nat ttl eq 255
210 permit tcp any eq bgp any
220 permit rsvp any any
230 permit tcp any any eq 9340
240 permit tcp any any eq 9559
250 permit udp any any eq 8503
260 permit udp any any eq lsp-ping
270 permit udp any eq lsp-ping any

280 remark Permit TWAMP (UDP 862)
290 permit udp any any eq 862
!
system control-plane
ip access-group MAIN-CONTROL-PLANE-ACL in
!
router bgp 65342
router-id 14.14.14.14
no neighbor 12.12.12.12
neighbor 12.12.12.12 remote-as 65342
neighbor 12.12.12.12 next-hop-self
neighbor 12.12.12.12 update-source Loopback256
neighbor 12.12.12.12 description remote-dzd-ipv4
neighbor 12.12.12.12 send-community
no neighbor 15.15.15.15
neighbor 15.15.15.15 remote-as 65342
neighbor 15.15.15.15 next-hop-self
neighbor 15.15.15.15 update-source Loopback255
neighbor 15.15.15.15 description remote-dzd-vpnv4
neighbor 15.15.15.15 send-community
address-family ipv4
neighbor 12.12.12.12 activate
no neighbor 15.15.15.15 activate
!
address-family vpn-ipv4
neighbor 15.15.15.15 activate
!
vrf vrf1
rd 65342:1
route-target import vpn-ipv4 65342:1
route-target export vpn-ipv4 65342:1
router-id 7.7.7.7
!
ip community-list COMM-ALL_USERS permit 21682:1200
ip community-list COMM-ALL_MCAST_USERS permit 21682:1300
!
no ip access-list SEC-USER-PUB-MCAST-IN
ip access-list SEC-USER-PUB-MCAST-IN
counters per-entry
permit icmp any any
permit tcp any any eq bgp
permit ip any 224.0.0.13/32
permit ip any 239.0.0.0/24
deny ip any any
!
no ip access-list SEC-USER-SUB-MCAST-IN
ip access-list SEC-USER-SUB-MCAST-IN
counters per-entry
permit icmp any any
permit tcp any any eq bgp
permit ip any 224.0.0.13/32
deny ip any any
!
no router msdp
router msdp
peer 12.12.12.12
mesh-group DZ-1
local-interface Loopback256
description remote-dzd
Original file line number Diff line number Diff line change
Expand Up @@ -176,14 +176,21 @@ default interface Tunnel562
default interface Tunnel563
!
router bgp 65342
router-id 14.14.14.14
address-family ipv4
no neighbor 169.254.0.13
no neighbor 172.16.0.1
no neighbor 169.254.0.13
!
address-family vpn-ipv4
no neighbor 172.16.0.1
no neighbor 169.254.0.13
!
vrf vrf1
rd 65342:1
route-target import vpn-ipv4 65342:1
route-target export vpn-ipv4 65342:1
router-id 2.2.2.2
no neighbor 172.16.0.1
no neighbor 169.254.0.13
!
ip community-list COMM-ALL_USERS permit 21682:1200
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ default interface Tunnel562
default interface Tunnel563
!
router bgp 65342
router-id 14.14.14.14
no neighbor 169.254.0.3
neighbor 169.254.0.3 remote-as 65000
neighbor 169.254.0.3 passive
Expand All @@ -211,7 +212,12 @@ router bgp 65342
neighbor 169.254.0.3 maximum-accepted-routes 1
address-family ipv4
neighbor 169.254.0.3 activate
no neighbor 169.254.0.7
no neighbor 172.16.0.1
no neighbor 169.254.0.7
!
address-family vpn-ipv4
no neighbor 172.16.0.1
no neighbor 169.254.0.7
!
vrf vrf1
rd 65342:1
Expand All @@ -226,6 +232,7 @@ router bgp 65342
neighbor 169.254.0.1 route-map RM-USER-500-OUT out
neighbor 169.254.0.1 maximum-routes 1
neighbor 169.254.0.1 maximum-accepted-routes 1
no neighbor 172.16.0.1
no neighbor 169.254.0.7
!
ip community-list COMM-ALL_USERS permit 21682:1200
Expand Down
3 changes: 3 additions & 0 deletions controlplane/controller/internal/controller/fixtures/e2e.txt
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ default interface Tunnel562
default interface Tunnel563
!
router bgp 65342
router-id 14.14.14.14
no neighbor 169.254.0.3
neighbor 169.254.0.3 remote-as 65000
neighbor 169.254.0.3 passive
Expand All @@ -212,6 +213,8 @@ router bgp 65342
address-family ipv4
neighbor 169.254.0.3 activate
!
address-family vpn-ipv4
!
vrf vrf1
rd 65342:1
route-target import vpn-ipv4 65342:1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ interface Tunnel503
no shutdown
!
router bgp 65342
router-id 14.14.14.14
no neighbor 169.254.0.1
neighbor 169.254.0.1 remote-as 65000
neighbor 169.254.0.1 passive
Expand Down Expand Up @@ -140,6 +141,8 @@ router bgp 65342
neighbor 169.254.0.5 activate
neighbor 169.254.0.7 activate
!
address-family vpn-ipv4
!
vrf vrf1
rd 65342:1
route-target import vpn-ipv4 65342:1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ interface Tunnel502
no shutdown
!
router bgp 65342
router-id 14.14.14.14
no neighbor 169.254.0.1
neighbor 169.254.0.1 remote-as 65000
neighbor 169.254.0.1 passive
Expand Down Expand Up @@ -127,6 +128,8 @@ router bgp 65342
neighbor 169.254.0.3 activate
neighbor 169.254.0.5 activate
!
address-family vpn-ipv4
!
vrf vrf1
rd 65342:1
route-target import vpn-ipv4 65342:1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ interface Tunnel503
no shutdown
!
router bgp 65342
router-id 14.14.14.14
no neighbor 169.254.0.1
neighbor 169.254.0.1 remote-as 65000
neighbor 169.254.0.1 passive
Expand Down Expand Up @@ -135,6 +136,8 @@ router bgp 65342
neighbor 169.254.0.5 activate
neighbor 169.254.0.7 activate
!
address-family vpn-ipv4
!
vrf vrf1
rd 65342:1
route-target import vpn-ipv4 65342:1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,11 @@ interface Tunnel502
no shutdown
!
router bgp 65342
router-id 14.14.14.14
address-family ipv4
!
address-family vpn-ipv4
!
vrf vrf1
rd 65342:1
route-target import vpn-ipv4 65342:1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,12 @@ interface Tunnel502
no shutdown
!
router bgp 65342
router-id 14.14.14.14
address-family ipv4
no neighbor 169.254.0.7
no neighbor 169.254.0.7
!
address-family vpn-ipv4
no neighbor 169.254.0.7
!
vrf vrf1
rd 65342:1
Expand Down
22 changes: 18 additions & 4 deletions controlplane/controller/internal/controller/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package controller

import (
"net"

"github.com/malbeclabs/doublezero/smartcontract/sdk/go/serviceability"
)

var (
Expand All @@ -11,10 +13,15 @@ var (
)

type Device struct {
PubKey string
PublicIP net.IP
Tunnels []*Tunnel
TunnelSlots int
PubKey string
PublicIP net.IP
Vpn4vLoopbackIP net.IP
Ipv4LoopbackIP net.IP
Tunnels []*Tunnel
TunnelSlots int
Interfaces []serviceability.Interface
Vpn4vLoopbackIntfName string
Ipv4LoopbackIntfName string
}

func NewDevice(ip net.IP, publicKey string) *Device {
Expand Down Expand Up @@ -59,8 +66,15 @@ type Tunnel struct {
MulticastPublishers []net.IP
}

type BgpPeer struct {
PeerIP net.IP
PeerName string
}

type templateData struct {
Device *Device
Vpnv4BgpPeers []BgpPeer
Ipv4BgpPeers []BgpPeer
UnknownBgpPeers []net.IP
MulticastGroupBlock string
NoHardware bool
Expand Down
Loading
Loading