This project is read-only.

Routing role example

Feb 23, 2016 at 10:48 AM
Hi.

Could you guys provide an example on how to create a machine with the routing role.


with regards.
Hjorleifur
Feb 23, 2016 at 1:25 PM
Edited Feb 23, 2016 at 1:28 PM
Sorry for the non-existing documentation. This is a script to setup two machines in different subnets and make sure that routing works:
$labName = 'abc'
New-LabDefinition -Name $labName -DefaultVirtualizationEngine HyperV
Add-LabDomainDefinition -Name test1.net -AdminUser Install -AdminPassword Somepass1
Add-LabVirtualNetworkDefinition -Name net1 -AddressSpace 192.168.50.0/24
Add-LabVirtualNetworkDefinition -Name net2 -AddressSpace 192.168.51.0/24

Add-LabMachineDefinition -Name M1 -MemoryInMb 512 -Network net1 -OperatingSystem 'Windows Server 2012 R2 SERVERDATACENTER' -IpAddress 192.168.50.10 -Gateway 192.168.50.100
Add-LabMachineDefinition -Name M2 -MemoryInMb 512 -Network net2 -OperatingSystem 'Windows Server 2012 R2 SERVERDATACENTER' -IpAddress 192.168.51.10 -Gateway 192.168.51.100

$netAdapter = @()
$netAdapter += New-LabNetworkAdapterDefinition -VirtualSwitch net1 -Ipv4Address 192.168.50.100
$netAdapter += New-LabNetworkAdapterDefinition -VirtualSwitch net2 -Ipv4Address 192.168.51.100
$role = Get-LabMachineRoleDefinition -Role Routing
Add-LabMachineDefinition -Name Router -MemoryInMb 512 -NetworkAdapter $netAdapter -OperatingSystem 'Windows Server 2012 R2 SERVERDATACENTER' -Roles $role

Install-Lab
Do you also need a sample for Azure?