• Hyper-V设置固定IP


    win+x以管理员启动PowerShell

    创建虚拟交换机,等同于在Hyper-V管理器界面中新建虚拟网络交换机

    New-VMSwitch -SwitchName "NAT-VM" -SwitchType Internal

    查看 NAT-VM 的 ifindex

    Get-NetAdapter

    创建ip,InterfaceIndex参数自行调整为上一步获取到的ifindex。这一步等同于在 控制面版-网卡属性 中设置ip

    New-NetIPAddress -IPAddress 10.0.0.1 -PrefixLength 24 -InterfaceIndex 30

    创建NAT网络,允许访问外部网络,24为子网掩码位数,即:255.255.255.0

    New-NetNat -Name NAT-VM -InternalIPInterfaceAddressPrefix 10.0.0.0/24

    在Hyper V管理器中设置该Linux虚拟机的网络适配器为 NAT-VM

     最后在系统中设置好ip、网关、dns即可

  • 相关阅读:
    HDU-1527 取石子游戏
    HDU-1846 Brave Game
    HDU-1850 Being a Good Boy in Spring Festival
    HDU-2509 Be the Winner
    HDU-1907 John
    HDU-1969 Pie
    HDU-1501 Zipper
    HDU-2289 Cup
    最大子矩阵和
    HDU3466(01背包变种)
  • 原文地址:https://www.cnblogs.com/hackyo/p/13404437.html
Copyright © 2020-2023  润新知