PicOS Installation and Getting Started

PicOS Installation and Getting Started January, 2015 Version: 4 www.pica8.com Pica8, Inc. 1032 Elwell Court, Suite 105 [email protected] support@pica...
15 downloads 2 Views 151KB Size
PicOS Installation and Getting Started January, 2015 Version: 4

www.pica8.com

Pica8, Inc. 1032 Elwell Court, Suite 105

[email protected] [email protected]

Palo Alto, CA. 94303 +1 (650) 614-5838

© Copyright 2015 Pica8 Inc. Pica8 is a registered trademark of Pica8 Incorporated, PicOS is a trademark of Pica8 Incorporated. All rights reserved. All other trademarks are property of their respective owners.

Contents Getting Started

5

Initial Switch Access Console Port

5 5

Ethernet Management Port

5

Boot Process and U-Boot environmnent Modifying U-Boot Parameters

5 6

User Log In

7

Modify the Pica8 Mode

9

PicOS Licenses

12

Terminology

12

Licenses Speed

12 13

Mode

13

Accessing your Hardware ID

13

Installing the License Displaying the license information

13 15

Removing a License

16

Installing PicOS on Baremetal switches

17

Upgrading using a DHCP server

17

Upgrading using a manual command

20

The way of upgrading after installing PicOS via onie:

20 21 21

Upgrading PicOS from Release 2.1 or later

22

Upgrade the full PicOS image

22

Upgrade the system via Debian packages

23

Upgrading PicOS from Release 2.0 or earlier

26

Platform P-3297

26

Platform P-3920

28

Platform P-3922

32

Platforms P-3295, P-3290 and P-3780

36

PicOS Password Recovery

41

P3290/P3295/P3780

41

P3922

43

P3297

44

P3930

46

P3920

48

PicOS Installation and Getting Started

Getting Started PicOS Licenses Installing PicOS on Baremetal switches Upgrading PicOS from Release 2.1 or later Upgrading PicOS from Release 2.0 or earlier PicOS Password Recovery

4

PicOS Installation and Getting Started

Getting Started Initial Switch Access Initial configuration of the switch requires you to connect either a terminal or computer to the switch via the console port. Once connected, assign an IP address to the management port and establish an IP route to the gateway. Important things to know: The console port provides serial access to the switch. The Ethernet management port is used for out-of-band network management tasks. Before using a management port for the first time, an IP address must be assigned to that port.

Console Port The console port is located at the front of the switch (see Figure 1). You can connect a terminal or computer to the console port using a serial or RS-232 cable. The accessory kit includes an RJ-45 to DB-9 adapter cable. Port Settings When connecting a terminal or computer to the console port, use the following settings: The baud rate is 115200. The data bits value is 8. The stop bits value is 1.

Ethernet Management Port Pica8 switches provide one or two Ethernet management ports for configuring the switch and managing the network out-of-band (see Figure 1). Only one port is required to manage the switch.

Figure 1 The switch's Console and Management Ports

Boot Process and U-Boot environmnent Best practice recommends you verify your switch is properly connected to the console port with the correct baud rate, data bits and stop bits values. The correct values are: The baud rate is 115200 The data bits value is 8 The stop bits value is 1 Below is an example of the auto boot-up sequence.

5

PicOS Installation and Getting Started

U-Boot 1.3.0 (Sep 8 2014 - 16:39:03) CPU: 8541, Version: 1.1, (0x80720011) Core: E500, Version: 2.4, (0x80200020) Clock Configuration: CPU: 825 MHz, CCB: 330 MHz, DDR: 165 MHz, LBC: 41 MHz L1: D-cache 32 kB enabled I-cache 32 kB enabled I2C: ready DRAM: Initializing initdram robin1 initdram robin2 robin before CFG_READ_SPD robin after CFG_READ_SPD initdram robin3 DDR: 512 MB FLASH: 32 MB L2 cache 256KB: enabled In: serial Out: serial Err: serial Net: TSEC0, TSEC1 IDE: Bus 0: OK Device 0: Model: CF 512MB Firm: 20060911 Ser#: TSS25016070309051750 Type: Hard Disk Capacity: 495.1 MB = 0.4 GB (1014048 x 512) Hit any key to stop autoboot: 5

Modifying U-Boot Parameters To modify the baud rate or the other parameters, interrupt the auto boot-up by hitting any key during the autoboot sequence. Once the boot sequence is interupted, you are in the U-Boot shell. U-Boot (Universal Bootloader) is an open source, primary boot loader used in embedded devices. The most common command in U-Boot are: help - to get command line help printenv - To show all the environment variables (The U-Boot environment is a block of memory that is kept on persistent storage and copied to RAM when U-Boot starts. It is used to store environment variables which can be used to configure the system.) version - to show the U-Boot version setenv - to set an environment variable saveenv - Save the modification in the environment memory. Then use the set and save commands to reset your values. In the example below, the baud rate is set to 11520 with the setenv baudrate 11520 command. Do not interrupt the default autoboot sequence unless you are fixing the file system, or changing the console port settings (refer to the PicOS Installation and Getting Started guide regarding upgrading or downgrading a Pica8 Switch).

6

PicOS Installation and Getting Started

=> set baudrate115200 => save Saving Environment to Flash... Un-Protected 1 sectors Erasing Flash... . done Erased 1 sectors Writing to Flash... done Protected 1 sectors => reset

User Log In PicOS has operates in two modes. L2/L3 Mode The default mode for minimal Open vSwitch (OVS) and traditional Layer 2 / Layer 3 protocols. Open vSwitch (OVS) mode The Switch is completely dedicated to Open vSwitch. The system has one default users: admin. The default password for admin is pica8, but by default the password has expired (so a first user connecting the switch will have to enter a new password, and new password should have at least 6 characters). Login admin/pica8 will bring the user in Linux shell in L2/L3 Mode and can use command “cli” launch the L2/L3 CLI. The root account password is locked (non-existent). This means that users would have to use “sudo” to obtain root privilege.

XorPlus login: admin Password: (input default password "pica8") You are required to change your password immediately (root enforced) Changing password for admin. (current) UNIX password: (input "pica8" again) Enter new UNIX password: (input new password: the new password should be no less than six) Retype new UNIX password: (input new password again) admin@XorPlus$ admin@XorPlus$ admin@XorPlus$cli Synchronizing configuration...OK. Pica8 PicOS Version 2.3.0 Welcome to PicOS L2/L3 on XorPlus admin@XorPlus>

If user update the PicOS with saved configuration, we supposed that the user has changed the password, and it is saved in the configuration file. Then we should not force the user to re-set the password again. If user update the PicOS without saved configuration, then user need to set the password

7

PicOS Installation and Getting Started

XorPlus login: admin Password: admin@XorPlus$ admin@XorPlus$cli Synchronizing configuration...OK. Pica8 PicOS Version 2.3.0 Welcome to PicOS L2/L3 on XorPlus admin@XorPlus>

