In QNAP's containers, there are various types, such as those created through SSH commands, those created through Compose, and those created through LXD. Among them, LXD type containers require setting a static IP and need to be set through the terminal. This article will use the Baota panel as an example to record the setup process.
- On the LXD Baota container page, click on "Connect to Terminal"
- Enter the username and password when prompted. Enter the username "root" and the password "123456" (Note: The password will not be displayed during input. Just keep typing. Also, the password can be set by yourself, and the method is recorded in this blog.)
- Execute the command:
nano /etc/systemd/network/eth0.network
Change it to your own local network IP range. The first one is the IP, the second one is the gateway, and the third and fourth ones are DNS (one line of DNS is also acceptable). The first IP must be followed by a subnet mask, which is /24. For example, change it to:
[Network]
Address=10.10.10.15/24
Gateway=10.10.10.1
DNS=10.10.10.1
DNS=114.114.114.114
or like this:
[Network]
Address=192.168.50.30/24
Gateway=192.168.50.1
DNS=223.5.5.5
DNS=114.114.114.114
Press ctrl+x to save, then enter Y
Press enter as shown in the image below
Type "reboot" and press enter
Everything is OK.