Hyper-V的實驗安裝----3

5、網絡配置

5.1、場景

    yper-V2012的安裝,由於是CORE模式,所以沒有配置虛擬網絡。通過控制檯或遠程桌面,在HOST上查看配置網絡配置。

D:\>ipconfig /all

Windows IP Configuration

Host Name . . . . . . . . . . . . :CT-HYNODE3

Primary Dns Suffix . . . . . . . :yunhedata.com

Node Type . . . . . . . . . . . . : Hybrid

IP Routing Enabled. . . . . . . . : No

WINS Proxy Enabled. . . . . . . . : No

DNS Suffix Search List. . . . . . : yunhedata.com

Ethernet adapter Ethernet0:    默認設置

Connection-specific DNS Suffix . :

Description . . . . . . . . . . . :Intel(R) 82574L Gigabit Network Connection

Physical Address. . . . . . . . . :00-50-56-B2-13-7F

DHCP Enabled. . . . . . . . . . . : No

Autoconfiguration Enabled . . . . : Yes

Link-local IPv6 Address . . . . . :fe80::9578:42bd:4aad:11ae%13(Preferred)

IPv4 Address. . . . . . . . . . . :192.168.1.83(Preferred)

Subnet Mask . . . . . . . . . . . :255.255.255.0

Default Gateway . . . . . . . . . :192.168.1.1

DHCPv6 IAID . . . . . . . . . . . :318787670

DHCPv6 Client DUID. . . . . . . . :00-01-00-01-1B-87-4B-D0-00-50-56-B2-13-7F

DNS Servers . . . . . . . . . . . :192.168.1.11

192.168.1.12

NetBIOS over Tcpip. . . . . . . . : Enabled

Tunnel adapterisatap.{F0257AF5-B14C-4A34-B3CD-CABD0AE12796}:

Media State . . . . . . . . . . . : Mediadisconnected

Connection-specific DNS Suffix . :

Description . . . . . . . . . . . :Microsoft ISATAP Adapter

Physical Address. . . . . . . . . :00-00-00-00-00-00-00-E0

DHCP Enabled. . . . . . . . . . . : No

Autoconfiguration Enabled . . . . : Yes

 

    這時,在其上創建虛擬機時沒有網絡連接的,通過GUEST操作系統的命令或工具可以觀察到這種情況。

wKiom1QmfXHjsFP3AADcbgDEyEs422.gif

5.2、創建虛擬交換機

HOST管理中,選擇虛擬交換機管理器。

wKioL1QmfdDwoYTTAACYA5Ug6wk861.gif

當前沒有虛擬交換機,點擊創建虛擬交換機按鈕。

wKiom1QmfarBGkOiAACEGWi6EJU211.gif

指定一個清晰、有意義的新虛擬機的交換機的名稱。

wKioL1QmfdOwHfJsAADU_hYgTCA293.gif

wKiom1Qmfa3j_vXNAACIef93HFY768.gif

wKioL1QmfdSBzf4MAAATy-JjLOw687.gif

這個時候,我們可以在Host上查看配置網絡配置,觀察其變化。

D:\>ipconfig /all

Windows IP Configuration

Host Name . . . . . . . . . . . . :CT-HYNODE3

Primary Dns Suffix . . . . . . . :yunhedata.com

Node Type . . . . . . . . . . . . : Hybrid

IP Routing Enabled. . . . . . . . : No

WINS Proxy Enabled. . . . . . . . : No

DNS Suffix Search List. . . . . . :yunhedata.com

Ethernet adapter vEthernet (Office):

Connection-specific DNS Suffix . :

Description . . . . . . . . . . . : Hyper-VVirtual Ethernet Adapter #2   變成虛擬網卡

Physical Address. . . . . . . . . :00-50-56-B2-13-7F

DHCP Enabled. . . . . . . . . . . : No

Autoconfiguration Enabled . . . . : Yes

Link-local IPv6 Address . . . . . :fe80::605a:6bb7:cab7:9bd5%23(Preferred)

IPv4 Address. . . . . . . . . . . :192.168.1.83(Preferred)

Subnet Mask . . . . . . . . . . . :255.255.255.0

Default Gateway . . . . . . . . . :192.168.1.1

