처음에는 리눅스에서 IP를 Static하게 구성하기위해 검색한 페이지에서 독특한 문법을 확인했다.
문의 내용은 17.10에서는 /etc/network/interfaces
에 작성해둔 설정이 안먹힌다는 것이었다. 그러면서 답변으로 달린것이 요내용이다.
ifupdown
패키지를 더이상 사용하지 않고, Ubuntu 17.10 Server에서 부터는 netplan
이라는 것을 사용하여 systemd-networkd
를 제어한다고 명시하고 있다.
사용법이 묘하다. 혹시나해서 Ubuntu 17.10 release note를 보러갔지. 그랬더니 Update Packages에 당당히 Linux kernel 다음에 한 꼭지로 있다. 내용은 다음 과 같다.
ifupdown has been deprecated in favor of netplan and is no longer present on new installs. The installer will generate a configuration file for netplan in /etc/netplan, which will set up the system to configure the network via systemd-networkd or NetworkManager. Desktop users will see their system fully managed via NetworkManager as it has been the case in previous releases, but Server users now have their network devices managed via systemd-networkd on new installs. This only applies to new installations.
Given that ifupdown is no longer installed by default, its commands will not be present:
ifup
andifdown
are thus unavailable, replaced byip link set $device up
andip link set $device down
.The
networkctl
command is also available for users to see a summary of the network devices.networkctl
status will display the current global state of IP addresses on the system; andnetworkctl status $device
can display the details specific to a network device.For more information about netplan, please refer to the manual page using the
man 5 netplan
command.
그리고 찾다보니 이건 Ubuntu에서만 사용하는 프로젝트로 보이는데… 다른 배포판에서는 사용될 확률이 높지는 않으니… 이것참…
아래 내용은 정리해둔거고, 나중에 man 페이지나 정리해서 올려둬야겠다.
virtbr0
, lxdvr0
)를 패키지화 할 수 있도록 멀티 구성 파일에 대한 지원을 하거나, NetworkManager를 이용하여 모든 것을 사용하도록 글로벌 기본 정책을 변경할 수 있어야한다.apt purge network-manager
를 할 수 있는 유연성을 유지해야한다.netplan generate
: /etc/netplan에 renderer에 대한 구성들을 생성한다.netplan apply
: renderer에 대한 구성들을 적용하고, 필요에따라 재시작한다.netplan ifupdown-migrate
: /etc/network/interfaces 의 내용을 마이그레이션 한다.$ ip link set $dev up
$ ip link set $dev down
network:
version: 2
renderer: networkd
ethernets:
enp3s0:
addresses:
- 10.10.10.2/24
dhcp4: no
Ubuntu 서버 설치 이미지로 부팅시 grub (e
버튼을 클릭해서 수정하거나, F6을 눌러 bootspash로 들어가서)에서 preseeding 설정으로 netcfg/do_not_use_netplan=true
명령을 추가해줍니다.