...
コード ブロック |
---|
language | powershell |
---|
linenumbers | true |
---|
|
PS C:\> Get-AzureRouteTable
PS C:\> New-AzureRouteTable -name ngroutetable -Location "Japan East" -Label "route table to NGF"
Name Location Label
---- -------- -----
ngroutetable Japan East route table to NGF |
デフォルトルートとして、NGFのIPアドレスへルーティングさせる設定を追加デフォルトルート、dmz、backendへのルートとして、NGFのIPアドレスへルーティングさせる設定を追加
コード ブロック |
---|
language | powershell |
---|
linenumbers | true |
---|
|
PS C:\> Get-AzureRouteTable -name ngroutetable | Set-AzureRoute -RouteName Default -AddressPrefix 0.0.0.0/0 -NextHopType
VirtualAppliance -NextHopIpAddress 10.0.0.4
Name : ngroutetable
Location : Japan East
Label : route table to NGF
Routes :
Name Address Prefix Next hop type Next hop IP address
---- -------------- ------------- -------------------
default 0.0.0.0/0 VirtualAppliance 10.0.0.4
PS C:\> Get-AzureRouteTable -name ngroutetable | Set-AzureRoute -RouteName dmz -AddressPrefix 10.0.1.0/24 -NextHopType V
irtualAppliance -NextHopIpAddress 10.0.0.4
Name : ngroutetable
Location : Japan East
Label : route table to NGF
Routes :
Name Address Prefix Next hop type Next hop IP address
---- -------------- ------------- -------------------
default 0.0.0.0/0 VirtualAppliance 10.0.0.4
dmz 10.0.1.0/24 VirtualAppliance 10.0.0.4
PS C:\> Get-AzureRouteTable -name ngroutetable | Set-AzureRoute -RouteName backend -AddressPrefix 10.0.2.0/24 -NextHopTy
pe VirtualAppliance -NextHopIpAddress 10.0.0.4
Name : ngroutetable
Location : Japan East
Label : route table to NGF
Routes :
Name Address Prefix Next hop type Next hop IP address
---- -------------- ------------- -------------------
backend 10.0.2.0/24 VirtualAppliance 10.0.0.4
default 0.0.0.0/0 VirtualAppliance 10.0.0.4
dmz 10.0.1.0/24 VirtualAppliance 10.0.0.4 |
...
コード ブロック |
---|
language | powershell |
---|
linenumbers | true |
---|
|
PS C:\> Set-AzureSubnetRouteTable -VirtualNetworkName cuda-test-vnet -SubnetName dmz -RouteTableName ngroutetable
PS C:\> Set-AzureSubnetRouteTable -VirtualNetworkName cuda-test-vnet -SubnetName backend -RouteTableName ngroutetable |
IPフォワーディングを有効化IPフォワーディングを有効化(有効化されるまでには数分程度かかります。)
コード ブロック |
---|
language | powershell |
---|
linenumbers | true |
---|
|
Get-AzureVM -ServiceName cuda-test-ng -Name cuda-test-ng | Set-AzureIPForwarding -Enable |