Skip to content

DHCP Network settings

These settings are required for the Linux host system where MCSA for Docker can be installed.

In some network environment it is possible that the Linux host system receives a new IP address after restarting the host system depending on the DHCP client configuration. Therefore, it is recommended to add the following line to the file /etc/dhcp/dhclient.conf of the Linux host system

send dhcp-client-identifier = hardware

Note

This configuration is recommended on SIEMENS SIMATIC IOT2050 Advanced-PG2 with Industrial OS 3.2.2 or higher.

Samba Installation

For transferring the files to the local file transfer folder of a MCSA Docker container, it is required to set up a Samba file share on the Linux host system - for example when files are required to be copied from a Windows system.

Following sections show how Samba can be installed and configured on a Linux host system like Industrial OS V3.2.x.

Package manager configuration

During the initial setup of Industrial OS V3.2.2 or higher if there are no further apt mirrors are added or the apt sources list are not been extended manually, it is required to add the following mirror entries to apt sources lists on the host system before the Samba can be installed.

apt mirror configuration sample: /etc/apt/sources.list.d/sources.list

Debian package feed for Mentor Embedded Linux

  • deb http://ftp.debian.org/debian bullseye main contrib non
  • deb http://ftp.debian.org/debian bullseye-updates main contrib non

Adding a new user for Samba share

A new user can be added other than the already existing different user and can be used for the Samba share.

Below is an example of adding a new user "mindconnect" to the Linux system:

sudo adduser --no-create-home --disabled-password --disabled-login --gecos "" mindconnect
sudo chage -E -1 -M -1 mindconnect

Installing Samba

In the following example Samba is installed without further user interaction.

sudo apt-get --allow-releaseinfo-change update
sudo apt-get -y install debconf-utils
echo "samba-common samba-common/workgroup string WORKGROUP" | sudo debconf-set-selections
echo "samba-common samba-common/dhcp boolean true" | sudo debconf-set-selections
echo "samba-common samba-common/do_debconf boolean true" | sudo debconf-set-selections
sudo apt-get -y install samba

Adding user to Samba

The user needed for the Samba share can be added as follows.

smbpasswd -a -U mindconnect
systemctl stop smbd
systemctl start smbd

Note

'smbpasswd' requests for a password needed to access the Samba share.

Samba Configuration

Example for Samba configuration that is to be added to /etc/samba/smb.conf file to use /persistent_massdata/filetransfer folder as Samba share is shown below.

#======================= Global Settings =======================
[global]
   workgroup = WORKGROUP
#   dns proxy = no
   log file = /var/log/samba/log.%m
   max log size = 1000
   max disk size = 600
   logging = file
   syslog = 0
   panic action = /usr/share/samba/panic-action %d
   server role = standalone server
   passdb backend = tdbsam
   obey pam restrictions = yes
   unix password sync = yes
   passwd program = /usr/bin/passwd %u
   passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
   pam password change = yes
   map to guest = never
   load printers = no
   usershare allow guests = yes
   security = user
#======================= Share Definitions =======================
[filetransfer]
comment = Data Directory
path = /persistent_massdata/filetransfer
guest ok = no
browseable = yes
read only = no
create mask = 0777
directory mask = 0777
force create mode = 777
force directory mode = 777

Note

  • Folder/persistent_massdata/filetransfer is to be created before it can be used as Samba share.
  • The used mask and mode permissions in the sample Samba configuration above shown should be reviewed according to the company requirements.

Restart the Samba daemon after changing /etc/samba/smb.conf file as shown.

systemctl stop smbd
systemctl start smbd

System login Configuration initialization

On some Linux systems by default new files are created with strict file permissions. Therefore, permissions of the files which needs to be copied to the Samba share has to be changed so that they can be accessed from the MCSA Docker container - full read and write file permissions has to be granted.

To avoid changing the file permissions after copying the files to the Samba share, the umask value of the system's login configuration initialization is also be changed in /etc/login.defs file as follows.

UMASK       002

Note

Make sure that the changes done does not violate the company's security requirements.


Last update: January 22, 2024