DHCPv6 IAID . . . . . . . . . . . :385896534

DHCPv6 Client DUID. . . . . . . . :00-01-00-01-1B-87-4B-D0-00-50-56-B2-13-7F

DNS Servers . . . . . . . . . . . :192.168.1.11

192.168.1.12

NetBIOS over Tcpip. . . . . . . . : Enabled

Tunnel adapterisatap.{9E05183E-BE65-4456-83FC-01AECE398990}:

Media State . . . . . . . . . . . : Mediadisconnected

Connection-specific DNS Suffix . :

Description . . . . . . . . . . . :Microsoft ISATAP Adapter

Physical Address. . . . . . . . . :00-00-00-00-00-00-00-E0

DHCP Enabled. . . . . . . . . . . : No

Autoconfiguration Enabled . . . . : Yes

D:\>

5.3、修改虛擬機

創建完新的虛擬交換機後,就會爲指定虛擬機連接到虛擬交換機。

wKioL1Qmfi2ju26TAAEbK094KMo508.gif

wKioL1QmfjSCmOkHAADaGhZp9v4541.gif



5.4、實驗-NAT

爲了深入理解Hyper-V的網絡,我們做一個綜合實驗。

5.4.1、拓撲

wKioL1QmfmDjOxGTAAAurA4V52I999.gif

Office網絡:172.16.1.0/24

LAB網絡:10.0.0.0/8

SRV1LAB網絡的IP地址爲:10.0.0.254,啓用NAT功能

SRV2IP地址爲:10.0.0.10/8,網關爲10.0.0.254

5.4.2、在Host上添加新的虛擬機交換機LAB

wKioL1Qmfn-CiuCjAADXoDBE-is502.gif

wKiom1QmflmDjNlXAAC5r1ipTh0184.gif

wKiom1Qmfl7ROMUlAAEpF86N9lg986.gif

通過ConsoleRDP連接到HOST,查看網絡配置,我們會發現多了一個網絡連接。

D:\>ipconfig/all | more

Windows IP Configuration

Host Name . . . . . . . . . . . . :CT-HYNODE3

Primary Dns Suffix . . . . . . . :yunhedata.com

Node Type . . . . . . . . . . . . : Hybrid

IP Routing Enabled. . . . . . . . : No

WINS Proxy Enabled. . . . . . . . : No

DNS Suffix Search List. . . . . . :yunhedata.com

Ethernet adapter vEthernet (Lab):

Connection-specific DNS Suffix . :

Description . . .. : Hyper-V VirtualEthernet Adapter #3

Physical Address. . . . . . . . . :00-15-5D-01-53-04

DHCP Enabled. . . . . . . . . . . : Yes

Autoconfiguration Enabled . . . . : Yes

Link-local IPv6 Address . . . . . :

fe80::2037:e07e:2902:943e%35(Preferred)

Autoconfiguration IPv4 Address. . :169.254.148.62(Preferred)

Subnet Mask . . . . . . . . . . . :255.255.0.0

Default Gateway . . . . . . . . . :

DHCPv6 IAID . . . . . . . . . . . : 587208029

DHCPv6 Client DUID. . :00-01-00-01-1B-87-4B-D0-00-50-56-B2-13-7F

DNS Servers . . . . . . . . . . . :fec0:0:0:ffff::1%1

fec0:0:0:ffff::2%1

fec0:0:0:ffff::3%1

NetBIOS over Tcpip. . . . . . . . : Enabled

Ethernet adapter vEthernet (Office):

Connection-specific DNS Suffix . :

Description . . . . . . . . . . . : Hyper-VVirtual Ethernet Adapter

#2

Physical Address. . . . . . . . . :00-50-56-B2-13-7F

DHCP Enabled. . . . . . . . . . . : No

Autoconfiguration Enabled . . . . : Yes

Link-local IPv6 Address . . . . . :

fe80::605a:6bb7:cab7:9bd5%23(Preferred)

IPv4 Address. . . . . . . . . . . :192.168.1.83(Preferred)

Subnet Mask . . . . . . . . . . . :255.255.255.0

Default Gateway . . . . . . . . . :192.168.1.1

DHCPv6 IAID . . . . . . . . . . . : 385896534

