Created
October 7, 2019 12:39
-
-
Save syeef/2e4888c24cbe03ec5913ee09f670dfc3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Creates the External IP address within region us-east4 (you may have to just enter the command and then select option 19) | |
gcloud compute addresses create unifi-external \ | |
--region us-east4 | |
//Create the Firewall Rules required to have Unifi work | |
gcloud compute firewall-rules create "unifi-http" \ | |
--allow tcp:80,tcp:8443,tcp:8880,tcp:8843 \ | |
--description="Ports used for HTTP and HTTPS on non-standard ports https://help.ubnt.com/hc/en-us/articles/218506997-UniFi-Ports-Used" \ | |
--target-tags=unifi-server | |
gcloud compute firewall-rules create "unifi-inform" \ | |
--allow tcp:8080 \ | |
--description="Port for device and controller communication" \ | |
--target-tags=unifi-server | |
gcloud compute firewall-rules create "unifi-stun" \ | |
--allow udp:3478 \ | |
--description="Port used for STUN" \ | |
--target-tags=unifi-server | |
gcloud compute firewall-rules create "unifi-throughput" \ | |
--allow tcp:6789 \ | |
--description="Port used for UniFi mobile speed test" \ | |
--target-tags=unifi-server | |
//Create the VM | |
gcloud compute instances create unifi-controller \ | |
--machine-type f1-micro \ | |
--image-family debian-9 \ | |
--image-project debian-cloud \ | |
--boot-disk-type pd-standard \ | |
--boot-disk-size 15GB \ | |
--zone us-east4-b \ | |
--description "Unifi Controller" \ | |
--scopes=default,storage-rw \ | |
--tags unifi-server \ | |
--address unifi-external \ | |
--metadata=startup-script-url=gs://petri-unifi/startup.sh,timezone=Europe/London,dns-name=ENTER.YOUR.DOMAIN.HERE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment