[LINUX] Make Hyper-V guest OS (Ubuntu 18.04 LTS) a fixed IP


The Default Switch (default network) that exists by default in Hyper-V virtual switches is

It has the characteristics of.

This article is troubled by ** IP address is automatically assigned ** </ font>! Must be ** fixed IP address ** </ font>! This article is for those who say.


I think this is the easiest way to set it. Edit Ubuntu configuration file and do not operate PowerShell.

1. Settings: Hyper-V (Create internal network)

From Hyper-V Manager Virtual Switch Manager New Virtual Network Switch> Internal> Create Virtual Switch 2020-07-05_14h19_00.png

The name can be anything you like. Here, it is ╩╗Internal Switch`. VLAN ID> Check "Enable virtual LAN ID for management operating system". image.png

The following is the setting of the virtual machine to be fixed IP address. Add "Network Adapter" from Add Hardware and add a network adapter. Specify the ╩╗Internal Switch` created earlier, and check" Enable Virtual LAN ID "again. image.png

This completes the settings on the Hyper-V side. Set up the Windows network adapter.

2. Settings: Windows (Network adapter settings)

This is a setting on the Windows side. On the network adapter settings screen, You can see that the vEthernet (Internal Switch) created earlier has been newly added. image.png

Right-click on vEthernet (Internal Switch) to go to the properties screen. Uncheck Internet Protocol version 6 (TCP / IPv6) Go to the Internet Protocol version 4 (TCP / IPv4) properties screen. image.png

Select Use the following IP address and set the IP address and subnet mask of your choice.

  • If you are not sure, please set the IP address as shown in the image. (You can change it at any time.) image.png

That's all for the settings on the Windows side. Finally, configure the Ubuntu network settings.

3. Settings: Ubuntus (Network adapter settings)

Click the upper right corner of the screen> Click the setting mark> Network image.png

Ethernet (eth0) Click the "gear" mark to go to the settings screen. IPv6 Disable IPv6 for Ethernet (eth0). image.png

Ethernet (eth1) Assign ╩╗Internal Switchto Ethernet (eth1) to make it a fixed IP address. Click the "+" mark to move to the setting screen.Identity` Set the MAC Address to (eth1). image.png

IPv4 Select Manual for IPv4 Method. Set the IP address. Note that the IP address is different from the one set on the Windows side.

  • If you are not sure, please set the IP address as shown in the image. (You can change it at any time.) image.png

IPv6 Disable IPv6 for Ethernet (eth1) as well as Ethernet (eth0).

at the end

Ping the guest OS at the command prompt, and if there is a response, the setting is complete.

I was able to communicate all the time, but which configuration file did I change? ?? Because it was We have summarized the procedure for making a fixed IP address in the simplest way possible.

I'm not a person who is familiar with networks, so if there are any deficiencies, I would appreciate it if you could point out in the comments.