본문 바로가기

STUDY

netplan

netplan: YAML 기반 리눅스 네트워크 설정 프로그램

 

yaml 파일 위치: /etc/netplan/01-network-manager-all.yaml

 

yaml 파일 예시

# This is the network config written by 'subiquity'
network:
  ethernets:
	  eno3:
	    dhcp4: no
	    addresses:
		    - 192.168.100.98/24
	    nameservers:
	      addresses: [8.8.8.8, 8.8.4.4]
	      routes:
		      - to: default
        via: 192.168.200.255
  version: 2
  renderer: NetworkManager
  
또는
  
network:
  ethernets: {}
  version: 2
  renderer: NetworkManager

 

subiquity는 Ubuntu Server Installer이다.

즉, yaml파일이 설치되면서 자동으로 생성된 파일이라는 의미이다.

network ~ renderer가 지워지면 리눅스 네트워크 설정이 비활성화돼서 네트워크가 고장난다.

 

yaml 파일 수정 후

sudo netplan apply 해서 적용한다.

 

netplan 명령어 일람

usage: /usr/sbin/netplan  [-h] [--debug]  ...

Network configuration in YAML

optional arguments:
  -h, --help  show this help message and exit
  --debug     Enable debug messages

Available commands:

    help      Show this help message
    apply     Apply current netplan config to running system
    generate  Generate backend specific configuration files from
              /etc/netplan/*.yaml
    get       Get a setting by specifying a nested key like
              "ethernets.eth0.addresses", or "all"
    info      Show available features
    ip        Retrieve IP information from the system
    set       Add new setting by specifying a dotted key=value pair like
              ethernets.eth0.dhcp4=true
    rebind    Rebind SR-IOV virtual functions of given physical functions to
              their driver
    try       Try to apply a new netplan config to running system, with
              automatic rollback

 

Canonical Netplan

 

Netplan | Canonical Netplan

Backend-agnostic network configuration in YAML.

netplan.io

canonical/netplan: Declarative network configuration for various backends

 

GitHub - canonical/netplan: Declarative network configuration for various backends

Declarative network configuration for various backends - canonical/netplan

github.com

Ubuntu Manpage: netplan - YAML network configuration abstraction for various backends

 

Ubuntu Manpage: netplan - YAML network configuration abstraction for various backends

Powered by the Ubuntu Manpage Operator, file bugs in GitHub © 2025 Canonical. Ubuntu and Canonical are registered trademarks of Canonical Ltd.

manpages.ubuntu.com