When users forget the password, the password recovery process (throught the console port) is described in the related documentation. Assign an IP address and Connect with SSH The fastest way to configure an IP address after the first connection is usually to use the Linux shell commands (an alternative would be to log in the CLI via the command "cli" and assign an IP address through the CLI. Here is an example with a DHCP server available. Once the Switch has an IP address, you can access it via SSH.

admin@PicOS-OVS$sudo ifdown eth0 && sudo ifup -v eth0 Internet Systems Consortium DHCP Client 4.2.4 Copyright 2004-2012 Internet Systems Consortium. All rights reserved. For info, please visit https://www.isc.org/software/dhcp/ Listening on LPF/eth0/08:9e:01:53:78:86 Sending on LPF/eth0/08:9e:01:53:78:86 Sending on Socket/fallback DHCPRELEASE on eth0 to 172.16.0.1 port 67 Configuring interface eth0=eth0 (inet) run-parts --verbose /etc/network/if-pre-up.d run-parts: executing /etc/network/if-pre-up.d/ethtool dhclient -1 -v -pf /run/dhclient.eth0.pid -lf /var/lib/dhcp/dhclient.eth0.leases eth0 Internet Systems Consortium DHCP Client 4.2.4 Copyright 2004-2012 Internet Systems Consortium. All rights reserved. For info, please visit https://www.isc.org/software/dhcp/ Listening on LPF/eth0/08:9e:01:53:78:86 Sending on LPF/eth0/08:9e:01:53:78:86 Sending on Socket/fallback DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 2 DHCPREQUEST on eth0 to 255.255.255.255 port 67 DHCPOFFER from 172.16.0.1 DHCPACK from 172.16.0.1 bound to 172.16.0.126 -- renewal in 70452 seconds. run-parts --verbose /etc/network/if-up.d run-parts: executing /etc/network/if-up.d/ethtool run-parts: executing /etc/network/if-up.d/mountnfs run-parts: executing /etc/network/if-up.d/ntpdate run-parts: executing /etc/network/if-up.d/openssh-server run-parts: executing /etc/network/if-up.d/upstart

8

PicOS Installation and Getting Started

Connection Management Pica8 switch supports three connection methods: • console • SSH • Telnet The switch always enables console and SSH. Telnet is disabled by default.

User login via console port:

Pica8@dev:~$ telnet 192.168.10.123 2030 Trying 192.168.10.123... Connected to 192.168.10.123. Escape character is '^]'. XorPlus login: admin

Admin user login via ssh:

Pica8@dev:~$ ssh 192.168.50.10 -l admin [email protected]'s password: admin@XorPlus$

Admin user login via telnet:

Pica8@dev:~$ telnet 192.168.50.10 Trying 192.168.50.10...

telnet: Unable to connect to remote host: Connection refused By default, login with root to telnet or ssh is forbidden. You can enable telnet or ssh root-login allow if you need.

Idle-timeout The idle-timeout command configures the connection timeout period for connection sessions. The connection timeout period defines the interval between a user’s most recently entered command and an automatic connection shutdown. You can configure the values.

XorPlus login: admin Password: admin@XorPlus$ admin@XorPlus$cli Synchronizing configuration...OK. Pica8 PicOS Version 2.3 Welcome to PicOS L2/L3 on XorPlus admin@XorPlus> set cli idle-timeout 0 admin@XorPlus>

Modify the Pica8 Mode Modify the Pica8 Mode via an interactive Script 9

PicOS Installation and Getting Started

Another option to modify the PicOS mode (OVS or L2/L3) is to use the built-in interactive script that will modify the PicOS configuration file automatically. You have to log as root user and use the command “picos_boot”. The switch will display the software menu as follows:

XorPlus login: admin Password: admin@XorPlus$sudo picos_boot Please configure the default system start-up options: (Press other key if no change) [1] PicOS L2/L3 [2] PicOS Open vSwitch/OpenFlow [3] No start-up options * default Enter your choice (1,2,3):

Option 1, PicOS L2/L3 is XorPlus. When you choose option1, after a reboot PicOS will load XorPlus. Option 2, Open vSwitch (OVS), is an open source project ported to PicOS (refer to PicOS OVS Configuration Guide for details) when you choose option2, after a reboot PicOS will load Open vSwitch.

An alternative to reboot the switch is to reload the PicOS service. To restart the PicOS service, use the command:

service picos restart

This configuration guide is describing the behavior of PicOS in L2/L3 Mode (Option 1). In L2/L3 mode, the login session should look like the following:

Synchronizing configuration...OK. Pica8 PicOS Version 2.1 Welcome to PicOS L2/L3 on XorPlus admin@XorPlus>

Modify the Pica8 Mode via the Pica8 Configuration File The PicOS main configuration file can be found at :

/etc/picos/picos_start.conf

To change the mode (OVS or L2/L3), you have to change the Option "picos_start" in this file (via an editor like vi) and restart the PicOS Service.

picos_start=ovs

With this option, the system will be used in OVS mode.

10

PicOS Installation and Getting Started

picos_start=xorpplus

With this option, the system will be used in L2/L3 mode (or XORP Plus). Once the configuration file has been updated, you need to restart the PicOS service to activate the modification (or restart the switch). To restart the PicOS service, use the command:

service picos restart

In L2/L3 mode, the login session should look like the following:

Synchronizing configuration...OK. Pica8 PicOS Version 2.3 Welcome to PicOS L2/L3 on XorPlus admin@XorPlus>

11

PicOS Installation and Getting Started

PicOS Licenses PicOS can be installed on bare-metal switches listed in Pica8 Hardware Compatibility list. A software license is needed to activate PicOS on the specific switch it has been installed to. Please read the PicOS License FAQ for further information about the licensing scheme. Starting in PicOS 2.4, if no license is installed on the switch, only the first 4 ports of the switch can be used. This is also the perfect way to test PicOS without buying a full license.

You can download licenses for your switches on the license portal.

Terminology The following terms are used throughout this licensing section. Base License –This license is required on any switch Bundle –The license that includes all PicOS features. That is, it bundles all three licenses Evaluation License –There is no evaluation license per se. You can evaluate PicOS without a license, however only the first 4 ports are active (and the management port) Hardware ID –This ID is needed when you download a license. You can view your switch ID by executing the license show command license -s Mode –There are two license modes: switch license and site license Type –There are two speed types; 1G and 10G

Licenses multi-tier licensing allows you to install just the features you need or all the features provided by PicOS. Each license contains unique features. The license types are: Base Network Linux, Layer 2, Multi-chassis Link Aggregation (MLAG), Simple Network Management Protocol (SNMP), Security, Zero Touch Provisioning (ZTP)and Static Route. This license is required. Layer 3 Open Shortest Path First (OSPF), Border Gateway Protocol (BGP), Protocol-Independent Multicast (PIM), Network Address Translation (NAT), Virtual Extensible LAN (VXLAN) OpenFlow Open vSwitch Database Management Protocol (OVSDB), OpenFlow releases 1.3 and 1.4, MPLS, CrossFlow, VXLAN and CrossFlow Base, Layer 3, and OpenFlow

12

PicOS Installation and Getting Started

This license bundles all the PicOS features into one license

Speed There are two speeds available for each license. 1GE platform with 48*1GE or 48*1GE+4*10GE 10GE platform with 48*10GE + 4*40GE or 32*40GE

Mode Switch--Use this to install your license on one switch only Site--Use this to install the same license on all of your switches at your site

Accessing your Hardware ID You must have your hardware ID number to download a license. A utility generates your switch's hardware ID using the license show command license -s

admin@PicOS-OVS$license -s No license installed. Use below information to create a license. Type: 1GE Hardware ID: E385-FB53-4D57-05EB

Installing the License

If you update the switch from a previous version to PicOS 2.4 without license installed, only the first 4 ports of the switch will be available after the upgrade. To upgrade the switch without production impact, it is recommended to install a license before the upgrade. It is possible to install a license in PicOS 2.3 (starting in PicOS 2.3.3). So to upgrade the switch to PicOS 2.4, it might be necessary to a step upgrade to PicOS 2.3 to install a license on the system. To avoid this step, you can install a script on PicOS that can install the license on prior releases (please ask the support team to provide this script).

Customers can download the generated license file and copy it to /etc/picos/. In the following example, the license file js.lic could be generated according to either switch based or site based and the type is IGE and the feature is Base Product & Layer3 & Open Flow. Hardware ID is unique for each switch. The switch cannot update a newer PicOS version whose built date is later than the expired date of the license. Switch based: { "Type": "1GE", "Feature":["Open Flow", "Base Product", "Layer3"], 13

PicOS Installation and Getting Started

"Hardware ID":"8A68-A7AC-D702-70D2", "Expire Date":"2020-10-28" } Site based: { "Type": "1GE", "Feature":["Open Flow", "Base Product", "Layer3"], "Mode":"site", "Site Name":"CompanyA", "Expire Date":"2020-10-28" } The license file is js.lic and it can be installed by the new utility, license, with option -i. The switch need to be restarted to activate a new license

admin@XorPlus$cd /etc/picos admin@XorPlus$ll total 32 drwxrwxr-x 2 root xorp 4096 Feb 4 22:00 drwxrwxr-x 60 root xorp 4096 Feb 4 21:56 -rw-rw-r-- 1 root xorp 26 Feb 4 18:27 -rw-r--r-- 1 root root 399 Feb 4 21:59 -rw-rw-r-- 1 root xorp 247 Sep 4 2014 -rw-rw-r-- 1 root xorp 183 Aug 10 2014 -rw-rw-r-- 1 root xorp 488 Feb 4 18:28 -rw-r--r-- 1 root root 251 Feb 4 22:00 admin@XorPlus$sudo license -i js.lic Install successfully. admin@XorPlus$ll total 32 drwxrwxr-x 2 root xorp 4096 Feb 4 22:00 drwxrwxr-x 60 root xorp 4096 Feb 4 21:56 -rw-rw-r-- 1 root xorp 26 Feb 4 18:27 -rw-rw-r-- 1 root xorp 247 Sep 4 2014 -rw-rw-r-- 1 root xorp 183 Aug 10 2014 -rw-r--r-- 1 root root 382 Feb 4 22:00 -rw-rw-r-- 1 root xorp 488 Feb 4 18:28 -rw-r--r-- 1 root root 251 Feb 4 22:00 -rw-r--r-- 1 root root 251 Feb 4 22:00 admin@XorPlus$

./ ../ fs_status js.lic license.conf p2files.lst picos_start.conf public.key

./ ../ fs_status license.conf p2files.lst pica.lic picos_start.conf public.key switch-public.key

If public.key cannot be found:

admin@XorPlus$sudo license -i js.lic Install failed: Cannot find public key.

If license file does not exist :

14

PicOS Installation and Getting Started

admin@XorPlus$sudo license -i js.lic Install failed: No such file or directory.

If the header or the key is disrupted:

admin@XorPlus$sudo license -i js.lic Install failed: License or KEY is disrupted.

If license format is invalid:

admin@XorPlus$sudo license -i js.lic Install failed: License format error.

If license file is not compatible with this switch(verify failed):

admin@XorPlus$sudo license -i js.lic Install failed: Invalid license.

Displaying the license information Switch based:

admin@XorPlus$license -s { "Type": "1GE", "Feature": ["Open Flow", "Base Product", "Layer3"], "Expire Date": "2020-10-28", "Hardware ID": "8A68-A7AC-D702-70D2" }

Site based:

admin@XorPlus$license -s { "Type": "1GE", "Feature": "Expire Date": "Hardware ID": "Site Name": }

["Base Product", "Layer3", "Open Flow"], "2020-10-28", "8A68-A7AC-D702-70D2", " google "

If license is invalid:

admin@XorPlus$license -s Invalid license. Use below information to create a license. Type: 1GE Hardware ID: 8A68-A7AC-D702-70D2 admin@PicOS-OVS$

15

PicOS Installation and Getting Started

If no license had been installed:

admin@XorPlus$license -s No license installed. Use below information to create a license. Type: 1GE Hardware ID: 8A68-A7AC-D702-70D2 admin@PicOS-OVS$

Removing a License admin@XorPlus$ll total 32 drwxrwxr-x 2 root xorp 4096 drwxrwxr-x 60 root xorp 4096 -rw-rw-r-- 1 root xorp 26 -rw-rw-r-- 1 root xorp 247 -rw-rw-r-- 1 root xorp 183 -rw-r--r-- 1 root root 382 -rw-rw-r-- 1 root xorp 488 -rw-r--r-- 1 root root 251 -rw-r--r-- 1 root root 251 admin@XorPlus$pwd /etc/picos admin@XorPlus$ admin@XorPlus$license -r admin@XorPlus$ll total 28 drwxrwxr-x 2 root xorp 4096 drwxrwxr-x 60 root xorp 4096 -rw-rw-r-- 1 root xorp 26 -rw-rw-r-- 1 root xorp 247 -rw-rw-r-- 1 root xorp 183 -rw-rw-r-- 1 root xorp 488 -rw-r--r-- 1 root root 251 -rw-r--r-- 1 root root 251 admin@XorPlus$

Feb 4 22:00 ./ Feb 4 21:56 ../ Feb 4 18:27 fs_status Sep 4 2014 license.conf Aug 10 2014 p2files.lst Feb 4 22:00 pica.lic Feb 4 18:28 picos_start.conf Feb 4 22:00 public.key Feb 4 22:00 switch-public.key

Feb 4 22:05 ./ Feb 4 21:56 ../ Feb 4 18:27 fs_status Sep 4 2014 license.conf Aug 10 2014 p2files.lst Feb 4 18:28 picos_start.conf Feb 4 22:00 public.key Feb 4 22:00 switch-public.key

If license is modified or removed, the switch should be reboot and then new license can be efficient.

16

PicOS Installation and Getting Started

Installing PicOS on Baremetal switches PicOS can be installed on any switch listed in our Hardware compatibility list. ONIE (Open Network Install Environment) is used to install PicOS on those devices. This is why those Baremetal switches should be pre-loaded with ONIE. ONIE is a simple extension to the boot loader (U-Boot) that enable 3rd party Operating system to be loaded on the equipment.

Upgrading using a DHCP server The typical installation procedure is like this: 1) Connect the switch to a DHCP and HTTP Server 2) Download a PicOS installer image on the HTTP server 3) Configure the DHCP server to point to the image to be loaded 4) Power up the switch Here is an example of PicOS installation on an Edge-core AS5610-52X pre-loaded with Onie. step1: Check the box is onie box or not.Input "printenv" at uboot prompt, if the information contains "onie parameter", such as onie_initargs, onie_machine,then the box is onie box.

17

PicOS Installation and Getting Started

autoload=no baudrate=115200 bootargs=root=/dev/ram rw console=ttyS0,115200 quiet bootcmd=run check_boot_reason; run nos_bootcmd; run onie_bootcmd bootdelay=10 check_boot_reason=if test -n $onie_boot_reason; then setenv onie_bootargs boot_reason=$onie_boot_reason; run onie_bootcmd; fi; consoledev=ttyS0 ethact=eth0 ethaddr=70:72:CF:12:34:56 ethprime=eth0 gatewayip=192.168.1.10 hostname=es5652bt2_zz-unknown ipaddr=192.168.1.10 loadaddr=0x2000000 loads_echo=1 netmask=255.255.255.0 nos_bootcmd=echo onie_args=run onie_initargs onie_platformargs onie_bootcmd=echo Loading Open Network Install Environment ...; echo Platform: $onie_platform ; echo Version : $onie_version ; cp.b $onie_start $loadaddr ${onie_sz.b} && run onie_args && bootm ${loadaddr}#$platform onie_dropbear_dss_host_key=begin-base64@600@d#AAAAB3NzaC1kc3MAAACBAOobHLB9LAriKbuocGK78ym bootargs quiet console=$consoledev,$baudrate onie_platformargs=setenv bootargs $bootargs serial_num=${serial#} eth_addr=$ethaddr $onie_bootargs $onie_debugargs onie_rescue=setenv onie_boot_reason rescue && boot onie_start=0xefc00000 onie_sz.b=0x00360000 onie_uninstall=setenv onie_boot_reason uninstall && boot onie_update=setenv onie_boot_reason update && boot onie_vendor_id=259 onie_version=1.6.1.4 pcidelay=1000 serial#=S12345689 serverip=192.168.1.99 stderr=serial stdin=serial stdout=serial ver=U-Boot 2013.01.01-g4fb2477-dirty (Nov 08 2013 - 19:13:14) - 3.0.3.1 Environment size: 2732/65532 bytes LOADER=>

