Solving problems invented by others...
My journey to automate vCloud Director with PowerShell – part #7  : create a routed network

My journey to automate vCloud Director with PowerShell – part #7 : create a routed network

The next task i want to achieve was to create a network for the customer where he can put his vms in. This network should be able to access the internet. So it has to be routed by the newly created edge gateway.

This was one of the easiest parts of my journey, because creating an orgNetwork is a simple one liner in PowerCLI. You just have to look at the documentation of the New-OrgVdcNetwork commandlet. (https://code.vmware.com/docs/11794/cmdlet-reference/doc/New-OrgVdcNetwork.html)

  • I wanted to create a network with the ip range 192.168.0.0/24
  • The network had to be routed, therefore i want the edge gateway to have an ip address (192.168.0.1)
  • I filled the rest of the parameters as i preferred (name, description, dns, …)

 

The code:

#####################################
# create a example internal network #
#####################################

# create an example routed (nat) network in the orgvdc with example ip settings
New-OrgVdcNetwork -Routed -Name "$orgname-example-network" -OrgVdc (Get-OrgVdc -Name $orgvdcname) -EdgeGateway (Get-EdgeGateway -OrgVdc "$orgvdcname") -Gateway "192.168.0.1" -PrimaryDns "8.8.8.8" -Netmask "255.255.255.0" -StaticIPPool "192.168.0.10-192.168.0.20" -Description "internal routed network with activated dhcp and example firewall settings."

Next article in this series:

configure dhcp on an edge gateway

Leave a Reply

Your email address will not be published.

twenty ÷ = four