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


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