diff options
author | Jonas Lindstad <jonaslindstad@gmail.com> | 2015-03-16 23:09:40 +0100 |
---|---|---|
committer | Jonas Lindstad <jonaslindstad@gmail.com> | 2015-03-16 23:09:40 +0100 |
commit | 939b606944b6892d26581bce598c66c790786de9 (patch) | |
tree | 6780dc26bd26c22ca8dce6a7832841b5f4efc37a | |
parent | 88dfb934e546d02d1f4356032e91277f9f5b94f1 (diff) |
rename + fixes
-rw-r--r-- | fap/README.md (renamed from junos-bootstrap/README.md) | 15 | ||||
-rw-r--r-- | fap/database/README.md | 111 | ||||
-rw-r--r-- | fap/database/terminal_after_first_successfull_test (renamed from junos-bootstrap/database/terminal_after_first_successfull_test) | 0 | ||||
-rw-r--r-- | fap/dhcpd/DHCP_protocol_breakdown.txt (renamed from junos-bootstrap/dhcpd/DHCP_protocol_breakdown.txt) | 0 | ||||
-rw-r--r-- | fap/dhcpd/module_craft_option.py (renamed from junos-bootstrap/dhcpd/module_craft_option.py) | 0 | ||||
-rw-r--r-- | fap/dhcpd/module_lease.py (renamed from junos-bootstrap/dhcpd/module_lease.py) | 0 | ||||
-rw-r--r-- | fap/dhcpd/server_dhcp.py (renamed from junos-bootstrap/dhcpd/server_dhcp.py) | 2 | ||||
-rw-r--r-- | fap/dhcpd/terminal.log (renamed from junos-bootstrap/dhcpd/terminal.log) | 2 | ||||
-rw-r--r-- | fap/httpd/ex2200.template | 249 | ||||
-rw-r--r-- | fap/httpd/server_http.py (renamed from junos-bootstrap/httpd/server_http.py) | 7 | ||||
-rw-r--r-- | fap/httpd/terminal.log (renamed from junos-bootstrap/httpd/terminal.log) | 4 | ||||
-rw-r--r-- | fap/proof_of_concepts/distro_during_testing.config (renamed from junos-bootstrap/proof_of_concepts/distro_during_testing.config) | 0 | ||||
-rw-r--r-- | fap/proof_of_concepts/tg15-tech82-poc1.tar.gz (renamed from junos-bootstrap/proof_of_concepts/tg15-tech82-poc1.tar.gz) | bin | 4691 -> 4691 bytes | |||
-rw-r--r-- | junos-bootstrap/database/README.md | 87 | ||||
-rw-r--r-- | junos-bootstrap/httpd/ex2200.template | 73 | ||||
-rw-r--r-- | junos-bootstrap/httpd/postgres_queries | 20 |
16 files changed, 379 insertions, 191 deletions
diff --git a/junos-bootstrap/README.md b/fap/README.md index c0c0725..af91c1b 100644 --- a/junos-bootstrap/README.md +++ b/fap/README.md @@ -1,4 +1,4 @@ -# junos-bootstrap +# FAP - Fast and Agile Provisioning Tools (DHCP daemon + HTTP daemon + DB) for managing provisioning towards a large number of factory default Juniper switches (EX2200) using ZTP (Zero Touch Protocol) over DHCP relays. @@ -9,16 +9,23 @@ Licensed under the GNU GPL, version 2. See the included COPYING file. ## Usage -Launch the python scripts for junos-bootstrap from tgmanage directory. +Launch the python scripts for fap from tgmanage directory. ### HTTPD - j@lappie:~/git/tgmanage$ sudo python3 junos-bootstrap/httpd/server_http.py + j@lappie:~/git/tgmanage$ sudo python3 fap/httpd/server_http.py Example: <a href="httpd/terminal.log">httpd/terminal.log</a> ### DHCPD - j@lappie:~/git/tgmanage$ sudo python3 junos-bootstrap/dhcpd/server_dhcp.py + j@lappie:~/git/tgmanage$ sudo python3 fap/dhcpd/server_dhcp.py Example: <a href="dhcpd/terminal.log">dhcpd/terminal.log</a> + + +# TODO +* Support for IPv6 management (in progress) +* Support for only pushing JunOS image to switch - no config (for backup switches) +* Try/catch on whole ethernet frame in DHCPD +* Timestamps on each line in log both from DHCPD and HTTPD diff --git a/fap/database/README.md b/fap/database/README.md new file mode 100644 index 0000000..e49ab91 --- /dev/null +++ b/fap/database/README.md @@ -0,0 +1,111 @@ +# Database layout + +PostgreSQL + +**Tables** +``` +bootstrap-> \dt + List of relations + Schema | Name | Type | Owner +--------+----------+-------+----------- + public | switches | table | bootstrap +``` + + +**Table structure** +``` +bootstrap=> \d switches + Table "public.switches" + Column | Type | Modifiers +-------------------+------------------------+------------------------------------------------------- + id | integer | not null default nextval('switches_id_seq'::regclass) + hostname | character varying(20) | not null + distro_name | character varying(100) | not null + distro_phy_port | character varying(100) | not null + mgmt_addr | character varying(15) | not null + mgmt_cidr | smallint | not null + mgmt_gw | character varying(15) | not null + mgmt_vlan | smallint | not null + last_config_fetch | integer | + current_mac | character varying(17) | default NULL::character varying + model | character varying(20) | + ztp_addr | character varying(15) | + ztp_cidr | smallint | + ztp_gw | character varying(15) | +Indexes: + "switches_pkey" PRIMARY KEY, btree (id) +``` + + +**Sample content in DB** +``` +bootstrap=> select * from switches; + id | hostname | distro_name | distro_phy_port | mgmt_addr | mgmt_cidr | mgmt_gw | mgmt_vlan | last_config_fetch | current_mac | model | ztp_addr | ztp_cidr | ztp_gw | traffic_vlan +----+----------+-------------+-----------------+-----------+-----------+----------+-----------+-------------------+-------------------+-------+----------+----------+--------+-------------- + 23 | e-00-2 | rs1.sector0 | ge-0/0/2 | 10.0.0.12 | 24 | 10.0.0.1 | 666 | | | | | | | 102 + 25 | e-00-4 | rs1.sector0 | ge-0/0/4 | 10.0.0.14 | 24 | 10.0.0.1 | 666 | | | | | | | 104 + 27 | e-00-6 | rs1.sector0 | ge-0/0/6 | 10.0.0.16 | 24 | 10.0.0.1 | 666 | | | | | | | 106 + 26 | e-00-5 | rs1.sector0 | ge-0/0/5 | 10.0.0.15 | 24 | 10.0.0.1 | 666 | 1426539826 | 44:f4:77:69:5e:c1 | | | | | 105 + 24 | e-00-3 | rs1.sector0 | ge-0/0/3 | 10.0.0.13 | 24 | 10.0.0.1 | 666 | 1426535091 | 44:f4:77:69:49:81 | | | | | 103 + 22 | e-00-1 | rs1.sector0 | ge-0/0/1 | 10.0.0.11 | 24 | 10.0.0.1 | 666 | 1426535243 | 44:f4:77:68:f7:c1 | | | | | 101 + 30 | e-00-9 | rs1.sector0 | ge-0/0/9 | 10.0.0.19 | 24 | 10.0.0.1 | 666 | 1426539974 | 44:f4:77:68:b5:01 | | | | | 109 + 21 | e-00-0 | rs1.sector0 | ge-0/0/0 | 10.0.0.10 | 24 | 10.0.0.1 | 666 | 1426540122 | 44:f4:77:69:4c:c1 | | | | | 100 + 28 | e-00-7 | rs1.sector0 | ge-0/0/7 | 10.0.0.17 | 24 | 10.0.0.1 | 666 | 1426540272 | 44:f4:77:69:22:41 | | | | | 107 + 29 | e-00-8 | rs1.sector0 | ge-0/0/8 | 10.0.0.18 | 24 | 10.0.0.1 | 666 | 1426540272 | 44:f4:77:69:4f:c1 | | | | | 108 +(10 rows) + +``` + + +**Connect to DB from CLI** +``` +j@lappie:~/git/tgmanage$ psql -U bootstrap -d bootstrap -W +Password for user bootstrap: +psql (9.3.5) +Type "help" for help. + +bootstrap=> +``` + + +**Sample procedure to insert content to DB** +``` +insert into switches +(hostname, distro_name, distro_phy_port, mgmt_addr, mgmt_cidr, mgmt_gw, mgmt_vlan, traffic_vlan) +values +('e-00-0', 'rs1.sector0', 'ge-0/0/0', '10.0.0.10', '24', '10.0.0.1', '666', '100'), +('e-00-1', 'rs1.sector0', 'ge-0/0/1', '10.0.0.11', '24', '10.0.0.1', '666', '101'), +('e-00-2', 'rs1.sector0', 'ge-0/0/2', '10.0.0.12', '24', '10.0.0.1', '666', '102'), +('e-00-3', 'rs1.sector0', 'ge-0/0/3', '10.0.0.13', '24', '10.0.0.1', '666', '103'), +('e-00-4', 'rs1.sector0', 'ge-0/0/4', '10.0.0.14', '24', '10.0.0.1', '666', '104'), +('e-00-5', 'rs1.sector0', 'ge-0/0/5', '10.0.0.15', '24', '10.0.0.1', '666', '105'), +('e-00-6', 'rs1.sector0', 'ge-0/0/6', '10.0.0.16', '24', '10.0.0.1', '666', '106'), +('e-00-7', 'rs1.sector0', 'ge-0/0/7', '10.0.0.17', '24', '10.0.0.1', '666', '107'), +('e-00-8', 'rs1.sector0', 'ge-0/0/8', '10.0.0.18', '24', '10.0.0.1', '666', '108'), +('e-00-9', 'rs1.sector0', 'ge-0/0/9', '10.0.0.19', '24', '10.0.0.1', '666', '109'); +``` + + + +## Detailed description of table "switches" fields: +* id: autoincreasing integer used to identify the database row +* hostname: the unique edge switchs hostname - example: edge01 +* distro_name: the distro switch hostname - example: distro01 +* distro_phy_port: The distro switch's physical port - example: ge-3/1/0 +* mgmt_addr: The management IP - will be configured under vlan set in "mgmt_vlan" - example: 10.20.30.40 +* mgmt_cidr: CIDR mask on management subnet - example: 28 +* mgmt_vlan: VLAN id at the management VLAN - example: 100 +* last_config_fetch: unix timestamp of the last time the config were fetched by the switch - example: 11041551 +* current_mac: MAC address of the edge switch - example: 0f:1f:2f:3f:4f:5f +* model: edge switch model - used to select template - example: ex2200 + + + +## TODO +ALTER TABLE bootstrap ADD mgmt_v6_cidr smallint; +ALTER TABLE bootstrap ADD mgmt_v6_addr character varying(35); +ALTER TABLE bootstrap ADD mgmt_v6_gw character varying(35); + +Rename v4 column names to follow v6 scheme + +Delete ztp_* columns diff --git a/junos-bootstrap/database/terminal_after_first_successfull_test b/fap/database/terminal_after_first_successfull_test index 68aee1c..68aee1c 100644 --- a/junos-bootstrap/database/terminal_after_first_successfull_test +++ b/fap/database/terminal_after_first_successfull_test diff --git a/junos-bootstrap/dhcpd/DHCP_protocol_breakdown.txt b/fap/dhcpd/DHCP_protocol_breakdown.txt index 5af2bf2..5af2bf2 100644 --- a/junos-bootstrap/dhcpd/DHCP_protocol_breakdown.txt +++ b/fap/dhcpd/DHCP_protocol_breakdown.txt diff --git a/junos-bootstrap/dhcpd/module_craft_option.py b/fap/dhcpd/module_craft_option.py index 35e7328..35e7328 100644 --- a/junos-bootstrap/dhcpd/module_craft_option.py +++ b/fap/dhcpd/module_craft_option.py diff --git a/junos-bootstrap/dhcpd/module_lease.py b/fap/dhcpd/module_lease.py index 306f13a..306f13a 100644 --- a/junos-bootstrap/dhcpd/module_lease.py +++ b/fap/dhcpd/module_lease.py diff --git a/junos-bootstrap/dhcpd/server_dhcp.py b/fap/dhcpd/server_dhcp.py index 8dde368..0c05505 100644 --- a/junos-bootstrap/dhcpd/server_dhcp.py +++ b/fap/dhcpd/server_dhcp.py @@ -290,7 +290,7 @@ if __name__ == "__main__": interface = b'eth0' dhcp_server_address = '10.0.100.2' # target_junos_file = '/files/jinstall-ex-2200-14.1X53-D15.2-domestic-signed.tgz' - target_junos_file = '/files/jinstall-ex-2200-12.3R6.6-domestic-signed.tgz' + target_junos_file = '/files/jinstall-ex-2200-14.1X53-D15.2-domestic-signed.tgz' # Setting up the server, and how it will communicate s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # IPv4 UDP socket diff --git a/junos-bootstrap/dhcpd/terminal.log b/fap/dhcpd/terminal.log index 3f0ca52..e865bd4 100644 --- a/junos-bootstrap/dhcpd/terminal.log +++ b/fap/dhcpd/terminal.log @@ -1,4 +1,4 @@ -j@lappie:~/git/tgmanage$ sudo python3 junos-bootstrap/dhcpd/server_dhcp.py +j@lappie:~/git/tgmanage$ sudo python3 fap/dhcpd/server_dhcp.py Starting main loop [] DHCP unicast - DHCP forwarding [40:b4:f0:cc:76:01] Parsing DHCP packet from client diff --git a/fap/httpd/ex2200.template b/fap/httpd/ex2200.template new file mode 100644 index 0000000..aa62ff2 --- /dev/null +++ b/fap/httpd/ex2200.template @@ -0,0 +1,249 @@ +system { + host-name $hostname; + auto-snapshot; + time-zone Europe/Oslo; + authentication-order [ tacplus password ]; + root-authentication { + encrypted-password "$1$v1xWD3zI$OhStP6PnpgIUO3RLtMmIJ/"; + } + name-server { + 1.1.1.1; + 2.2.2.2; + } + login { + user technet{ + uid 2000; + class super-user; + authentication { + encrypted-password "$1$v1xWD3zI$OhStP6PnpgIUO3RLtMmIJ/"; + } + } + } + services { + ssh { + root-login deny; + } + netconf { + ssh; + } + } + syslog { + user * { + any emergency; + } + file messages { + any notice; + authorization info; + } + file interactive-commands { + interactive-commands any; + } + } + ntp { + server 1.2.3.4; + server 2.3.4.5; + } +} + +chassis { + aggregated-devices { + ethernet { + device-count 1; + } + } +} + +interfaces { + interface-range edge-ports { + member-range ge-0/0/0 to ge-0/0/43; + unit 0 { + family ethernet-switching { + port-mode access; + vlan { + members deltagere; + } + } + } + } + interface-range core-ports { + member-range ge-0/0/44 to ge-0/0/47; + ether-options { + 802.3ad ae0; + } + } + ae0 { + description "Til $distro_name $distro_phy_port"; + aggregated-ether-options { + lacp { + active; + } + } + unit 0 { + family ethernet-switching { + port-mode trunk; + vlan { + members deltagere; + } + native-vlan-id mgmt; + } + } + } + vlan { + unit $mgmt_vlan { + description "MGMT L3 interface"; + family inet { + filter { + input v4-mgmt; + } + address $mgmt_addr/$mgmt_cidr; + } + family inet6 { + filter { + input v6-mgmt; + } + } + } + } +} +firewall { + family inet { + filter v4-mgmt { + term accept-noc { + from { + source-address { + 0.0.0.0/0; + } + } + then accept; + } + term accept-icmp { + from { + protocol icmp; + } + then { + accept; + } + } + term reject-all { + then { + log; + syslog; + reject; + } + } + } + } + family inet6 { + filter v6-mgmt { + term accept-noc { + from { + source-address { + ::/0; + } + } + then accept; + } + term accept-icmp { + from { + next-header icmp6; + } + then { + accept; + } + } + term reject-all { + then { + log; + syslog; + reject; + } + } + } + } +} + +ethernet-switching-options { + secure-access-port { + interface edge-ports { + no-dhcp-trusted; + } + vlan deltagere { + arp-inspection; + examine-dhcp; + examine-dhcpv6; + neighbor-discovery-inspection; + ip-source-guard; + ipv6-source-guard; + dhcp-option82; + dhcpv6-option18 { + use-option-82; + } + } + ipv6-source-guard-sessions { + max-number 128; + } + } +} + +protocols { + sflow { + sample-rate { + ingress 10000; + egress 10000; + } + collector 91.209.30.12; + interfaces edge-ports; + interfaces core-ports; + } + igmp-snooping { + vlan all { + version 3; + immediate-leave; + } + } + mld-snooping { + vlan all { + version 2; + immediate-leave; + } + } + rstp { + bridge-priority 8k; + interface edge-ports { + edge; + no-root-port; + } + } + lldp { + interface ae0.0 + } +} + +vlans { + deltagere { + vlan-id $traffic_vlan; + } + mgmt { + vlan-id $mgmt_vlan; + l3-interface vlan.$mgmt_vlan; + } +} + +routing-options { + rib inet.0 { + static { + route 0.0.0.0/0 { + next-hop $mgmt_gw; + } + } + } + rib inet6.0 { + static { + route ::/0 { + next-hop 20a0:dead::beef; + } + } + } +} + + diff --git a/junos-bootstrap/httpd/server_http.py b/fap/httpd/server_http.py index ea74dd4..bc9ceea 100644 --- a/junos-bootstrap/httpd/server_http.py +++ b/fap/httpd/server_http.py @@ -48,7 +48,7 @@ def main(): sys.exit(1) def template_get(model): - return open('junos-bootstrap/httpd/' + model + '.template').read() + return open('fap/httpd/' + model + '.template').read() def template_parse(template_src, hostname): cur.execute("SELECT * FROM switches WHERE hostname = '%s'" % hostname) @@ -61,7 +61,8 @@ def main(): 'mgmt_addr': row['mgmt_addr'], 'mgmt_cidr': row['mgmt_cidr'], 'mgmt_gw': row['mgmt_gw'], - 'mgmt_vlan': row['mgmt_vlan'] + 'mgmt_vlan': row['mgmt_vlan'], + 'traffic_vlan': row['traffic_vlan'] } cur.execute("UPDATE switches SET last_config_fetch = '%s' WHERE hostname = '%s'" % (str(time.time()).split('.')[0], hostname)) # updated DB with last config fetch conn.commit() @@ -96,7 +97,7 @@ def main(): elif '/files/' in self.path: # It seems that "http.server" escapes nastiness from the URL - ("/files/../../../root_file" => "/files/root_file") requested_file = self.path.split('/files/')[1] - files_dir = 'junos-bootstrap/httpd/files/' + files_dir = 'fap/httpd/files/' print('[%s] --> File request for "%s" in "%s"' % (self.client_address[0], requested_file, files_dir)) if os.path.isfile(files_dir + requested_file): print('[%s] --> File found' % self.client_address[0]) diff --git a/junos-bootstrap/httpd/terminal.log b/fap/httpd/terminal.log index eaf6356..bedb829 100644 --- a/junos-bootstrap/httpd/terminal.log +++ b/fap/httpd/terminal.log @@ -1,4 +1,4 @@ -j@lappie:~/git/tgmanage$ sudo python3 junos-bootstrap/httpd/server_http.py +j@lappie:~/git/tgmanage$ sudo python3 fap/httpd/server_http.py [Thu Feb 19 23:15:45 2015] Server Starts - 0.0.0.0:80 [10.0.200.101] [Fri Feb 20 00:18:25 2015] Incoming HTTP GET URI://tg-edge/e-00-1 @@ -7,7 +7,7 @@ j@lappie:~/git/tgmanage$ sudo python3 junos-bootstrap/httpd/server_http.py [10.0.200.101] --> Sending response to client [10.0.200.101] --> Success - 1437 bytes sent to client [10.0.200.101] [Fri Feb 20 00:18:26 2015] Incoming HTTP GET URI://files/jinstall-ex-2200-12.3R6.6-domestic-signed.tgz -[10.0.200.101] --> File request for "jinstall-ex-2200-12.3R6.6-domestic-signed.tgz" in "junos-bootstrap/httpd/files/" +[10.0.200.101] --> File request for "jinstall-ex-2200-12.3R6.6-domestic-signed.tgz" in "fap/httpd/files/" [10.0.200.101] --> File found [10.0.200.101] --> File transfer started [10.0.200.101] --> File transfer completed diff --git a/junos-bootstrap/proof_of_concepts/distro_during_testing.config b/fap/proof_of_concepts/distro_during_testing.config index 1b92507..1b92507 100644 --- a/junos-bootstrap/proof_of_concepts/distro_during_testing.config +++ b/fap/proof_of_concepts/distro_during_testing.config diff --git a/junos-bootstrap/proof_of_concepts/tg15-tech82-poc1.tar.gz b/fap/proof_of_concepts/tg15-tech82-poc1.tar.gz Binary files differindex 2844b59..2844b59 100644 --- a/junos-bootstrap/proof_of_concepts/tg15-tech82-poc1.tar.gz +++ b/fap/proof_of_concepts/tg15-tech82-poc1.tar.gz diff --git a/junos-bootstrap/database/README.md b/junos-bootstrap/database/README.md deleted file mode 100644 index b5a30d7..0000000 --- a/junos-bootstrap/database/README.md +++ /dev/null @@ -1,87 +0,0 @@ -# Database layout - -PostgreSQL - -**Tables** -``` -bootstrap-> \dt - List of relations - Schema | Name | Type | Owner ---------+----------+-------+----------- - public | switches | table | bootstrap -``` - - -**Table structure** -``` -bootstrap=> \d switches - Table "public.switches" - Column | Type | Modifiers --------------------+------------------------+------------------------------------------------------- - id | integer | not null default nextval('switches_id_seq'::regclass) - hostname | character varying(20) | not null - distro_name | character varying(100) | not null - distro_phy_port | character varying(100) | not null - mgmt_addr | character varying(15) | not null - mgmt_cidr | smallint | not null - mgmt_gw | character varying(15) | not null - mgmt_vlan | smallint | not null - last_config_fetch | integer | - current_mac | character varying(17) | default NULL::character varying - model | character varying(20) | - ztp_addr | character varying(15) | - ztp_cidr | smallint | - ztp_gw | character varying(15) | -Indexes: - "switches_pkey" PRIMARY KEY, btree (id) -``` - - -**Sample content in DB** -``` -bootstrap=> select * from switches; - id | hostname | distro_name | distro_phy_port | mgmt_addr | mgmt_cidr | mgmt_gw | mgmt_vlan | last_config_fetch | current_mac | model | ztp_addr | ztp_cidr | ztp_gw -----+-------------+-----------------+-----------------+------------+-----------+------------+-----------+-------------------+-------------------+-------+----------+----------+-------- - 1 | e-00-0-test | distro-test | ge-0/0/0 | 10.0.200.2 | 24 | 10.0.200.1 | 300 | | | | | | - 2 | e-00-1-test | distro-test | ge-0/0/3 | 10.0.200.3 | 24 | 10.0.200.1 | 300 | | | | | | - 3 | e-00-2-test | distro-test | ge-0/0/6 | 10.0.200.4 | 24 | 10.0.200.1 | 300 | | | | | | - 4 | e-60-0-test | distro-test | ge-0/0/9 | 10.0.200.5 | 24 | 10.0.200.1 | 300 | | | | | | - 6 | e-01-2 | distro-test-new | ge-0/0/3 | 10.0.0.32 | 24 | 10.0.0.1 | 300 | 1424311409 | | | | | - 5 | e-01-1 | distro-test-new | ge-0/0/0 | 10.0.0.31 | 24 | 10.0.0.1 | 300 | 1424311417 | AA:BB:CC:DD:EE:FF | | | | -(6 rows) -``` - - -**Connect to DB from CLI** -``` -j@lappie:~/git/tgmanage$ psql -U bootstrap -d bootstrap -W -Password for user bootstrap: -psql (9.3.5) -Type "help" for help. - -bootstrap=> -``` - - -**Sample procedure to insert content to DB** -``` -bootstrap=> insert into switches (hostname, distro_name, distro_phy_port, mgmt_addr, mgmt_cidr, mgmt_gw, mgmt_vlan) values -bootstrap-> ('e-01-1', 'distro-test-new', 'ge-0/0/0', '10.0.0.31', '24', '10.0.0.1', '300'), -bootstrap-> ('e-01-2', 'distro-test-new', 'ge-0/0/3', '10.0.0.32', '24', '10.0.0.1', '300'); -INSERT 0 2 -``` - - - -## Detailed description of table "switches" fields: -* id: autoincreasing integer used to identify the database row -* hostname: the unique edge switchs hostname - example: edge01 -* distro_name: the distro switch hostname - example: distro01 -* distro_phy_port: The distro switch's physical port - example: ge-3/1/0 -* mgmt_addr: The management IP - will be configured under vlan set in "mgmt_vlan" - example: 10.20.30.40 -* mgmt_cidr: CIDR mask on management subnet - example: 28 -* mgmt_vlan: VLAN id at the management VLAN - example: 100 -* last_config_fetch: unix timestamp of the last time the config were fetched by the switch - example: 11041551 -* current_mac: MAC address of the edge switch - example: 0f:1f:2f:3f:4f:5f -* model: edge switch model - used to select template - example: ex2200 - diff --git a/junos-bootstrap/httpd/ex2200.template b/junos-bootstrap/httpd/ex2200.template deleted file mode 100644 index b786f64..0000000 --- a/junos-bootstrap/httpd/ex2200.template +++ /dev/null @@ -1,73 +0,0 @@ -system { - host-name $hostname; - root-authentication { - encrypted-password "$1$oQTnGCDI$UZpSpT5z7uHhFvniCzY5w/"; ## SECRET-DATA - } -} -chassis { - aggregated-devices { - ethernet { - device-count 1; - } - } -} -interfaces { - ge-0/0/0 { - description ae0; - ether-options { - 802.3ad ae0; - } - } - ge-0/0/1 { - description ae0; - ether-options { - 802.3ad ae0; - } - } - ge-0/0/2 { - description ae0; - ether-options { - 802.3ad ae0; - } - } - ae0 { - description "Aggregation towards $distro_name $distro_phy_port"; - aggregated-ether-options { - minimum-links 2; - lacp { - active; - } - } - unit 0 { - family ethernet-switching { - port-mode trunk; - vlan { - members [ deltagere mgmt ]; - } - } - } - } - vlan { - unit $mgmt_vlan { - description "Management L3 interface"; - family inet { - address $mgmt_addr/$mgmt_cidr; - } - } - } -} -vlans { - deltagere { - vlan-id 200; - } - mgmt { - vlan-id $mgmt_vlan; - l3-interface vlan.$mgmt_vlan; - } -} - -routing-options { - static { - route 0.0.0.0/0 next-hop $mgmt_gw; - } -} diff --git a/junos-bootstrap/httpd/postgres_queries b/junos-bootstrap/httpd/postgres_queries deleted file mode 100644 index d7c07f2..0000000 --- a/junos-bootstrap/httpd/postgres_queries +++ /dev/null @@ -1,20 +0,0 @@ -CREATE TABLE switches ( - id serial primary key, - hostname varchar(20) NOT NULL, - distro_name varchar(100) NOT NULL, - distro_phy_port varchar(100) NOT NULL, - mgmt_addr varchar(15) NOT NULL, - mgmt_cidr smallint NOT NULL, - mgmt_gw varchar(15) NOT NULL, - mgmt_vlan smallint NOT NULL, - last_config_fetch integer default NULL, - current_mac varchar(17) default NULL -); - - - -insert into switches (hostname, distro_name, distro_phy_port, mgmt_addr, mgmt_cidr, mgmt_gw, mgmt_vlan) values -('e-00-0-test', 'distro-test', 'ge-0/0/0', '10.0.200.2', '24', '10.0.200.1', '300'), -('e-00-1-test', 'distro-test', 'ge-0/0/3', '10.0.200.3', '24', '10.0.200.1', '300'), -('e-00-2-test', 'distro-test', 'ge-0/0/6', '10.0.200.4', '24', '10.0.200.1', '300'), -('e-60-0-test', 'distro-test', 'ge-0/0/9', '10.0.200.5', '24', '10.0.200.1', '300'); |