How can I move EC2 instances to a different subnet?

前端 未结 4 1146
不思量自难忘°
不思量自难忘° 2021-01-31 01:57

I have a VPC set up in AWS. we have created 2 subnets (A/24 and B/24), straight using all the IP having no IP\'s/Subnets for further usage.

We find that the b/24 is not

4条回答
  •  故里飘歌
    2021-01-31 02:53

    Maybe you only need to "access" a different subnet...

    It's true that you will never get the AWS web console to display any other value for "Subnet ID" in the instance details. Others have explained how to create new instances that will "be on" the desired subnet. I needed to take an existing server running software that was licensed to "one non-transferable Host ID" and "put it on" a different subnet. (Of course when I say licensed software, I'm talking about Windows software from a vendor who "doesn't support AWS"!) I solved this by:

    1. Create a new network interface (AWS > EC2 > Network Interfaces) on the desired subnet and the same availability zone as the machine.
    2. Attach the new nic to the machine. (AWS > EC2 > Actions > Networking > Attach Network Interface)
      • In Windows the interface just appeared!
    3. Set the "Metric" ("priority" integer, lowest wins) of each Network Connection (Control Panel > Network and Internet > Network Connections > [double-click connection name] > Properties [button] > TCP\IPv4 > Properties [button] > Advanced [button] > Automatic Metric [uncheck] > Interface metric)
    4. To confirm the routing table call route print from the command line.

    Now everything the machine does is on the desired subnet. It is still reachable on the old IP (and previous subnet) as well as on the new IP (and desired subnet).

    This is a pretty narrow case, but I hope it helps someone.

提交回复
热议问题