Step2: DHCP server configure and start dhcp server service:

host pica8-3922 { hardware ethernet 70:72:cf:12:34:56; fixed-address 192.168.2.50; option default-url = "http://192.168.2.42/onie-installer-powerpc.bin"; }

Step3: Installer.bin on HTTP server:

root@dev:/var/www# ls index.html onie-installer-powerpc.bin

18

PicOS Installation and Getting Started

Step4: Install PicOS via onie: Input command "run onie_bootcmd", then PicOS will be installed automatically.

LOADER=> run onie_bootcmd Loading Open Network Install Environment ... Platform: powerpc-accton_5652-r1 Version : 1.6.1.3 WARNING: adjusting available memory to 30000000 ## Booting kernel from Legacy Image at 02000000 ... Image Name: as5600_52x.1.6.1.3 Image Type: PowerPC Linux Multi-File Image (gzip compressed) Data Size: 3514311 Bytes = 3.4 MiB Load Address: 00000000 Entry Point: 00000000 Contents: Image 0: 2762367 Bytes = 2.6 MiB Image 1: 733576 Bytes = 716.4 KiB Image 2: 18351 Bytes = 17.9 KiB Verifying Checksum ... OK ## Loading init Ramdisk from multi component Legacy Image at 02000000 ... ## Flattened Device Tree from multi component Image at 02000000 Booting using the fdt at 0x02355858 Uncompressing Multi-File Image ... OK Loading Ramdisk to 2ff4c000, end 2ffff188 ... OK Loading Device Tree to 03ff8000, end 03fff7ae ... OK Cannot reserve gpages without hugetlb enabled setup_arch: bootmem as5600_52x_setup_arch() arch: exit pci 0000:00:00.0: ignoring class b20 (doesn't match header type 01) sd 0:0:0:0: [sda] No Caching mode page present sd 0:0:0:0: [sda] Assuming drive cache: write through sd 0:0:0:0: [sda] No Caching mode page present sd 0:0:0:0: [sda] Assuming drive cache: write through sd 0:0:0:0: [sda] No Caching mode page present sd 0:0:0:0: [sda] Assuming drive cache: write through ONIE: Using DHCPv4 addr: eth0: 192.168.2.77 / 255.255.255.0 discover: installer mode detected. Running installer. Please press Enter to activate this console. ONIE: Using DHCPv4 addr: eth0: 192.168.2.77 / 255.255.255.0 ONIE: Starting ONIE Service Discovery ONIE: Executing installer: http://192.168.2.42/picos-2.4-P3924-16656.bin Verifying image checksum ... OK. Preparing image archive ... OK. PicOS installation .............................................. ./var/local/ ./var/run Setup PicOS environment ... .............................................. XorPlus login: admin Password: You are required to change your password immediately (root enforced) Changing password for admin. (current) UNIX password:

19

PicOS Installation and Getting Started

Enter new UNIX password: Retype new UNIX password: admin@XorPlus$ admin@XorPlus$cli Synchronizing configuration...OK. Pica8 PicOS Version 2.4 Welcome to PicOS L2/L3 on XorPlus admin@XorPlus> admin@XorPlus> configure Entering configuration mode. There are no other users in configuration mode. admin@XorPlus# admin@XorPlus# run show version Copyright (C) 2009-2014 Pica8, Inc. Base ethernet MAC Address : 70:72:cf:9d:6f:fb Hardware Model : P-3924 PicOS L2/L3 Version : 2.4 Revision ID : 16656 Released Date : 08/06/2014 admin@XorPlus#

Upgrading using a manual command An alternative for a lab setup is to use the onie rescue mode: 1) reboot the switch and interupt the U-boot as described in this section. 2) From uBoot prompt, boot ONIE in rescue mode

LOADER=> run onie_rescue

3) run this command to manually install a NOS:

ONIE# onie-nos-install http:///picos.bin

The installer runs. After a reboot the system will come up running the new Network Operating system.

The way of upgrading after installing PicOS via onie: After installing PicOs via onie, and then you can also use onie upgrading the PicOS image or use other ways to upgrade. When using the two way of upgrading, the switch must have two partitions

1) Via manual way

20

PicOS Installation and Getting Started

admin@XorPlus$sudo scp [email protected]:/tftpboot/build/daily/3922/picos-2.4-P39 22-18304.tar.gz /cftmp admin@XorPlus$sync admin@XorPlus$sudo mv picos-2.4-P3922-18304.tar.gz rootfs.tar.gz admin@XorPlus$sync admin@XorPlus$sudo reboot -f

2) Via upgrading script:(no check md5)

admin@XorPlus$sudo scp [email protected]:/tftpboot/build/daily/3922/picos-2.4-P39 22-18304.tar.gz /cftmp admin@XorPlus$sync admin@XorPlus$sudo upgrade picos-2.4-P922-18304.tar.gz no-md5-check Upgrading P-3295 Upgrade P-3295 started Back up PicOS configuration files /ovs/ovs-vswitchd.conf.db /pica/config/pica_startup.boot Config files saved locally as /cftmp/[email protected] Rebooting in 10 seconds! reboot now!

21

PicOS Installation and Getting Started

Upgrading PicOS from Release 2.1 or later Upgrade the full PicOS image Note :This function is only avaliable at version 2.2 and later. And the switch must be two partitions and this function can work normally. Note: From PicOS 2.4, we are adding a license check. Without license, the system will have only the first 4 ports working. So ,there is a list of upgrade and license relationship : 1) It has no license when the switch has no license before upgrading. 2) It will save the license when the switch has license before upgrading. 3) If the license is expired, the upgrade will be failed.

By default, there is a shell script named with "upgrade.sh" in "/pica/bin/shell" directory, users can execute this script by command "upgrade" in bash. This script will upgrade the image and back up configuration files automatically. You should according to pico-2.4-image-upgrade-guide to change the image if you need to downgrade. Or you can get the image and md5 file to /cftmp directory, then rebooting to downgrade (You should back up the configuration file manually if you need). Usage:

admin@XorPlus$sudo upgrade USAGE Upgrade system with local new image SYNOPSIS upgrade [image_name] [no-md5-check] [factory-default] [no-check-license] DESCRIPTION image_name - Image should be saved in /cftmp no-md5-check - Disable check of the image file for MD5 factory-default - recovery the configuration to factory default no-check-license - Disable check of the license admin@XorPlus$

