Skip to content

Instantly share code, notes, and snippets.

View andreaswasita's full-sized avatar

Andreas Wasita andreaswasita

View GitHub Profile
Set-AzureSubnetRouteTable -VirtualNetworkName USVNET `
-SubnetName Azure-Backend `
-RouteTableName NGFWRouteTable
Get-AzureRouteTable NGFWRouteTable `
|Set-AzureRoute -RouteName NGRoute -AddressPrefix 0.0.0.0/0 `
-NextHopType VirtualAppliance `
-NextHopIpAddress 192.168.0.54
New-AzureRouteTable -Name NGFWRouteTable `
-Location "West US" `
-Label "Route table for 0.0.0.0/0 Barracuda NG FW"
Get-AzureVM -ServiceName azusfw01 -Name azusfw01 | Set-AzureIPForwarding -NetworkInterfaceName Ethernet1 -Enable -verbose
Get-AzureVM -ServiceName azusfw01 -Name azusfw01 | Set-AzureIPForwarding -NetworkInterfaceName Ethernet2 -Enable -verbose
Get-AzureVM -ServiceName azusfw01 -Name azusfw01 | Set-AzureIPForwarding -Enable
#Your Azure Subscription and Storage Account Details
$subscription = Read-Host -Prompt 'Microsoft Azure Subscription:'
$storage = Read-Host -Prompt 'Storage Account Name:'
#Set Azure Subscription and Storage
Set-azuresubscription -SubscriptionName $subscription -CurrentStorageAccountName $storage
#Barracuda Image - Check whether the image still valid using Get-AzureVMimage
$image = Get-AzureVMImage `
-ImageName "810d5f35ce8748c686feabed1344911c__BarracudaNGFirewall-6.1.1-075-byol"
#Import Azure and ExpressRoute Module
Import-Module 'C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ServiceManagement\Azure\Azure.psd1'
Import-Module 'C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ServiceManagement\Azure\ExpressRoute\ExpressRoute.psd1'
#Creating a new circuit
$Bandwidth = 200
$CircuitName = "EquinixPublic"
$ServiceProvider = "Equinix"
$Location = "Sydney"
#Setting up a bgp session
$ServiceKey = "YourServiceKey"
$PriSN = "192.168.1.4/30"
$SecSN = "192.168.2.4/30"
#You can use Public ASN you own or Private ASN Greater than 65000
$ASN = "YourASN"
$VLAN = "101"
#Create a new bgp peering session
New-AzureBGPPeering -ServiceKey $ServiceKey -PrimaryPeerSubnet $PriSN -SecondaryPeerSubnet $SecSN -PeerAsn $ASN -VlanId $VLAN –AccessType Public
#Setting up a bgp session
$ServiceKey = "YourServiceKey"
$PriSN = "192.168.1.0/30"
$SecSN = "192.168.2.0/30"
#You can use Public ASN you own or Private ASN Greater than 65000
$ASN = "YourASN"
$VLAN = "100"
#Create a new bgp peering session
New-AzureBGPPeering -ServiceKey $ServiceKey -PrimaryPeerSubnet $PriSN -SecondaryPeerSubnet $SecSN -PeerAsn $ASN -VlanId $VLAN –AccessType Private
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "Builds a NAT host. **WARNING** This template creates Amazon EC2 instance(s). You will be billed for the AWS resources used if you create a stack from this template.",
"Parameters" : {
"KeyName" : {
"Description" : "Name of an existing EC2 KeyPair to enable SSH access to the instances",
"Type" : "String",
"MinLength": "1",