hyper-v - Static NAT with Hyper-V
问题描述
Concerning Hyper-V configuration, on my Windows host I got a NIC with two IP-Addresses (192.168.1.1 and 192.168.1.2).
In my Hyper-V guest I have a virtual NIC configured for NAT and it is working pretty fine to ping hosts on the 192.168.1.0/24 network! The NAT network is in the range 192.168.137.0/24.
Now I would like to use either the 192.168.1.1 or the 192.168.1.2 address depending on the source IP of my NAT network. Therefore I would like to configure a static NAT rule. (e.g. to map all the traffic from IP 192.168.137.10 to 192.168.1.2)
First I tried out (split for readability)
Add-NetNatStaticMapping -NatName "NAT"
-ExternalPort 80
-InternalPort 80
-Protocol TCP
-ExternalIPAddress 192.168.1.2
-InternalIPAddress 192.168.137.10
Here I get the error that some external IP is missing and that I shall add it with Add-NetNatExternal Address
So I gave it a try with
Add-NetNatExternalIPAddress -NatName "NAT" -IPAddress 192.168.1.2
Here I got the error
Element not found
Are there other ways for using a specific IP depending on the source IP in my VM?
解决方案
推荐阅读
- node.js - 如何修复使用命令 npm run build 时显示的错误?
- plot - 将中线添加到箱线图
- c# - 我的 MonoGame 项目的退出按钮不起作用
- vba - 使用 selenium 插入并单击网页上的链接
- iphone-developer-program - 我不能接受更新的苹果开发者许可协议
- r - 如何在R中的igraph中调整社区边界宽度
- haskell - 在 megaparsec 7.0.4 中使用 parseTest
- api - Symfony 3.4.18 + FosUserBundle 2.0 + LexikJWT
- c++ - clang-cl flags -fprofile-instr-generate -fcoverage-mapping 可以在windows中使用吗
- amazon-lex - Amazon Lex 通过电子邮件发送已完成的插槽