INSYS Smart Devices (routers) with icom OS provide an integrated Linux environment with the icom SmartBox that is able to virtualise own, independent systems using Linux containers (LXC).

Situation

A container with a Debian Linux distribution is to be installed in the icom SmartBox of an INSYS Smart Device. The container shall run in the local network (Local LAN) like an independent Linux PC.

You may proceed in a similar manner for the installation of other exemplary containers from INSYS icom. For information about the creation of own containers refer to the Edge Computing page.

Solution

An INSYS Smart Device (industrial router) forms the central element of a network. The router will be configured via a PC in a separate configuration network (Config). The router has been configured using the startup wizard such that it is able to act as a WAN (Internet) gateway for a local network (Local LAN). Several system components are located in this local network including a PC. Now, a Linux container (LCX) will be created in the router that runs a Debian Linux distribution. This container shall act like an independent computer in the local network, be accessible and have access to the WAN.

cg lxc container

Router configuration

It is recommended to commission the router as suggested in the Quick Installation Guide. Different settings of the router may result in necessary adjustments of the settings described in the following.

It is prerequisite that you have access to the web interface of the router and the container file is stored on your computer. The container file is available for download in the INSYS Knowledge Base.

  1. Open web interface of the router using a browser:

    • 192.168.1.1

    • User name: insys (default)

    • Password: icom (default)

  2. In the AdministrationContainer menu, click on Browse in the Import container section.

  3. Select the container file and click on Import container.
    The container will be imported.

  4. Generate a configuration for the imported container (). [1]

  5. Configure the imported container ():

    • User group for CLI without authentication: Read/Write

    • Bridge to IP net: net2 - LAN

    • IPv4 address: 192.168.2.22/24 [2]

  6. Save settings

  7. Activate profile by clicking the blinking gear in the title bar ().

Container configuration

For the configuration of the application in the container, it is necessary to change to a computer that is in the same local network as the container (not in the configuration network any more). The container is active and accessible directly after configuration and activation of the profile.

A terminal program like PuTTY for example is necesary for access to the container.

  1. Set up an SSH connection to the container using the terminal program:

    • IP address: 192.168.2.22

    • Port: 22

    • Login: root

    • Password: root

login as: root
root@192.168.2.22's password:
Linux container1 4.4.41 #2 Thu Jan 12 11:18:38 CET 2017 armv7l
#######################################################
#                                                     #
#        Welcome to the Debian container!             #
#        --------------------------------             #
#                                                     #
#    Please change the root password now:             #
#        # passwd                                     #
#                                                     #
#    Read the introduction for the next steps:        #
#        # cat readme.txt                             #
#                                                     #
#######################################################

root@container1:~#
  1. Change root password to protect access to the container:
    root@container1:~# passwd

  2. Read readme.txt file in the container
    root@container1:~# cat readme.txt

  3. Configure default gateway in the rc.local file in the /etc directory
    root@container1:~# nano /etc/rc.local
    Change the IP address in the ip route command to the IP address of the router in the local network of the container (in this example 192.168.2.1) for this.

  4. Configure the DNS server in the resolv.conf file in the /etc directory
    root@container1:~# nano /etc/resolv.conf
    Change the IP address in the nameserver command to the IP address of your DNS server for this. This is usually also the IP address of the router in the local network.

Testing the application in the container

After the connection to the container has been established successfully, the connection of the application in the container to the Internet can be checked.

  1. Check the WAN connection to the Internet by updating the Linux environment:
    root@container1:~# apt-get update

A standard Debian Linux distribution is now running in the container of the icom SmartBox. Refer to the developer’s website or many other websites and projects around this distribution for further support and information.


1. This adds a configuration for this container to the profile.
2. The address used here has been selected as an example for a free address in this network and can be changed accordingly. It must be observed that no addresses from the DHCP address pool of the router are used if this acts as DHCP server.