Proxmox – 變更 LXC 虛擬機器網路設定

新增 LXC 虛擬機器時的網路設定

[@more@]建立完成之後,如果要修改網路設定,並不是在 LXC 虛擬機器中設定,
如:
Ubuntu Linux:
/etc/network/interfaces
CentOS Linux:
/etc/sysconfig/network-scripts/ifcfg-eth0

而是在
選擇 LXC 虛擬機器 / Network / net0 / Edit 中做設定

進行修改

或直接修改設定檔 /etc/pve/lxc/102.conf
固定 IP
# cat /etc/pve/lxc/102.conf
arch: amd64
cores: 1
hostname: Ubuntu1604
memory: 512
net0: name=eth0,bridge=vmbr0,gw=192.168.1.254,hwaddr=9E:5B:BC:13:35:A7,ip=192.168.1.228/24,ip6=dhcp,type=veth
ostype: ubuntu
parent: OK
rootfs: local-lvm:vm-102-disk-1,size=15G
swap: 512

DHCP 取得 IP
# cat /etc/pve/lxc/102.conf
arch: amd64
cores: 1
hostname: Ubuntu1604
memory: 512
net0: name=eth0,bridge=vmbr0,hwaddr=
9E:5B:BC:13:35:A7,ip=dhcp,ip6=dhcp,type=veth
ostype: ubuntu
rootfs: VM:102/vm-102-disk-1.raw,size=15G
swap: 512