01-Fundamentals Configuration Guide

HomeSupportResource CenterSwitchesH3C S7500X Switch SeriesH3C S7500X Switch SeriesTechnical DocumentsConfigureConfiguration GuidesH3C S7500X Switch Series Configuration Guides-Release758X-6W10001-Fundamentals Configuration Guide
09-Emergency Shell configuration
Title Size Download
09-Emergency Shell configuration 82.95 KB

Using the emergency shell

At startup, the device tries to locate and load the Comware startup software images. These images can include a boot image, a system image, feature images, and patch images. If the following requirements are met, the device enters emergency shell mode:

·           The boot image exists and can be used.

·           The system image, a feature image, or a patch image is missing or corrupt.

After the device enters emergency shell mode, you can log in through the console port to obtain and load a system image to start the Comware system. After the Comware system is started, you can load feature images and patch images. This chapter describes how to obtain and load the system image in emergency shell mode. For information about loading feature and patch images, see "Upgrading software" and "Performing an ISSU."

If the device has two MPUs, the two MPUs start up independently. If one MPU enters emergency shell mode, log in to that MPU through its console port to load a system image for it. For more information about software images, see "Upgrading software." For more information about how to log in through the console port, see "Logging in through the console port for the first device access."

Managing the file systems

The emergency shell provides some basic file system management commands for managing files, directories, and storage media.

 

IMPORTANT

IMPORTANT:

·       A file deleted by using the delete command cannot be restored.

·       The format command permanently deletes all files and directories from a file system. The deleted files and directories cannot be restored.

 

To manage the file systems, execute the following commands in user view:

 

Task

Command

Remarks

Display files or directories.

dir [ /all ] [ file | directory ]

N/A

Create a directory.

mkdir directory

The parent directory must already exist. For example, to create the directory flash:/test/mytest, the parent directory test must already exist.

The name for the new directory must be unique in the parent directory.

Display the working directory.

pwd

N/A

Copy a file.

copy source-file { dest-file | dest-directory }

N/A

Move a file.

move source-file { dest-file | dest-directory }

The destination directory must have enough space for the file.

Display the contents of a text file.

more file

N/A

Permanently delete a file.

delete file

N/A

Delete a directory.

rmdir directory

To delete a directory, first delete all files and subdirectories in the directory.

Format a file system.

format filesystem

N/A

 

Obtaining a system image from an FTP/TFTP server

If the required system image is saved on an FTP or TFTP server, configure the management Ethernet interface and obtain the system image as described in this section.

The version of the system image must match that of the boot image. Before obtaining a system image, you must complete the following tasks:

·           Identify the version of the boot image by using the display version command.

·           Identify the version of the system image by reading the release notes.

Configuring the management Ethernet interface

To use FTP, TFTP, SSH, and Telnet services in emergency shell mode, you must perform the following tasks:

·           Assign an IP address the management Ethernet interface.

·           Bring up the management Ethernet interface.

·           If the servers reside on a different network, specify a gateway for the management Ethernet interface.

To configure the management Ethernet interface on an IPv4 network:

 

Step

Command

Remarks

1.      Enter system view.

system-view

N/A

2.      Enter management Ethernet interface view.

interface m-eth0

N/A

3.      Assign an IPv4 address to the interface.

ip address ip-address { mask-length | mask }

By default, no IPv4 address is assigned to the management Ethernet interface.

4.      Specify an IPv4 gateway for the interface.

ip gateway ip-address

By default, no IPv4 gateway is specified for the management Ethernet interface.

5.      Bring up the interface.

undo shutdown

By default, the management Ethernet interface is up.

6.      Return to system view.

quit

N/A

 

To configure the management Ethernet interface on an IPv6 network:

 

Step

Command

Remarks

1.      Enter system view.

system-view

N/A

2.      Enter management Ethernet interface view.

interface m-eth0

N/A

3.      Assign an IPv6 address to the interface.

ipv6 address ipv6-address prefix-length

By default, no IPv6 address is assigned to the management Ethernet interface.

4.      Specify an IPv6 gateway for the interface.

ipv6 gateway ipv6-address

By default, no IPv6 gateway is specified for the management Ethernet interface.

5.      Bring up the interface.

undo shutdown

By default, the management Ethernet interface is up.

6.      Return to system view.

quit

N/A

 

Checking the connectivity to a server

After completing network parameter configuration, you can use the ping command to check the connectivity between the device and the intended FTP or TFTP server.

To check the connectivity between the device and a server on an IPv4 network, execute the following command in any view:

 

Task

Command

Check the connectivity to an IPv4 address

ping [ -c count | -s size ] * ip-address

 

To check the connectivity between the device and a server on an IPv6 network, execute the following command in any view:

 

Task

Command

Check the connectivity to an IPv6 address

ping ipv6 [ -c count | -s size ] * ipv6-address

 

Accessing the server

In emergency shell mode, the device can perform the following operations:

·           Act as an FTP or TFTP client to download software packages from an FTP or TFTP server.

·           Act as an FTP or TFTP client to upload software packages to an FTP or TFTP server.

·           Act as a Telnet or SSH client so you can log in to a server to, for example, view and manage files on the server.

To access an FTP or TFTP server from the device, make sure the FTP or TFTP server is configured correctly. To configure the device as the FTP or TFTP server:

1.      Log in to the server through Telnet or SSH.

2.      Enable the FTP or TFTP server feature.

3.      Configure relevant parameters as required.

