ezset(n) 1.0 ezset "Easy Set Command"
NAME
ezset - Set a configuration parameter on a Cisco device.
SYNOPSIS
package require libcisco
ezset password ?SessionId? PwType CurrentPw NewPw |
ezset banner ?options? ?SessionId? Banner |
ezset hostname ?SessionId? Hostname |
ezset contact ?SessionId? Contact |
ezset location ?SessionId? Location |
ezset community ?options? ?SessionId? StringType Community?,Acl? ... ?Community?,Acl?? |
|
DESCRIPTION
The ezset command is used to set configuration parameters on Cisco
devices.
The first argument to ezset specifies the configuration element to set
on the target device. A list of valid elements and their associated options
is detailed below.
Note: Before making a call to ezset, a session must first be opened
to the target device using the session open command.
- ezset password ?SessionId? PwType CurrentPw NewPw
-
Sets the password on the target device.
SessionId identifies the session upon which the command will be
issued. If SessionId is not specified, the command will be issued
on the last session to be opened.
PwType may be one of two options--login or enable.
The login option will set the local login password on all vty,
con, and aux lines if the target system is an IOS-based device. If the
target system is running Catalyst Code, the local login password will be
set. If the target device is a 1900, the "enable password level 1" will
be set to NewPw. The enable option will set the
"enable secret" password if the target system is an IOS-based device. If
the device is running Catalyst Code, the local enable password will be set.
If the target device is a 1900, the "enable password level 15" will be set
to NewPw.
CurrentPw is the current password. This will usually be the same
password that was used to either open the session or put it into enable
mode.
NewPw is the new password to be set.
On success, ezset password returns 0.
On error, a short text message is returned beginning with the string "err".
- ezset banner ?options? ?SessionId? Banner
-
Sets the login banner on the target system.
SessionId identifies the session upon which the command will be
issued. If SessionId is not specified, the command will be issued
on the last session to be opened.
Banner is by default assumed to be a Tcl list. Each element of the
list is a separte line of text. The lines of text that make up the list
need not have leading or trailing newline characters as these will be
automatically added when the banner is set on the target system.
If the target system is an IOS-based device, this command will set
the "banner login". If the target system is running Catalyst Code,
the "set banner motd" command will be issued. If the target system
is a 1900, nothing will be set.
The following options are supported:
-file
--
(end of options)
The -file option will cause Banner to be interpreted as a
fully-qualified path and filename instead of a Tcl list. The file
should be a readable ASCII file. The entire contents of the file will be
read in as a Tcl list and then applied as the banner message on the target
system.
On success, ezset banner returns 0.
On error, a short text message is returned beginning with the string "err".
- ezset hostname ?SessionId? Hostname
-
Sets the hostname on the target system.
SessionId identifies the session upon which the command will be
issued. If SessionId is not specified, the command will be issued
on the last session to be opened.
Hostname is the hostname to be set on the target system. The hostname
may not exceed 20 characters. If the target system is an an IOS-based
device, the "hostname" command will be issued. If the target system is
running Catalyst Code, the "set prompt" and "set system name" commands will
be issued. If the target system is a 1900, the "hostname" command will be
isssued from global configuration mode.
On success, ezset hostname returns 0.
On error, a short text message is returned beginning with the string "err".
- ezset contact ?SessionId? Contact
-
Sets the system contact (SNMP sysContact) on the target system.
SessionId identifies the session upon which the command will be
issued. If SessionId is not specified, the command will be issued
on the last session to be opened.
Contact is the contact name to be set on the target system. The
contact name may not exceed 220 characters.
On success, ezset hostname returns 0.
On error, a short text message is returned beginning with the string "err".
- ezset location ?SessionId? Location
-
Sets the system location (SNMP sysLocation) on the target system.
SessionId identifies the session upon which the command will be
issued. If SessionId is not specified, the command will be issued
on the last session to be opened.
Location is the location to be set on the target system. The
location may not exceed 220 characters.
On success, ezset hostname returns 0.
On error, a short text message is returned beginning with the string "err".
- ezset community ?options? ?SessionId? StringType Community?,Acl? ... ?Community?,Acl??
-
Sets the SNMP community string on the target device.
The following options are supported:
-clear
--
(end of options)
The -clear option will cause the existing community strings to be
cleared before the new string(s) is/are applied. This option has no effect
on switches running Catalyst code.
SessionId identifies the session upon which the command will be
issued. If SessionId is not specified, the command will be issued
on the last session to be opened.
StringType identifies the type of community string to be set. Valid
options are "ro" for read-only, and "rw" for read-write.
Community is the community string to be set. Acl is an
optional variable which may be used in conjunction with the community string.
If an Acl is specified, a comma ',' must delimit the community
string and the Acl with no spaces in between. This also means that the
community string cannot have a comma as part of the string. The Acl
number has a different effect on the device depending on what OS it is
running. For devices running IOS, the Acl should correspond to
a valid access-list number. The Acl will be used to limit
what stations may access the device using this community string. If the
switch is a 1900 or running Catalyst code, the Acl will be silently
ignored.
Multiple Community or Community,Acl variables may be specified.
However, how multiple strings are handled is again dependent upon the
target system's OS. If the target system is an IOS-based device, every
community string (and optionally ACL) specified will be applied. If the
target device is running Catalyst Code, only the first community string
in the list will be set. If the target device is a 1900, only the first
four community strings will be set.
On success, ezset community returns 0.
On error, a short text message is returned beginning with the string "err".
EXAMPLE
The following code will open a session to 192.168.1.1, put the device in
"enable" mode, set the hostname to "R1", and change the enable password
from "san-fran" to "newpass". It will then close the session to the device.
-
session open 192.168.1.1 cisco
session enable san-fran
ezset hostname "R1"
ezset password enable san-fran newpass
session close
SEE ALSO
session(n), ezget(n), ezdo(n)
KEYWORDS
ezset, password, banner, hostname, snmp