DHCPv6 Client DUID.. . :00-01-00-01-1B-87-4B-D0-00-50-56-B2-13-7F

DNS Servers . . . . . . . . . . . :192.168.1.11

192.168.1.12

NetBIOS over Tcpip. . . . . . . . : Enabled

Tunnel adapterisatap.{9E05183E-BE65-4456-83FC-01AECE398990}:

Media State . . . . . . . . . . . : Mediadisconnected

Connection-specific DNS Suffix . :

Description . . . . . . . . . . . :Microsoft ISATAP Adapter

Physical Address. . . . . . . . . :00-00-00-00-00-00-00-E0

DHCP Enabled. . . . . . . . . . . : No

Autoconfiguration Enabled . . . . : Yes

Tunnel adapterisatap.{5842CD52-A667-470D-A9FB-705AAB210B62}:

Media State . . . . . . . . . . . : Mediadisconnected

Connection-specific DNS Suffix . :

Description . . . . . . . . . . . :Microsoft ISATAP Adapter #2

Physical Address. . . . . . . . . :00-00-00-00-00-00-00-E0

DHCP Enabled. . . . . . . . . . . : No

Autoconfiguration Enabled . . . . : Yes

5.5配置SRV1虛擬機

5.5.1、在虛擬機SRV1上添加新的網卡

只在關閉虛擬機的情況下,才能添加新網卡。

wKioL1QmfqrxQ7RUAAEXpzp-XyA134.gif

wKiom1Qmfovh67FUAAFvYTyTF54802.gif

5.5.2、啓動SRV1NAT功能

修改網絡連接的名稱,以方便管理。

wKioL1Qmft-CO5viAACkSvpghDg521.gif

複查IP地址及網絡連接名稱是否正確

wKiom1QmfsLw4gsEAACguSwFO78053.gif

wKioL1QmfuyiYY-VAACYKEMGwkE883.gif

wKioL1Qmfu6TS0-3AACcv2RVfgM708.gif

wKioL1QmfvHjDgVSAADOHzwONS0569.gif

wKiom1QmfsvA6T7IAADnvic7V5c294.gif

wKioL1QmfvTDp1GpAACavQUEiZk223.gif

wKiom1Qmfs6TcgFjAACNal1p37s488.gif

wKioL1QmfvbAeXWWAABg6X2YeU8955.gif

wKiom1QmftCgYgarAACT79yO70c032.gif

5.5.3、配置及啓動路由和遠程訪問。

wKiom1QmfxnzeFDkAADPqt-_1jY499.gif

wKioL1Qmf0KRJEuqAACQXk4QoC4983.gif

wKioL1Qmf0SCrWV9AAEl8mQkl9w977.gif

wKiom1Qmfx7wA5TFAACee_fY3wI643.gif

wKiom1QmfyDw-UsPAAC4rW2d7Yw898.gif

wKiom1QmfyGCHLkeAAA8QNsk94M091.gif

wKioL1Qmf0rAea0KAADUZUw6dOE971.gif

wKioL1Qmf0viJFUQAABS9oOVU0o594.gif

wKioL1Qmf02QA29aAACi9dqYAyA065.gif

wKioL1Qmf07Csgz4AADQtLxNBOk914.gif

wKioL1Qmf0-Du09EAABMEbRBoWM152.gif

wKiom1QmfymxzTRiAACWSLc8YPI426.gif

wKioL1Qmf1awMxrBAACh8nZuEwI326.gif

5.5.4、啓動SRV2上網絡

SRV2配置上修改網絡適配器卡連接虛擬交換機爲LAB

wKiom1Qmf2LC2NluAAGJ73Fvir4302.gif

修改IP地址,缺省網管指向SRV1LAB接口地址10.0.0.254

wKiom1Qmf2aDNqmqAACEd-O99VU611.gif

wKioL1Qmf5DDS--qAAFEv3fQ4CU548.gif


6、遠程管理

     在域環境中,遠程管理Hyper-V比較方便,但有時候,我們需要在工作組中計算機來進行遠程管理。

     工作組環境又分爲桌面PC和服務器兩種連接方式。

6.1、工作組環境下的Hyper-V管理

必要條件