Steps: 1) Downloading new image to /cftmp dir. By default this script will checking image MD5, it needs MD5 file in /cftmp directory, you can use the parameter of "no-md5-check" to disable MD5 checking, otherwise the script will abort. By default this script will checking license, it needs users apply one license of the switch, you can use the parameter of "no-check-license" to disable license checking, otherwise the script will abort.

2) Executing upgrade script. The image_name should be consistent with the platform, otherwise the script will abort.

For example (P-3295 switch): A: upgrading and checking MD5

22

PicOS Installation and Getting Started

admin@XorPlus$sudo upgrade picos-2.4-P3295-13912.tar.gz Upgrading P-3295 Upgrade P-3295 started Checking MD5 of image MD5 Check OK! Back up PicOS configuration files /ovs/ovs-vswitchd.conf.db /pica/config/pica_startup.boot Config files saved locally as /cftmp/[email protected] Rebooting in 10 seconds! reboot now!

B: only upgrading, not checking MD5

admin@XorPlus$sudo upgrade picos-2.4-P3295-13912.tar.gz no-md5-check Upgrading P-3295 Upgrade P-3295 started Back up PicOS configuration files /ovs/ovs-vswitchd.conf.db /pica/config/pica_startup.boot Config files saved locally as /cftmp/[email protected] Rebooting in 10 seconds! reboot now!

Upgrade the system via Debian packages Note :This function is only avaliable at version 2.3 and later. Note: From PicOS 2.4, we are adding a license check. Without license, the system will have only the first 4 ports working. So ,there is a list of upgrade and license relationship : 1) It has no license when the switch has no license before upgrading. 2) It will save the license when the switch has license before upgrading. 3) If the license is expired, the upgrade will be failed.

A package upgade is only supported over minor releases. It does not support upgrade between major releases. For example: upgrade from version 2.3 to 2.4 is not supported. It supports an upgrade between a version PicOS 2.3.x to version 2.3.y

It is possible to upgrade PicOS Switching and Openflow capacities without updating the Linux system through Debian Packages. This specific upgrade does not need a reboot of the system. User need to get the debian packages from remote host to /cftmp directory, then install the debian package as described below. For example (P-3295 switch): A: install the pica-switching.deb

23

PicOS Installation and Getting Started

admin@XorPlus$sudo scp [email protected]:/home/3295/release/pica8/pronto3295/pica-switching-2.0.6.14792-P3295.deb /cftmp The authenticity of host '1.1.1.1 (1.1.1.1)' can't be established. ECDSA key fingerprint is da:f8:57:72:dc:a0:53:94:4d:22:33:03:b3:6b:e5:e7. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '1.1.1.1' (ECDSA) to the list of known hosts. [email protected]'s password: pica-switching-2.0.6.14792-P3295.deb 100% 35MB 3.2MB/s 00:11 admin@XorPlus$cd /cftmp/ admin@XorPlus$ls pica-switching-2.0.6.14792-P3295.deb admin@XorPlus$ admin@XorPlus$version Copyright (C) 2009-2014 Pica8, Inc. =================================== Hardware Model : P-3295 PicOS Version : 2.0.6 Software Revision : 14790 admin@XorPlus$ admin@XorPlus$sudo dpkg -i pica-switching-2.0.6.14792-P3295.deb Selecting previously unselected package picos-switching. (Reading database ... 16653 files and directories currently installed.) Unpacking picos-switching (from pica-switching-2.0.6.14792-P3295.deb) ... [....] Stopping: PicOS L2/L3............................................... Setting up picos-switching (2.0.6-14792) ... [....] Starting: PicOS L2/L3....................... admin@XorPlus$ admin@XorPlus$version Copyright (C) 2009-2014 Pica8, Inc. =================================== Hardware Model : P-3295 PicOS Version : 2.0.6 Software Revision : 14792 admin@XorPlus$ admin@XorPlus$cli Synchronizing configuration...OK. Pica8 PicOS Version 2.0.6 Welcome to PicOS L2/L3 on XorPlus admin@XorPlus> show version Copyright (C) 2009-2014 Pica8, Inc. Base ethernet MAC Address : 08:9e:01:62:d5:61 Hardware Model : P-3295 PicOS Version : 2.0.6 Revision ID : 14792

B: install the pica-ovs.deb

24

PicOS Installation and Getting Started

admin@PicOS-OVS$ admin@PicOS-OVS$sudo scp [email protected]:/home/3295/release/pica8/pronto3295/pica-ovs-2.0.6.1 4792-P3295.deb /cftmp The authenticity of host '1.1.1.1 (1.1.1.1)' can't be established. ECDSA key fingerprint is da:f8:57:72:dc:a0:53:94:4d:22:33:03:b3:6b:e5:e7. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '1.1.1.1' (ECDSA) to the list of known hosts. [email protected]'s password: pica-ovs-2.0.6.14792-P3295.deb 100% 9635KB 9.4MB/s 00:01 admin@PicOS-OVS$ admin@PicOS-OVS$cd /cftmp/ admin@PicOS-OVS$ls pica-ovs-2.0.6.14792-P3295.deb pica-switching-2.0.6.14792-P3295.deb admin@PicOS-OVS$ admin@PicOS-OVS$version Copyright (C) 2009-2014 Pica8, Inc. =================================== Hardware Model : P-3295 PicOS Version : 2.0.6 Software Revision : 14790 admin@PicOS-OVS$ admin@PicOS-OVS$sudo dpkg -i pica-ovs-2.0.6.14792-P3295.deb (Reading database ... 17228 files and directories currently installed.) Preparing to replace picos-ovs 2.0.6-14972 (using pica-ovs-2.0.6.14792-P3295.deb) ... [....] Stopping web server: lighttpd. [....] Stopping: PicOS Open vSwitch/OpenFlow. Unpacking replacement picos-ovs ... Setting up picos-ovs (2.0.6-14972) ... [....] Stopping enhanced syslogd: rsyslogd. [....] Starting enhanced syslogd: rsyslogd. [....] Stopping internet superserver: xinetd. [....] Restarting OpenBSD Secure Shell server: sshd. [....] Starting: PicOS Open vSwitch/OpenFlow. [....] Starting web server: lighttpd. admin@PicOS-OVS$version Copyright (C) 2009-2014 Pica8, Inc. =================================== Hardware Model : P-3295 PicOS Version : 2.0.6 Software Revision : 14792

25

PicOS Installation and Getting Started

Upgrading PicOS from Release 2.0 or earlier Platform P-3297 All P-3297 are shipped with early 2.0 releases. Users need to upgrade to the latest 2.3 release before the software can automatically provision the system.

BACK UP THE Running Configuration File Before the upgrade, users can back-up the configuration file before upgrading the switch. If users are running the L2/L3 mode, the configuration file is /pica/config/pica_startup.boot. If you are unable to locate it, please enter the following CLI commands to generate it first. If users are running the OVS mode, the configuration files are located in /ovs/ovs-vswitchd.conf.db. Download the PicOS 2.3 Image Download the PicOS 2.3 image for P-3297 from the Pica8 website. Visit http://www.pica8.com/portal/ to register for a Pica8 Portal account. Once the registration is approved, users can login and download the images from the portal. Save the downloaded image at a local TFTP or FTP server. PRepare the USB NAND The boot loader, uBoot, provides the different boot commands to enter either the flash Linux environment or the PicOS system on the CF card. By default, it brings up PicOS. uBoot provides two commands to boot into different environment. One is to the PicOS system and the other to the backup Linux. By default, uBoot boots into PicOS on the first partition.To upgrade to the latest PicOS 2.3, users should manually bring up backup Linux by stopping uBoot. [Note: this prompt appears very soon after the system boots up. Users will need to hit the key fast enough to stop the process]

