Ssup2 Blog logo Ssup2 Blog

1. 설정 환경

2. Switch 생성 및 NAT 설정

> New-VMSwitch -SwitchName "NAT-Swtich" -SwitchType Internal
> $AdapterName=(Get-NetAdapter -Name "vEthernet (NAT-Swtich)").Name
> New-NetIPAddress -IPAddress 172.34.0.1 -PrefixLength 24 -InterfaceAlias $AdapterName
> New-NetNat -Name NAT-Network -InternalIPInterfaceAddressPrefix 172.34.0.0/24

3. VM

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# This file is generated from information provided by

# the datasource.  Changes to it will not persist across an instance.

# To disable cloud-init's network configuration capabilities, write a file

# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:

# network: {config: disabled}

network:

    ethernets:

        eth0:

            addresses:

            - 172.34.0.100/24

            dhcp4: false

            gateway4: 172.34.0.1

            nameservers:

                addresses:

                - 8.8.8.8

                search: []

    version: 2
# netplan apply

4. 참조