工作環境中進行Hyper-V遠程管理,必須在遠程管理主機上進行一下操作:

1、保證主機名解析,如:添加C:\Windows\System32\drivers\etc\hosts記錄

2、設置COM安全,允許Anonymouslogon遠程訪問權限

3、設置Hyper-V服務器爲信任的主機

4、如果與Hyper-V服務器用戶賬戶不同,需要添加賬戶憑據

5、添加適當的管理工具

本實驗的測試環境:

      客戶機是工作組環境,而目標服務器是域環境中成員服務器

6.1.1、主機名解析

以管理員的身份運行記事本,或者其它你愛好使用的文本編輯器。

wKioL1Qmf-Gya7WaAAAl7bAWBt8018.gif

wKiom1Qmf77j2sGVAADA4DF9VYg589.gif

6.1.2、設置COM安全,允許Anonymous Logon遠程訪問權限

在運行中輸入dcomcnfg

wKioL1QmgCKCePrFAABcADrdvdg646.gif

wKioL1QmgCXBfsLJAACCCOQ7im4825.gif

wKioL1QmgCewK4WFAAEPcpz-k00867.gif

wKiom1QmgAGSapEeAACslluwxGM429.gif

6.1.3、設置Hyper-V服務器爲信任的主機

以管理員的身份去運行PowerShell

Set-Itemwsman:\localhost\Client\TrustedHosts CT-HYNODE1  –

Concatenate

PS C:\Windows\system32> Set-Itemwsman:\localhost\Client\TrustedHosts CT-HYNODE1

-Concatenate

Start WinRM Service

WinRM service is not started currently.Running this command will start the WinRM service.

Do you want to continue?

[Y] Yes [N] No [S] Suspend [?] Help(default is "Y"): Y

WinRM Security Configuration.

This command modifies the TrustedHosts listfor the WinRM client. The computers in the

TrustedHosts list might not be

authenticated. The client might sendcredential information to these computers. Are you sure

that you want to modify

this list?

[Y] Yes [N] No [S] Suspend [?] Help(default is "Y"): Y

PS C:\Windows\system32> Set-Itemwsman:\localhost\Client\TrustedHosts CT-HYNODE2

-Concatenate

WinRM Security Configuration.

This command modifies the TrustedHosts listfor the WinRM client. The computers in the

TrustedHosts list might not be

authenticated. The client might sendcredential information to these computers. Are you sure

that you want to modify

this list?

[Y] Yes [N] No [S] Suspend [?] Help(default is "Y"): Y

PS C:\Windows\system32> Set-Item wsman:\localhost\Client\TrustedHostsCT-HYNODE3

-Concatenate -Force

PS C:\Windows\system32>

wKioL1QmgEDCcUD4AABtPlzmxQ0385.gif

6.1.4、在遠程管理主機上添加賬戶憑據

         通常情況下,在Hyper-V服務器與遠程管理主機上創建用戶名及明碼相同的賬戶比較方便,如果條件不允許,那麼需要在遠程管理主機上指定連接到Hyper-V服務器的賬戶憑據。

         我們需要使用Cmdkey來創建、列出和刪除存儲用戶名和密碼或憑據。

cmdkey /add:<ServerName>/user:<UserName> /pass:<password>

示例如下:

cmdkey /add: CT-HYNODE1 /user:administrator/pass:P@ssw0rd

cmdkey /add: CT-HYNODE2 /user:administrator/pass:P@ssw0rd

cmdkey /add: CT-HYNODE3 /user:administrator/pass:P@ssw0rd

wKioL1QmgG7ArJmvAAA5popOokQ903.gif

6.1.5、添加適當的管理工具

windows 2012上添加

wKiom1QmgJLQolOnAACC_cG1-v0406.gif

wKioL1QmgLzhyGy7AACfIBHm_BM243.gif

wKiom1QmgJaCaWNbAAB3clZn63c182.gif

wKiom1QmgJfgRavDAACW9UnY2iY603.gif

wKiom1QmgJnjXqgiAACwHoO4oYI538.gif

wKioL1QmgMWy9gj1AAChxnZvgWE090.gif

wKiom1QmgJ_hlPIqAACMjj1zoWk381.gif

wKioL1QmgMrhhn01AABwbC6Ph6k170.gif

