-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathnetwizard.sh
60 lines (47 loc) · 1.13 KB
/
netwizard.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/zsh
#######################################################
# MVP for an Azure Networking Wizard
# This file contains sh functions to:
# - Define IP address space (IPAM for the poor man)
# - Create regions (hub VNets)
# - Create spokes
# - Create subnets in those spokes
# - Create network segmentation (AzFW/NSG)
# - Inspect network segmentation logs (AzFW/flowlogs)
#
# Usage:
# source ./netwizard.sh
#
# You can then use the functions defined here
#######################################################
# IPAM
onprem_range=10.128.0.0/9
azure_range=10.0.0.0/9
region_size=16
hub_size=22
spoke_size=24
# Control variables
rg=netwizard
create_bastion=no
create_fw=yes
create_vpngw=no
create_ergw=no
##################
# IPAM functions #
##################
# Get the next free block for a new region
function get_next_region_prefix {
}
# Get the next prefix for a hub
function get_next_hub_prefix {
}
# Get the next ID for a region (starting with 0)
function get_next_region_id {
}
####################
# Region functions #
####################
# Creates a new region
function create_region {
region_id=$(get_next_region_id)
}