我正在安装基于Hyper-V服务器的新主机服务器。 目前它有一个networking电缆插入和四个更多的免费networking接口(包括一个国际劳工组织)。 当我启动服务器并到达蓝色的命令行屏幕时,我可以configurationIP接口。 由于这台机器要在现场configuration并移动到最终位置,所以我现在不能插入所有连接器,但需要在移动之前configuration不同的IP。
我的问题是如何(如果有的话),我可以访问拔出networking接口的configuration选项?
提前致谢,
何塞。
首先,列出所有的接口并记下它们的名字 :
netsh interface ipv4 show config
然后configuration每个接口如下:
netsh interface ipv4 set address name="YOUR INTERFACE NAME" static IP_ADDRESS SUBNET_MASK GATEWAY
例:
netsh interface ipv4 set address name="Wi-Fi" static 192.168.3.8 255.255.255.0 192.168.3.1
或者如果最终网站上有DHCP服务器:
netsh interface ip4 set address name=”YOUR INTERFACE NAME” source=dhcp
很可能你也需要设置DNS服务器:
netsh interface ipv4 set dns name="YOUR INTERFACE NAME" static DNS_SERVER
例:
netsh interface ipv4 set dns name="Wi-Fi" static 8.8.8.8 netsh interface ipv4 set dns name="Wi-Fi" static 8.8.4.4 index=2
获取接口列表并记下它们的名称 :
Get-NetIPAddress | ft InterfaceAlias
示例如何设置或更改IP地址:
New-NetIPAddress –InterfaceAlias “Wired Ethernet Connection” –IPv4Address “192.168.0.1” –PrefixLength 24 -DefaultGateway 192.168.0.254
和DNS
Set-DnsClientServerAddress -InterfaceAlias “Wired Ethernet Connection” -ServerAddresses 192.168.0.1, 192.168.0.2
希望能帮助到你。