Hit any key to stop autoboot: 5

At the uBoot prompt, enter the following command to bring up the utility program.

=> run norrescueboot

This boots through a Linux kernel

[root@Kennisis /]#

Setting Up an IP Address In order to download the 2.0 image to the switch, users will need to set up the network connection of the management port. There are two ways to setup the IP address of the management port:

26

PicOS Installation and Getting Started

1. Obtain the IP address through DHCP. 2. Setup a static IP address. If the switch is connected to a DHCP server, enter the following command to obtain the DHCP-assigned IP:

#udhcpc

If a DHCP server is not available, setup a static IP instead:

#ifconfig eth1

Ping the TFTP server first to make sure the network is set up properly. Mounting the USB NAND Flash &Saving Your Running Configuration File Need to mount the PicOS partition on the /mnt directory:

#mount /dev/sda1 /mnt

Cleaning the USB NAND FLASH Change the directory to /mnt, and remove all existing software.

#cd /mnt # rm -rf * .* # sync

Downloading and Installing the PicOS Image Use TFTP or FTP to retrieve the image from a remote server. When using TFTP, enter rootfs.tar.gz for. Users will need the file name of the new image, which should be stored at the TFTP server. Use the file name as . is the IP address of the TFTP server. The process may take several minutes. [Note - Make sure entering the sync command after downloading the file.]

#cd /mnt #tftp -g -l -r ... #sync

When using FTP, use the following syntax.

27

PicOS Installation and Getting Started

#cd /mnt #ftpget -u -p ... #sync

After downloading the image, unzip the compressed image file.

#tar zxvf rootfs.tar.gz ... #sync

[Note – Make sure entering the sync command before restarting the system, otherwise the upgrade process might be incomplete and can lead to corrupted image.]

Finally, reboot the system:

#sync #reboot

[Note - the reboot process may take up to 3 minutes.]

Please refer to section "Upgrade PicOS from 2.0 to 2.x" for instructions for upgrading to 2.x version.

Platform P-3920 Each P-3920 has one flash chip and one SD (Secure Digital) card. The boot loader, uBoot, is stored in the flash chip, while PicOS is installed on the SD card.

Backup the configuration file: Before the upgrade, users can back-up the configuration file before upgrading the switch. If users are running the L2/L3 mode, the configuration file is /pica/config/pica_startup.boot. If users are running the OVS mode, the configuration file is /ovs/ovs-vswitchd.conf.db. Download the PicOS 2.3 Image Download the PicOS 2.x image for P-3920 from the Pica8 website. Visit http://www.pica8.com/portal/ to register for a Pica8 Portal account. Once the registration is approved, users can login and download the images from the portal. Save the downloaded image at a local TFTP or FTP server.

28

PicOS Installation and Getting Started

PRepare the SD Card PicOS 2.3 requires users to partition the SD card into 2 partitions. This will require users to bring up an utility program to perform the disk partition and re-formatting. To bring up the utility program, users need to first stop the boot loader from the booting process. The boot loader, uBoot, provides the different boot commands to enter either the flash Linux environment or the PicOS system on the CF card. By default, it brings up PicOS. Users need to stop the booting process by hit the Enter key at the prompt of "Hit any key to stop autoboot". This will drop into uBoot prompt. [Note: this prompt appears very soon after the system boots up. Users need to hit the Enter key fast enough to stop the process.]

Hit any key to stop autoboot: 5

At the uBoot prompt, enter the following command to bring up the utility program.

=>run flash_bootcmd

This boots through a Linux kernel and stops at a menu of the utility tool as the following,

Please choose which to start. (Will choose active entry if no input in 10 seconds) Current boot mode: normal ===================Main Menu===================== *1 - Start Application (active) 2 - Start Diagnostic Application 3 - Utility ================================================== Enter your choice (1-3): 3 This will bring up the Utility Menu. Enter 7 as your choice: ===================Utility Menu======================== 1 - Format FLASH device to JFFS2 file system 2 - List file 3 - Delete file 4 - Download file 5 - Active file 6 - Reboot 7 - System Shell 8 - Exit ======================================================= Enter your choice (1-8): 7 (none) login: root Password: login[1096]: root login on 'ttyS0'

Use "root" as user and "root123" as password. The switch will then drop into a Linux prompt.

Partition the CF Card Bring up the fdisk tool, which can set up the partition table.

29

PicOS Installation and Getting Started

fdisk /dev/mmcblk0

Check whether the SD card has one partition or two partitions first:

Command (m for help): p Disk /dev/mmcblk0p: 3997 MB, 3997163520 bytes 128 heads, 63 sectors/track, 968 cylinders Units = cylinders of 8064 * 512 = 4128768 bytes Device Boot Start End Blocks Id System /dev/mmcblk0p1 1 631 2544160+ 83 Linux

If it shows one partition as shown above or no partition, please follow the following steps to partition CF card into two partitions. If it shows two partitions, it means that it has been done in factory and you can skip the steps to partition the CF card by issuing command "q" to exit from fdisk and continue on Mount SD Card. [Note - Please pay attention to the total size of the disk. Users will need the disk size when calculating the partition sizes of the new table. The output above shows this is a 4GB SD card.]

If it shows only one partition, enter "d" to delete the old partition.

Command (m for help): d Selected partition 1

Now create the new partition with the "n" command.

Command (m for help): n Command action e extended p primary partition (1-4)

This is where users need to use the recorded SD size. Users need to reserve about 400 MB for partition 2. The rest of the SD card belongs to partition 1. If the size of the SD card is 4GB, partition should be 3.6GB (3600M) and partition 2 is 400M. Since we need both partitions to be bootable, we will need to set both as primary. Enter "p" to select primary partition, and "1" to configure partition 1.

Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-968, default 1): 1 Last cylinder or +size or +sizeM or +sizeK (1-968, default 968): 864

Create partition 2 with the rest of the sectors.

30

PicOS Installation and Getting Started

Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 2 First cylinder (865-968, default 865): Using default value 865 Last cylinder or +size or +sizeM or +sizeK (865-968, default 968): Using default value 968

Enter "w" to write the partition table and exit.

Command (m for help): w

This should complete the disk formatting process. Formatting the file systems We need to format the two partitions into EXT3 file system.

mke2fs -j /dev/mmcblk0p1

Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 26 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override.

mke2fs -j /dev/mmcblk0p2

Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 26 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override.

Mount SD CARD Mount the partition1 and change the working directory to /mnt/sd_card with the following commands:

mount /dev/mmcblk0p1/mnt/sd_card cd /mnt/sd_card

Setting Up an IP Address In order to download the 2.0 image to the switch, users will need to set up the network connection of the management port. There are two ways to setup the IP address of the management port: 1.Obtain the IP address through DHCP. 2.Setup a static IP address. If the switch is connected to a DHCP server, enter the following command to obtain the DHCP-assigned IP:

31

PicOS Installation and Getting Started

#udhcpc

If a DHCP server is not available, setup a static IP instead:

#ifconfig eth0

Ping the TFTP server first to make sure the network is set up properly. Downloading and Installing the PicOS Image Use TFTP or FTP to retrieve the image from a remote server. When using TFTP, enter rootfs.tar.gz for. Users will need the file name of the new image, which should be stored at the TFTP server. Use the file name as . is the IP address of the TFTP server. The process may take several minutes. [Note - Make sure entering the sync command after downloading the file.]

#cd /mnt/sd_card #tftp -g -l -r ... #sync

When using FTP, use the following syntax. #cd /mnt/sd_card #ftpget -u -p … #sync

