PG1X WIKI

My Knowledge Base

User Tools

Site Tools


tech:network:cml:2.0:image-configuration-guide:image-configuration-guide

CML 2.0 reflpat ISO Included Images Configuration Guide

This article objective is to provide that initial IP configuration, etc..

Server (Tiny Core Linux)

Shell script.

hostname server-1
ifconfig eth0 172.16.1.11 netmask 255.255.255.0 broadcast 172.16.1.255
route add default gw 172.16.1.1 eth0

WIP: TRex (Alpine Linux)

This configuration example is WIP and INCOMPLETE. So, not works properly.

Shell script?

# this is a shell script which will be sourced at boot
# if you change the hostname then you need to add a
# /etc/hosts entry as well
# hostname inserthostname_here
# like this:
# echo "127.0.0.1   inserthostname_here" >>/etc/hosts
echo "trex-0" >/etc/hostname
cat <<EOF >/etc/network/interfaces
auto lo
iface lo inet loopback
 
auto eth0
iface eth0 inet static
        hostname trex-0
        address 10.1.1.254
        netmask 255.255.255.0
        gateway 10.1.1.1
        #dns-nameservers 8.8.8.8
EOF
service networking restart

Ubuntu (Ubuntu 18.04 Cloud Init Platform)

This image uses cloud-init system for initial configuration.

User-data cannot change an instance’s network configuration.

Unfortunately, User-data based direct network configuration will not work. So, you must configure alternative configuration write Netplan file and call Netplan command directly.

#cloud-config
password: cisco
chpasswd: { expire: False }
hostname: ubuntu-0
ssh_pwauth: True
ssh_authorized_keys:
   - ecdsa-sha2-nistp384 AAAAE2VjZHNhLXNoYTItbmlzdHAzODQAAAAIbmlzdHAzODQAAABhBIbn2VyO9Mby6BwkijQmGfH8O2+Uqewn0/oIOXOxMNgCZiztR3v2o5n1l9ET1GuN7iVMe9whoUiNuZMUVEv0INb+A6Yd0M/37tlWlC+qbIjjqL6UzJAqRISdGP1oVmnV2g== wnoguchi@lasthope.pg1x.net
write_files:
- path: /etc/netplan/51-cloud-init_static.yaml
  permissions: '0644'
  content: |
     network:
        version: 2
        ethernets:
           enp0s2:
              match:
                 name: enp0s2
              addresses:
                 - 10.1.1.253/24
              gateway4: 10.1.1.1
              #nameservers:
              #   addresses:
              #      - 8.8.8.8
runcmd:
   - [ sudo, netplan, generate ]
   - [ sudo, netplan, apply ]

defaults

Image ID Password Elevate privileged user Remarks
Tiny Core Linux tc sudo -Es
Tiny Core Linux cisco cisco sudo -Es
Ubuntu 18.04 ubuntu cisco sudo -i
tech/network/cml/2.0/image-configuration-guide/image-configuration-guide.txt · Last modified: 2020/10/30 19:30 by wnoguchi