wKiom1QmgKaQ1lTjAAB1rHYCtL8609.gif

windows 8.1上添加

wKioL1QmgM-xOeGcAABIoXeZHkI195.gif

wKioL1QmgNHDIaXRAAD_r3sYEDE069.gif

wKioL1QmgNXyw-4UAAD493vY5lc680.gif

wKioL1QmgNmA-FSXAAA38vuhoKw079.gif

wKioL1QmgNrStVQ-AAB4inqCUWE052.gif

6.2、遠程管理

wKioL1QmgRfB_uQuAACDRUw_uw8650.gif

wKiom1QmgPCyDc3DAAA3c-VhIN0610.gif

wKioL1QmgRnjNu0KAACV0Zcm6ZM251.gif

wKiom1QmgPPS1qwjAAClyNkAdC8663.gif

6.3、域環境的Hyper-V管理

         相對於工作組,在域環境下管理很簡單,只需要使用Hyper-V管理器直接進行遠程連接即可。

6.4、工作組環境的服務器管理

Windows 2012的服務器功能很強大,可以對服務器遠程進行管理。

在工作組環境下,一定要將被管理的遠程服務器添加爲信任的主機,否則,就會出現以下錯誤。

wKioL1QmgUKgHSweAACA59L2c0Q121.gif

wKioL1QmgUSAzYGMAACEFct0f5o764.gif

詳細操作,請參見前面《設置Hyper-V服務器爲信任的主機》小節。

Windows PowerShell

版權所有  (C) 2013 MicrosoftCorporation。保留所有權利。

PS C:\Users\Administrator> Set-Itemwsman:\localhost\Client\TrustedHosts CT-HYNODE1

-Concatenate -Force

PS C:\Users\Administrator> Set-Itemwsman:\localhost\Client\TrustedHosts CT-HYNODE2

-Concatenate -Force

PS C:\Users\Administrator> Set-Itemwsman:\localhost\Client\TrustedHosts CT-HYNODE3

-Concatenate -Force

PS C:\Users\Administrator>

wKioL1QmgWaxRzZjAAB6Iao-Iik207.gif

wKiom1QmgUKS2ywHAABf6JGFyP4199.gif

wKioL1QmgW-jI9JhAABG9NrCBn8164.gif

wKiom1QmgUzx8Dn-AABMz3KJE38079.gif

wKiom1QmgVDx8p33AABS3svd_Hg461.gif

wKioL1QmgYbB-a4TAAC7mxADF04315.gif

wKioL1QmgYujQBHAAADmaqnPea0732.gif

但是,當進行磁盤管理時,卻出現RPC服務不可用錯誤。

wKiom1QmgWvCLH6uAABcmX4XUYo768.gif

The RPC server is unavailable

這與管理機的防火牆規則有關。

6.5、域環境的服務器管理

相對於工作組環境,在域環境中

wKiom1QmgZ7jzH4TAACUb5Ybxuw020.gif

wKioL1QmgcrxnwO3AACVH_9D5nk268.gif

wKioL1QmgcuTcqC5AACk8uGeHjQ595.gif

wKiom1QmgaXQ7Z0cAACmefOdr4c267.gif

wKiom1QmgarxvtSpAAECZ3AqFtY784.gif

wKioL1QmgdizDPd3AADxKYKZUyo060.gif

wKiom1QmgbiwONs6AACoKDnYy90469.gif

6.6、參考

將服務器添加到服務器管理器

http://technet.microsoft.com/library/hh831453


ManageHyper-V Server Remotely

http://technet.microsoft.com/en-us/library/jj647785.aspx


WindowsServer 2012 -  Server ManagerTroubleshooting Guide, Part II Troubleshoot

ManageabilityStatus Errors in Server Manager

http://social.technet.microsoft.com/wiki/contents/articles/13444.windows-server-2012-server-manager-troubleshooting-guide-part-ii-troubleshoot-manageability-status-errors-in-server-manager.aspx


RemoteServer Administration Tools for Windows 8

http://www.microsoft.com/en-us/download/details.aspx?id=28972


RemoteServer Administration Tools for Windows 8.1

http://www.microsoft.com/en-us/download/details.aspx?id=3929


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章