// Export/import IP settings on MS Windows with netsh

Every now an then, I need MS Windows for doing tests. I'm running different testing VMs and often have to deal with static IP settings on different LANs and VPNs. Therefore it is nice to know how to import and export IP settings without any GUI involved. I tested it only on XP/2k3 but it should also work on Vista/7.

  • Export: Configure your network settings as you like. Open a command prompt afterwards and use netsh to export the settings into a file:
    netsh -c interface ip dump > X:\network-foobar

    Repeat the task for every needed network.

  • Import: Use -f to load files like X:\network-foobar:
    netsh -f  X:\network-foobar

Now put the import command for different networks into separate batch files and name them properly to change the settings with simple double clicks. You might want to use runas for the netsh call because you need admin privileges to change IP settings.

Leave a comment…




T F B J H
  • E-Mail address will not be published.
  • Formatting:
    //italic//  __underlined__
    **bold**  ''preformatted''
  • Links:
    [[http://example.com]]
    [[http://example.com|Link Text]]
  • Quotation:
    > This is a quote. Don't forget the space in front of the text: "> "
  • Code:
    <code>This is unspecific source code</code>
    <code [lang]>This is specifc [lang] code</code>
    <code php><?php echo 'example'; ?></code>
    Available: html, css, javascript, bash, cpp, …
  • Lists:
    Indent your text by two spaces and use a * for
    each unordered list item or a - for ordered ones.
I'm no native speaker (English)
Please let me know if you find any errors (I want to improve my English skills). Thank you!
QR Code: URL of current page
QR Code: URL of current page 2011:05:22:import-export-ip-configuration-network-settings-windows (generated for current page)