Advanced Lab environment - 08 Use REST API to mass create vlan, interface and virtual ip on pfsense

Опубликовано: 21 Ноябрь 2024
на канале: Tech-Junkie
283
1

Update: Script and csv can be found in below link.
https://github.com/Infinibang/Junkyar...

01:30 Enable ssh on pfsense
02:15 Install pfsense-api (by jaredhendrickson13)
04:05 Configure API to use JWT and on LAN only
05:11 API documentation page (worth reading) (but I don't like reading)
07:05 Use curl get the bearer token
09:05 Get system arp with api
10:20 Get vlan with api
10:55 Create a vlan with api

12:23 Overview of the script calls api to add vlan, vlan interface and virtual ip
15:03 The csv file for the script

18:10 Run the script (failed because of wrong password)
18:45 Run the script ( it works! )


First few lines of "pfsense-vlan.csv"
******************* pfsense-vlan.csv start *******************
,vmx1,null,1003,vmx1.1003,10.10.3.2,24,103,10.10.3.1,1,1,carp,carp-password
,vmx1,null,1004,vmx1.1004,10.10.4.2,24,104,10.10.4.1,1,1,carp,carp-password
,vmx1,null,1005,vmx1.1005,10.10.5.2,24,105,10.10.5.1,1,1,carp,carp-password
,vmx1,null,1006,vmx1.1006,10.10.6.2,24,106,10.10.6.1,1,1,carp,carp-password
******************* pfsense-vlan.csv end *******************




******************* pfsense-vlan-api.sh start *******************
Squared bracket is not allowed :(
Check comment below.
******************* pfsense-vlan-api.sh end *******************