Setting Up the DHCP Server for Ubuntu - QuanergySystems/quanergy_client GitHub Wiki
Setting Up the DHCP Server for Ubuntu
NOTE: If you reconnect the sensor to a router or change to a different network, a new IP address may be dynamically assigned to the sensor that overwrites the current IP address.
Set up a DHCP server that can assign IP addresses on the network port of a PC or MacBook host computer, as follows:
- Download an installation script, as follows:
NOTE: Your specific system may not follow these steps exactly, so follow the general method appropriate for your platform to find, download, extract, and open the zipped attachment.
-
Open https://quanergy.desk.com in a web browser such as Firefox:
-
In the Customer Documentation and User Guides list that appears, select the DHCP Server Install Script for Linux item.
-
The new page that opens contains instructions and
quanergy_net_install.zip
file. -
Click the
quanergy_net_install.zip
attachment. In the dialog box that opens, select Save File, and click the OK button (Figure 20).
Figure 20. DHCP Server Installation Script: Download
- In the pop-up window that appears (Figure 20), double-click the quanergy_net_install.zip item. The Downloads folder opens with the zip file in it (Figure 21).
Figure 21. DHCP Server Installation Script: Folder with Zip File
- Double-click the zip file (Figure 21). In the extraction window that appears, click the Extract button (Figure 22).
Figure 22. DHCP Server Installation Script: Extraction Window
- In the window that appears (Figure 23), navigate to your preferred location for saving the extracted file. (It’s fine to leave it in the Downloads folder.)
Figure 23. DHCP Server Installation Script: Assigned Location for Extracted File
- Click the Extract button (Figure 23). The file downloads to the location you previously specified on the local drive (Figure 24).
Figure 24. DHCP Server Installation Script: Extracted File in Downloads Folder
- Open a terminal window (Ctrl+Alt+T), then take the following actions in it to set up the DHCP server:
-
Execute this command to update all required packages:
$
sudo apt-get update
-
When prompted for a password, enter your password.
-
Navigate to the directory where the installation script was extracted into (Figure 25, for example).
-
Execute this command to configure the network to be able to run the SDK (Figure 25):
$
sudo bash quanergy_net_install
-
When prompted for Configure dhcp server? [y/n], type y, and press the Enter key. (If your DHCP server is already set up, this prompt won’t occur.)
-
When prompted for Ethernet interface, decide which Ethernet interface to set up the DHCP server on, which will be the port that is connected to the sensor. (You can use the
ifconfig
command (Figure 26) to list the available interfaces and notice which ones are defined for Ethernet.) From the prompts, type the number corresponding to the desired interface (0
or1
in the Figure 25 example, but your situation may be different), and press the Enter key. -
When prompted for IP address (of the Ethernet port), type
10.0.0.1
(which matches the 10.0.0 subnet, and whose host address is 1) (Figure 25), and press the Enter key.
Figure 25. DHCP Server Installation: Ethernet and IP Address Assignment
- Reboot the virtual machine to apply the changes, making the Ethernet port a DHCP server that can assign IP addresses of 2-255 on the 10.0.0 subnet.
CAUTION: If you connect the sensor to a router or change to a different network, a new IP address may be dynamically assigned to the sensor that overwrites the current IP address.
- Label the hardware for this port “DHCP” to prevent accidental connection to a LAN/internet cable.