After downloading the image, unzip the compressed image file.

#tar zxvf rootfs.tar.gz ... #sync

[Note – Make sure entering the sync command before restarting the system, otherwise the upgrade process might be incomplete and can lead to corrupted image.]

Finally, reboot the system: #reboot [Note - the reboot process may take up to 3 minutes.]

Please refer to section "Upgrade PicOS from 2.0 to 2.x" for instructions for upgrading to 2.x version.

Platform P-3922 32

PicOS Installation and Getting Started

All P-3922 are shipped with early 2.0 releases. Users need to upgrade to the latest 2.3 release before the software can automatically provision the system.

BACK UP THE Running Configuration File Before the upgrade, users can back-up the configuration file before upgrading the switch. If users are running the L2/L3 mode, the configuration file is /pica/config/pica_startup.boot If users are running the OVS mode, the configuration files are located in /ovs/ovs-vswitchd.conf.db. Download the PicOS 2.3 Image Download the PicOS 2.3 image for P-3922 from the Pica8 website. Visit http://www.pica8.com/portal/ to register for a Pica8 Portal account. Once the registration is approved, users can login and download the images from the portal. Save the downloaded image at a local TFTP or FTP server. PRepare the USB NAND The boot loader, uBoot, provides the different boot commands to enter either the flash Linux environment or the PicOS system on the CF card. By default, it brings up PicOS. uBoot provides two commands to boot into different environment. One is to the PicOS system and the other to the backup Linux. By default, uBoot boots into PicOS on the first partition.To upgrade to the latest PicOS 2.3, users should manually bring up backup Linux by stopping uBoot. Press Ctrl+C and the Ctrl+U after you see the display below,

Starting Power-On Self Test ..

[Note: this prompt appears very soon after the system boots up. Users need to hit the Enter key fast enough to stop the process.]

This will boot into the backup Linux. When seeing the password prompt, enter mercury, then hit enter:

Password : *******

Hit any key when you see the display below,

Hit any key to stop autoboot: 5

Next, enter the following command to boot up backup Linux:

=>run debian_backup_boot

Press any key to enter the shell when you see the display below:

sd 0:0:0:0: [sda] sd 0:0:0:0: [sda] sda: sda1 sda2 sd sd 0:0:0:0: [sda]

Assuming Assuming 0:0:0:0: Attached

drive cache: write through drive cache: write through [sda] Assuming drive cache: write through SCSI disk

33

PicOS Installation and Getting Started

Mounting the USB NAND Flash &Saving Your Running Configuration File Enter the following command to mount the first partition on the /mnt directory:

# mount /dev/sda1 /mnt

Your current configuration file can be saved before upgrading the image. The configuration files are located in /mnt/pica/config/pica.conf. Unmount the USB NAND flash before partitioning the USB NAND flash:

# umount /dev/sda1 # fdisk /dev/sda

Cleaning the USB NAND FLASH To repartition the USB NAND flash, enter the following command:

#fdisk /dev/sda

The old partition can then be removed with the d command

Command (m for help): d Selected partition 1

A new partition can be created with the n command. Save the information before quitting the fdisk tool. The following command can build the ext3/ext2 file system over the created partition:

#mke2fs -j /dev/sda1

Finally, mount the first partition:

#mount /dev/sda1 /mnt/

Note: The second partition is used for the backup Linux System and cannot be reformatted or repartitioned. If the second partition is repartitioned and reformatted, then files for the backup Linux need to be recovered.

Setting up an IP address There are two ways to set up the IP address of the management port: 1. Obtain the IP address through DHCP. 2. Set up a static IP address. If the switch is connected to a DHCP server, enter the following command to obtain the DHCP-assigned IP:

34

PicOS Installation and Getting Started

#udhcpc

If a DHCP server is not available, set up a static IP instead:

#ifconfig eth0

Check that the switch can ping the server the image is put on. Downloading and Installing the PicOS Image Use TFTP or FTP to retrieve the image from a remote server. When using TFTP, enter rootfs.tar.gz for. Users will need the file name of the new image, which should be stored at the TFTP server. Use the file name as . is the IP address of the TFTP server. The process may take several minutes.

# tftp -g -l -r # sync

[Note - Make sure entering the sync command after downloading the file.]

Or, retrieve the image through ftp:

# ftpget -u -p # sync

The old files of the previous PicOS system need to be removed before installing the new image. Enter the commands as shown below:

# mount /dev/sda1 /mnt/ #rm -rf /mnt/*

If the new image is in the /mnt directory, install the new image as follows:

#cd /mnt

Next, un-tar the image:

# tar zxvf rootfs.tar.gz ... # sync

Do not forget to enter the above sync command before restarting the system, so you can ensure that the data are written back on the SD card.

35

PicOS Installation and Getting Started

[Note – Make sure entering the sync command before restarting the system, otherwise the upgrade process might be incomplete and can lead to corrupted image.]

Finally, reboot the system:

#sync #reboot

[Note - the reboot process may take up to 3 minutes.]

Please refer to section "Upgrade PicOS from 2.0 to 2.x" for instructions for upgrading to 2.x version.

Platforms P-3295, P-3290 and P-3780 Each of P-3290, P-3295, and P-3780 has one flash chip and one CF (compact flash) card. The boot loader, uBoot, is stored in the flash chip, while PicOS is installed on the CF card.

Backup the configuration file: Before the upgrade, users can back-up the configuration file before upgrading the switch. If users are running the L2/L3 mode, the configuration file is /pica/config/pica_startup.boot. If users are running the OVS mode, the configuration file is /ovs/ovs-vswitchd.conf.db. Down load the image: Download the PicOS 2.3 image from the Pica8 website. Visit http://www.pica8.com/portal/ to register for a Pica8 Portal account. Once the registration is approved, you can login and download the images from the portal. [Note – please make sure the downloaded image file is compatible to the system product number. P-3295, P-3290, and P-3780 require different images.]

Save the downloaded image at a local TFTP or FTP server. Prepare the compact flash: PicOS 2.3 requires users to partition the compact flash into 2 partitions. This will require users to bring up an utility program to perform the disk partition and re-formatting. To bring up the utility program, users need to first stop the boot loader from the booting process. The boot loader, uBoot, provides two different boot commands. One is to load the PicOS image and the other to enter the flash Linux. By default, uBoot brings up PicOS. In order to manually upgrade the system, users need to stop the booting process by hit the Enter key at the prompt of "Hit any key to stop autoboot". This will drop into uBoot prompt. [Note: this prompt appears very soon after the system boots up. Users will need to hit the key fast enough to stop the process]

Hit any key to stop autoboot: 5

36

PicOS Installation and Getting Started

At the uBoot prompt, enter the following command to bring up the utility program.

=>run flash_bootcmd

This boots through a Linux kernel and stops at a menu of the utility tool as the following,

Diagnostic Test Main Menu v1.3 (LB9 - Linux) [1 ] File Management [2 ] Board Information [3 ] Diagnostic Test [4 ] Manufacturing Test Mode Set [5 ] Test Error Log File Management [6 ] PING [7 ] Reset [8 ] For Vibration Test

Enter your choice: Input Ctrl+D twice to quit the diagnostic menu (shown below) and to enter the Linux command line interface. Partition the CF Card To ensure the CF card is properly formatted, users should un-mount the CF card first. However, users might get an error message since the CF card may not have been mounted at all. The error message can be ignored in this case.

umount /cf_card

Bring up the fdisk tool, which can set up the partition table.

fdisk /dev/hda

Check whether the CF card has one partition or two partitions first:

