Monday, August 6, 2007

Redirect network to virtual interface programaticaly

Problem: Temporarily disconnect/redirect network interface, but still allow applications to open sockets on the end point. Simulate cable unplug.

Solution: Create virtual interface using Microsoft loopback adapter and redirect network address to it.

1) To install loopback adapter using devcon.exe folow this KB link.

2) Redirect network interface using netsh.exe learn something here

To change network address on interface use netsh commands add and remove in this order instead of "set" command. It will work for both single IP and multi IP interface.

It work without any reboot and MS loopback driver is signed.