If you cannot log in to an SSH server from the device because the server has changed its public key, perform the following tasks:

1.      Use the reset ssh public-key command to delete all locally saved SSH server public keys.

2.      Log in to the SSH server from the device again.

To access a remote IPv4 server, execute the following commands as appropriate in user view:

 

Task

Command

Telnet to an IPv4 server.

telnet server-ipv4-address

Use SSH to log in to an IPv4 server.

ssh2 server-ipv4-address

Use FTP to download a file from or upload a file to an IPv4 server.

ftp server-ipv4-address { get remote-file local-file | put local-file remote-file }

Use TFTP to download a file from or upload a file to an IPv4 server.

tftp server-ipv4-address { get remote-file local-file | put local-file remote-file }

 

To access a remote IPv6 server, execute the following commands as appropriate in user view:

 

Task

Command

Telnet to an IPv6 server.

telnet ipv6 server-ipv6-address

Use SSH to log in to an IPv6 server.

ssh2 ipv6 server-ipv6-address

Use FTP to download a file from or upload a file to an IPv6 server.

ftp ipv6 server-ipv6-address { get remote-file local-file | put local-file remote-file }

Use TFTP to download a file from or upload a file to an IPv6 server.

tftp ipv6 server-ipv6-address { get remote-file local-file | put local-file remote-file }

 

Loading the system image

IMPORTANT

IMPORTANT:

The version of the system image must match that of the boot image. Before loading a system image, use the display version and display install package commands to display the version information of the boot image and system image.

 

When you load the system image, the system modifies the main startup software image set to include only the boot image and system image. The device can reboot correctly with the modified image set.

To load the system image, execute the following command in user view:

 

Task

Command

Load a system image.

install load system-package

 

Rebooting the device

To reboot the device, perform the following task in user view:

 

Task

Command

Reboot the current MPU.

reboot

 

Displaying device information in emergency shell mode

Execute display commands in any view.

 

Task

Command

Display copyright information.

display copyright

Display software package information.

display install package package

Display management Ethernet interface information.

display interface m-eth0

Display IPv4 routing information.

display ip routing-table

Display IPv6 routing information.

display ipv6 routing-table

Display boot image version information.

display version

 

Emergency shell usage example

Network requirements

As shown in Figure 1, the device has only the boot image file (boot.bin). After startup, the device entered emergency shell mode. The device and PC can reach each other.

Use the TFTP client service on the device to download system image system.bin from the PC and start the Comware system on the device.

Figure 1 Network diagram

 

Usage procedure

# Identify which files are stored and how much space is available in the file system.

<boot> dir

Directory of flash:

   0   drw-      5954  Apr 26 2007 21:06:29   logfile

   1   -rw-      1842  Apr 27 2007 04:37:17   boot.bin

   2   -rw-      1518  Apr 26 2007 12:05:38   startup.cfg

   3   -rw-      2045  May 04 2007 15:50:01   backcfg.cfg

 

524288 KB total (513248 KB free)

The output shows that boot image file boot.bin is present but the matching system image file (system.bin) is not. The available space is 513248 KB, enough for saving system image file system.bin.

# Identify the version information of the boot image.

<boot> display version

H3C Comware Software, Version 7.1.070, Alpha 752102                            

Copyright (c) 2004-2017 New H3C Technologies Co., Ltd. All rights reserved.      

H3C S7506X uptime is 0 weeks, 0 days, 7 hours, 45 minutes

Last reboot reason : Cold reboot                                               

                                                                               

Boot image: flash:/S10500-CMW710-BOOT-A752102.bin                              

Boot image version: 7.1.070, Alpha 752102                                      

  Compiled Mar 02 2016 16:00:00

# Configure an IP address and a gateway for the management Ethernet interface.

<boot> system-view

[boot] interface m-eth0

[boot-m-eth0] ip address 1.1.1.1 16

[boot-m-eth0] ip gateway 1.1.1.2

# Verify that the device and the TFTP server can reach each other.

<boot> ping 1.2.1.1

PING 1.2.1.1 (1.2.1.1): 56 data bytes

56 bytes from 1.2.1.1: seq=0 ttl=128 time=2.243 ms

56 bytes from 1.2.1.1: seq=1 ttl=128 time=0.717 ms

56 bytes from 1.2.1.1: seq=2 ttl=128 time=0.891 ms

56 bytes from 1.2.1.1: seq=3 ttl=128 time=0.745 ms

56 bytes from 1.2.1.1: seq=4 ttl=128 time=0.911 ms

--- 1.2.1.1 ping statistics ---

5 packets transmitted, 5 packets received, 0% packet loss

round-trip min/avg/max = 0.717/1.101/2.243 ms

# Download the system.bin file from the TFTP server.

<boot> tftp 1.2.1.1 get system.bin flash:/system.bin   

# Verify that the system image is compatible with the boot image.

<boot> display install package flash:/system.bin

  flash:/system.bin

  [Package]

  Vendor: H3C

  Product: S7506X

  Service name: system

  Platform version:  7.1.070

  Product version: Alpha 752102

  Supported board: mpu

  [Component]

  Component: system

  Description: system package

# Load the system image to start the Comware system.

<boot> install load flash:/system.bin

Check package flash:/system.bin ...

Extracting package ...

 

Loading...

Line aux0 is available.

 

 

Press ENTER to get started.

After you press Enter, the following information appears:

<System>

<System>%Sep 23 18:29:59:777 2016 S58.59 SHELL/5/SHELL_LOGIN: TTY logged in from aux0.