Command (m for help): p Disk /dev/hda: 1997 MB, 1997163520 bytes 128 heads, 63 sectors/track, 968 cylinders Units = cylinders of 3970 * 512 = 2031640 bytes Device Boot End Blocks Id System /dev/hda1 1 3970 2544160+ 83 Linux

Start

If it shows one partition as shown above or no partition, please follow the following steps to partition CF card into two partitions. If it shows two partitions, it means that it has been done in factory and you can skip the steps to partition the CF card byissuing command "q" to exit from fdisk and continue on Mount CF Card. [Note - Please pay attention to the total size of the disk. Users will need the disk size when calculating the partition sizes of the new table. The output above shows this is a 2GB CF card.]

If it shows only one partition, enter "d" to delete the old partition.

37

PicOS Installation and Getting Started

Command (m for help): d Selected partition 1

Now create the new partition with the "n" command.

Command (m for help): n Command action e extended p primary partition (1-4)

This is where users need to use the recorded CF size. Users need to reserve about 400 MB for partition 2. The rest of the CF card belongs to partition 1. If the size of the CF card is 2 GB, partition should be 1.6GB (1600M) and partition 2 is 400M. Since we need both partitions to be bootable, we will need to set both as primary. Enter "p" to select primary partition, and "1" to configure partition 1.

Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-3970, default 1): 1 Last cylinder or +size or +sizeM or +sizeK (1-3970, default 3970): 3176

In the above example, the total cylinder is 3970. So you can allocate 3970 / 5 * 4 = 3176 (2G / 5 * 4 = 1.6G) for partition 1. Create partition 2 with the rest of the sectors.

Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 2 First cylinder (3177-3970, default 3177): Using default value 3177 Last cylinder or +size or +sizeM or +sizeK (3177-3970, default 3970): Using default value 3970

Enter "w" to write the partition table and exit.

Command (m for help): w

This should complete the disk formatting process. Formatting the file systems We need to format the two partitions into EXT3 file system.

mke2fs -j /dev/hda1

38

PicOS Installation and Getting Started

Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 26 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override.

mke2fs -j /dev/hda2

Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 26 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override.

mount CF CARD Mount the partition1 and change the working directory to /cf_card with the following commands:

mount /dev/hda1 /cf_card cd /cf_card

Setting Up an IP Address In order to download the 2.0 image to the switch, users will need to set up the network connection of the management port. There are two ways to setup the IP address of the management port: 1. Obtain the IP address through DHCP. 2. Setup a static IP address. If the switch is connected to a DHCP server, enter the following command to obtain the DHCP-assigned IP:

#udhcpc

If a DHCP server is not available, setup a static IP instead:

#ifconfig eth0

Ping the TFTP server first to make sure the network is set up properly. Downloading and Installing the PicOS Image Use TFTP or FTP to retrieve the image from a remote server. When using TFTP, enter rootfs.tar.gz for. Users will need the file name of the new image, which should be stored at the TFTP server. Use the file name as . is the IP address of the TFTP server. The process may take several minutes. [Note: Make sure entering the sync command after downloading the file.]

39

PicOS Installation and Getting Started

#tftp -g -l -r ... #sync

When using FTP, use the following syntax.

ftp get -u -p ... #sync

After downloading the image, unzip the compressed image file.

#tar zxvf rootfs.tar.gz ... #sync

[Note: make sure entering the sync command before restarting the system, otherwise the upgrade process might be incomplete and can lead to corrupted image.]

Finally, reboot the system:

#reboot

[Note – the reboot process may take up to 3 minutes.]

Please refer to section "Upgrade PicOS from 2.1 to 2.x" for instructions for upgrading to 2.x version.

40

PicOS Installation and Getting Started

PicOS Password Recovery This document is used to recover the password when users forget the password which you set. Only operating on the console port. It depends on the platforms. P3290/P3295/P3780 P3922 P3297 P3930 P3920

P3290/P3295/P3780 Step1: reboot the switch, and then running backup system (the same as the image upgrade guide) [Note: this prompt appears very soon after the system boots up. Users will need to hit the key fast enough to stop the process]

Hit any key to stop autoboot: 5

At the uBoot prompt, enter the following command to bring up the utility program.

=>run flash_bootcmd

This boots through a Linux kernel and stops at a menu of the utility tool as the following,

Diagnostic Test Main Menu v1.3 (LB9 - Linux) [1 ] File Management [2 ] Board Information [3 ] Diagnostic Test [4 ] Manufacturing Test Mode Set [5 ] Test Error Log File Management [6 ] PING [7 ] Reset [8 ] For Vibration Test

Enter your choice: Input Ctrl+D twice to quit the diagnostic menu (shown below) and to enter the Linux command line interface. Step2: mount CF/SD card

# mount /dev/hda1 /tmp

Step3:modify the file

41

PicOS Installation and Getting Started

vi /tmp/etc/shadow

change from: admin:$1$O8nrfRaw$xCuukBb87xrk.7ExpXM1a/:11490:0:99999:7::: into: admin::11490:0:99999:7:::run usb_backup_boot

Press any key to enter the shell when you see the display below:

sd 0:0:0:0: [sda] Assuming drive cache: write through sd 0:0:0:0: [sda] Attached SCSI disk #

Step2: mount CF/SD card

# mount /dev/sda1 /tmp

Step3:modify the file

vi /tmp/etc/shadow

change from: admin:$1$MPwzZjRN$0.HAnb806ysZRLtfR7YGA0:15349:0:99999:7::: into: admin::15349:0:99999:7::: run norrescueboot

This boots through a Linux kernel

sd 0:0:0:0: [sda] Assuming drive cache: write through sd 0:0:0:0: [sda] Attached SCSI removable disk #

Step2: mount CF/SD card

# mount /dev/sda1 /tmp

Step3:modify the file

vi /tmp/etc/shadow

change from: admin:$1$eE9WFgVk$EwGcNl83uK98.r8TcKn2q/:15385:0:99999:7::: into: admin::15385:0:99999:7::: run fCmd

This boots through a Linux kernel

sd 0:0:0:0: [sda] Attached SCSI removable disk # #

Step2: mount CF/SD card

46

PicOS Installation and Getting Started

# mount /dev/sda1 /tmp

Step3:modify the file

vi /tmp/etc/shadow

change from: admin:$1$eE9WFgVk$EwGcNl83uK98.r8TcKn2q/:15385:0:99999:7::: into: admin::15385:0:99999:7::: run flash_boot

This boots through a Linux kernel and stops at a menu of the utility tool as the following,

Please choose which to start. (Will choose active entry if no input in 10 seconds) Current boot mode: normal ===================Main Menu===================== *1 - Start Application (active) 2 - Start Diagnostic Application 3 - Utility ================================================== Enter your choice (1-3): 3 This will bring up the Utility Menu. Enter 7 as your choice: ===================Utility Menu======================== 1 - Format FLASH device to JFFS2 file system 2 - List file 3 - Delete file 4 - Download file 5 - Active file 6 - Reboot 7 - System Shell 8 - Exit ======================================================= Enter your choice (1-8): 7 (none) login: root Password:

login[1096]: root login on 'ttyS0' Use “root” as user and “root123” as password. The switch will then drop into a Linux prompt.

48

PicOS Installation and Getting Started

Step2: mount CF/SD card

# mount /dev/mmcblk0p1 /tmp

Step3:modify the file

vi /tmp/etc/shadow

change from: admin:$1$UbX5qTot$balqAuI4NwFphMdKb3KL11:16161:0:99999:7::: into: admin::16161:0:99999:7:::