NSX の HoL シナリオを PowerNSX でためす。Part.2

VMware NSX for vSphere の HoL シナリオを PowerNSX で進めてみます。

 

前回の投稿はこちら。

NSX の HoL シナリオを PowerNSX でためす。Part.1

 

今回も、下記のラボを利用します。

HOL-1803-01-NET - VMware NSX - Getting Started

http://labs.hol.vmware.com/HOL/catalogs/lab/3661

 

今回は、モジュール3 の分散論理ルーティングを実施します。

このシナリオでは、Edge Security Gateway(ESG)でのルーティングを

分散論理ルータ(DLR)によるルーティングに変更して、

さらに ESG / DLR で OSPF によるダイナミック ルーティングを有効化します。

 

ESG から DLR へのインターフェース付け替え。

 

まず PowerShell を起動して、NSX Manager と vCenter に接続しておきます。

Connect-NsxServer -vCenterServer vcsa-01a.corp.local -Username administrator@corp.local -Password VMware1!

 

このラボのサンプル Web ページ「Customer DB App」は、

はじめは NSX Edge Service Gateway(ESG)でルーティングをしています。

まず、ESG のインターフェースの構成を確認しておきます。

Get-NsxEdge -Name Perimeter-Gateway-01 | Get-NsxEdgeInterface | select index,name,type,isConnected,portgroupName | ft -AutoSize

hol1803-powernsx-02-01.png

 

構成変更のため、ESG からインターフェース App_Tier と DB_Tier を削除します。

vnic3、vnic4 がクリアされます。

Get-NsxEdge -Name Perimeter-Gateway-01 | Get-NsxEdgeInterface -Name  App_Tier | Clear-NsxEdgeInterface -Confirm:$false

Get-NsxEdge -Name Perimeter-Gateway-01 | Get-NsxEdgeInterface -Name  DB_Tier | Clear-NsxEdgeInterface -Confirm:$false

hol1803-powernsx-02-02.png

 

新たにネットワークを接続する、DLR のインターフェース構成を確認しておきます。

Get-NsxLogicalRouter -Name Distributed-Router-01 | Get-NsxLogicalRouterInterface | %{$ip = $_.addressGroups.addressGroup; $_ | select Index,type,name,connectedToName,{$ip.primaryAddress},{$ip.subnetPrefixLength}} | ft -AutoSize

hol1803-powernsx-02-03.png

 

論理スイッチを接続します。

$ls = Get-NsxLogicalSwitch -Name App_Tier_Logical_Switch

Get-NsxLogicalRouter -Name Distributed-Router-01 | New-NsxLogicalRouterInterface -Name App_Tier -Type internal -ConnectedTo $ls -PrimaryAddress 172.16.20.1 -SubnetPrefixLength 24

 

接続する論理スイッチは、下記のように指定することもできます。

Get-NsxLogicalRouter -Name Distributed-Router-01 | New-NsxLogicalRouterInterface -Name DB_Tier -Type internal -ConnectedTo (Get-NsxLogicalSwitch -Name DB_Tier_Logical_Switch) -PrimaryAddress 172.16.30.1 -SubnetPrefixLength 24

hol1803-powernsx-02-05.png

 

DLR に、論理スイッチに接続したインターフェース App_Tier、DB_Tier が作成されました。

hol1803-powernsx-02-06.png

 

DLR で OSPF を有効化する。

DLR は、OSPF がまだ無効な状態です。

Get-NsxLogicalRouter -Name Distributed-Router-01 | Get-NsxLogicalRouterRouting | Get-NsxLogicalRouterOspf

hol1803-powernsx-02-07.png

 

DLR で OSPF を有効化します。

Get-NsxLogicalRouter -Name Distributed-Router-01 | Get-NsxLogicalRouterRouting | Set-NsxLogicalRouterRouting -EnableOspf -EnableOspfRouteRedistribution -RouterId 192.168.5.2 -ProtocolAddress 192.168.5.3 -ForwardingAddress 192.168.5.2 -Confirm:$false

hol1803-powernsx-02-08.png

 

OSPF Area を作成します。

Get-NsxLogicalRouter -Name Distributed-Router-01 | Get-NsxLogicalRouterRouting | New-NsxLogicalRouterOspfArea -AreaId 10 -Confirm:$false

hol1803-powernsx-02-09.png

 

DLR のアップリンク インターフェースに OSPF Area を追加します。

$if = Get-NsxLogicalRouter -Name Distributed-Router-01 | Get-NsxLogicalRouterInterface -Name Transit_Network_01

Get-NsxLogicalRouter -Name Distributed-Router-01 | Get-NsxLogicalRouterRouting | New-NsxLogicalRouterOspfInterface -Vnic $if.index -AreaId 10 -Confirm:$false

hol1803-powernsx-02-10.png

 

分散ルータで OSPF が有効になりました。

hol1803-powernsx-02-11.png

 

OSPF のルート再配布テーブルに BGP の許可ルールを追加しておきます。

(本来ならルール編集がいいとは思いますが・・・)

Get-NsxLogicalRouter -Name Distributed-Router-01 | Get-NsxLogicalRouterRouting | New-NsxLogicalRouterRedistributionRule -Learner ospf -FromBGP -Action permit -Confirm:$false

 

 

NSX ESG に OSPF ルーティングを追加する。

NSX ESG も、まだ OSPF が無効です。

Get-NsxEdge -Name Perimeter-Gateway-01 | Get-NsxEdgeRouting | Get-NsxEdgeOspf

hol1803-powernsx-02-12.png

 

ESG で OSPF を有効化します。

Get-NsxEdge -Name Perimeter-Gateway-01 | Get-NsxEdgeRouting | Set-NsxEdgeRouting -EnableOspf -EnableOspfRouteRedistribution -Confirm:$false

hol1803-powernsx-02-13.png

 

OSPF Area を作成します。

Get-NsxEdge -Name Perimeter-Gateway-01 | Get-NsxEdgeRouting | New-NsxEdgeOspfArea -AreaId 10 -Confirm:$false

hol1803-powernsx-02-14.png

 

ESG のインターフェースに OSPF Area を追加します。

$if = Get-NsxEdge -Name Perimeter-Gateway-01 | Get-NsxEdgeInterface -Name Transit_Network_01

Get-NsxEdge -Name Perimeter-Gateway-01 | Get-NsxEdgeRouting | New-NsxEdgeOspfInterface -Vnic $if.index -AreaId 10 -Confirm:$false

hol1803-powernsx-02-15.png

 

今回はルート再配布テーブルに許可ルールを追加してしまいます。

(こちらも本来はルール編集がいいとは思いますが・・・)

Get-NsxEdge -Name Perimeter-Gateway-01 | Get-NsxEdgeRouting | New-NsxEdgeRedistributionRule -Learner bgp -FromOspf -Action permit -Confirm:$false

Get-NsxEdge -Name Perimeter-Gateway-01 | Get-NsxEdgeRouting | New-NsxEdgeRedistributionRule -Learner ospf -FromBGP -FromConnected -Action permit -Confirm:$false

 

これで、ネットワーク構成を変更したあとも

HoL のサンプル Web ページ「Customer DB App」が表示できるようになるはずです。

 

つづく。



via Latest imported feed items on VMware Blogs https://ift.tt/2kQvZn3
RSS Feed

If New feed item from https://blogs.vmware.com/feed, then send me an email at kr

IFTTT

Comments

Popular posts from this blog

The best air conditioner

Sprint will give free data to Snapdragon PCs

ASUS VivoWatch BP keeps track of your blood pressure and location