-2

I have a Windows Hyper-V Free Edition R2 2012 server and I need to create a static route for Hyper-V to communicate with private internal addresses and vice-versa.

  1. I tried to add the route manually, but when Windows restarts, it doesn't work (but the route appears in route print table).

  2. I tried to create a scheduled task that executes a batch script (.bat) to add the route. This method adds the route only if I add -P option in the command line, but neither works.

  3. I tried to add it with netsh, but I can't add the interface because it is private and doesn't appear. I received an error saying The filename, directory name, or volume label syntax is incorrect. all the time.

  4. I've also tried to create a REG_SZ string in the registry with regedit, but doesn't work.

In 1 and 2, it works when I execute my .bat file manually later, when I log on. The problem is that I need it to execute automatically.

This is the script:

 @ECHO ON
 REM ADD THE ROUTE
 ROUTE -P ADD 192.168.10.0 MASK 255.255.255.0 192.168.10.1 METRIC 1
HopelessN00b
  • 53,795
  • 33
  • 135
  • 209
  • When Windows restarts what do you do to make it work again? – LatinSuD Jun 18 '14 at 17:47
  • 7
    I don't think that this route makes sense. You instruct the machine to try to reach network 192.168.10.0 through gw 192.168.10.1. This means that you are already in 192.168.10.0, so why do you need to add this route? – lacasitos Jun 18 '14 at 18:10

2 Answers2

5

First, the route's gateway address needs to be on the same subnet as one of the interfaces on your server. If it isn't, the computer has no idea how to get to that route.

Second, there is no need to create a same-subnet route, as the machine will see that it is already connected to that subnet.

If you can provide more information on your systems configuration (especially IP addresses and their subnet masks) and describe what you're trying to do, someone might be able to provide a suggested solution.

newmanth
  • 3,943
  • 4
  • 26
  • 47
0

There are no private internal addresses. There are either private virtual switches or internal virtual switches (or external virtual switches).

If you want to communicate with the VM's attached to the switch, connect the switch to the internal network.

And then please stop messing with the routes.

Daniel
  • 6,940
  • 6
  • 33
  • 64