How to create an IP alias on Windows

前端 未结 7 1069
时光说笑
时光说笑 2020-12-14 11:02

I need to create an alias for my network interface such that it can be accessed locally with either 127.0.0.1 or 33.33.33.33.

In *nix I would do this:



        
7条回答
  •  醉酒成梦
    2020-12-14 11:07

    There is a comment about how to add alias while still using DHCP for the main one. I have similar problem.

    The solution is:

    1. Add Microsoft Loopback Adapter as a network device (as suggested by one of the comment).
    2. Specify IP address for the new network interface.

    (1) Add Microsoft Loopback Adapter as a network device (taken from here):

    1. Click the Start menu.
    2. Search for “cmd".
    3. Right-click on “cmd” and select “Run as Administrator”
    4. Enter “hdwwiz.exe”

    From that point on it's the same approach as under Vista, i.e.:

    1. In the "Welcome to the Add Hardware Wizard", click Next.
    2. Select "Install the hardware that I manually select from a list (Advanced)" and click Next.
    3. Scroll down and select "Network adapters" and click Next.
    4. Select under Manufacturer "Microsoft" and then under Network Adapter "Microsoft Loopback Adapter" and click Next.

    (2) To see the newly added network interface, and specify an IP address:

    1. Go to Control Panel -> Network and Sharing Center
    2. Click on "Change adapter setttings" on the left side
    3. Find the entry with Device Name "Microsoft Loopback Adapter"
    4. Right click on it, and choose Property
    5. Choose "Internet Protocol Version 4 (TCP/IPv4) and hit Properties button.
    6. Select "Use the following IP address:", and enter IP address, Subnet mask, and Default gateway as needed.

提交回复
热议问题