In-band IP Addresshttp://192.168.1.1
User Nameadmin
Password1234
www.zyxel.com
About This CLI Reference Guide
About This CLI Reference Guide
Intended Audience
This manual is intended for people who want to configure the ZyWALL via Command Line
Interface (CLI). You should have at least a basic knowledge of TCP/IP networking concepts
and topology.
"This guide is intended as a command reference for a series of products.
Therefore many commands in this guide may not be available in your product.
See your User’s Guide for a list of supported features and details about feature
implementation.
Please refer to www.zyxel.com or your product’s CD for product specific User Guides and
product certifications.
How To Use This Guide
•Read Chapter 1 on page 13 for an overview of various ways you can get to the command
interface on your ZyWALL.
•Read Chapter 2 on page 17 for an introduction to some of the more commonly used
commands.
"It is highly recommended that you read at least these two chapters.
• The other chapters in this guide are arranged according to the CLI structure. Each chapter
describes commands related to a feature.
"See your ZyWALL’s User Guide for feature background information.
• To find specific information in this guide, use the Contents Overview, the Index of
Commands, or search the PDF file. E-mail techwriters@zyxel.com.tw if you cannot find
the information you require.
CLI Reference Guide Feedback
Help us help you. Send all guide-related comments, questions or sugg estions for improvement
to the following address, or use e-mail instead. Thank you!
ZyWALL (ZyNOS) CLI Reference Guide
3
About This CLI Reference Guide
The Technical Writing Team,
ZyXEL Communications Corp.,
6 Innovation Road II,
Science-Based Industrial Park,
Hsinchu, 300, Taiwan.
E-mail: techwriters@zyxel.com.tw
4
ZyWALL (ZyNOS) CLI Reference Guide
Document Conventions
Document Conventions
Warnings and Notes
Warnings and notes are indicated as follows in this guide.
1Warnings tell you about things that could harm you or your device. See your
User’s Guide for product specific warnings.
"Notes tell you other important information (for example, other things you may
need to configure or helpful tips) or recommendations.
Syntax Conventions
This manual follows these general conventions:
• ZyWALLs may also be referred to as the “device”, the “ZyXEL device”, the “system” or
the “product” in this guide.
• Units of measurement may denote the “metric” value or the “scientific” value. For
example, “k” for kilo may denote “1000” or “1024”, “M” for mega may denote “1000000”
or “1048576” and so on.
Command descriptions follow these conventions:
• Commands are in
• Required input values are in angle brackets <>; for example,
means that you must specify an IP address for this command.
• Optional fields are in square brackets []; for instance show logins[name], the name
field is optional.
The following is an example of a required field within an optional field: snmp-server [contact <system contact>], the contact field is optional. However, if you
use contact, then you must provide the system contact information.
•The | (bar) symbol means “or”.
• italic terms represent user-defined input values; for example, in sys datetime date [year month date], year month date can be replaced by the actual
year month and date that you want to set, for example, 2007 08 15.
• A key stroke is denoted by square brackets and uppercase text, for example, [ENTER]
means the “Enter” or “Return” key on your keyboard.
• <cr> means press the [ENTER] key.
• An arrow (-->) indicates that this line is a continuation of the previous line.
courier new font.
ping<ip-address>
ZyWALL (ZyNOS) CLI Reference Guide
5
Document Conventions
Command summary tables are organized as follows:
Table 1 Table Title
COMMANDDESCRIPTIONM
ip alg disable
<ALG_FTP|ALG_H323|ALG_SIP>
ip alg dispShows whether the ALG is enabled or disabled.R+B
ip alg enable
<ALG_FTP|ALG_H323|ALG_SIP>
ip alg ftpPortNum [port]Sets the FTP ALG to support a different port number (instead of the
ip alg siptimeout <timeout> Sets the SIP timeout in seconds. 0 means no timeout.R+B
ip alias <interface>Sets an alias for the specified interface.R
Turns off the specified ALG (Application Layer Gateway).R+B
Turns on the specified ALG.R+B
R+B
default).
The Table title identifies commands or the specific feature that the commands configure.
The COMMAND column shows the syntax of the command.
The DESCRIPTION column explains what the command does. It may also identify legal
input values.
The M column identifies the mode in which you run the command.
• R: The command is available in router mode.
• B: The command is available in bridge mode.
• R + B: The command is available in both router and bridge modes
A long list of pre-defined values may be replaced by a command input value ‘variable’ so as to
avoid a very long command in the description table. Refer to the command input values table
if you are unsure of what to enter.
Table 2 Common Command Input Values
LABELDESCRIPTION
descriptionUsed when a command has a description field in order to add more detail.
ip-addressAn IP address in dotted decimal notation. For example, 192.168.1.3.
mask
mask-bitsThe number of bits in an address’s subnet mask. For example type /24 for a
portA protocol’s port number.
The subnet mask in dotted decimal notation, for example, 255.255.255.0.
subnet mask of 255.255.255.0.
6
ZyWALL (ZyNOS) CLI Reference Guide
Document Conventions
Table 2 Common Command Input Values (continued)
LABELDESCRIPTION
interfaceAn interface on the ZyWALL. Use the following for a ZyWALL with a single WAN
Ethernet interface.
enif0: LAN
enif1: Ethernet WAN
enif2: DMZ
enif4: Ethernet WLAN
wanif0: PPPoE or PPTP or 3G depending on which is connected first
wanif1: PPPoE or PPTP or 3G depending on which is connected second
Use the following for a ZyWALL with two WAN Ethernet interfaces.
enif0: LAN
enif1: Ethernet WAN 1
enif2: DMZ
enif3: Ethernet WAN 2
enif5: Ethernet WLAN
wanif0: PPPoE or PPTP or 3G depending on which is connected first
wanif1: PPPoE or PPTP or 3G depending on which is connected second
For some commands you can also add a colon and a 0 or 1 to specify an IP alias.
This is only for the LAN, DMZ, and WLAN interfaces. For example, enif0:0
specifies LAN IP alias 1 and enif0:1 specifies LAN IP alias 2.
hostnameHostname can be an IP address or domain name.
nameUsed for the name of a rule, policy, set, group and so on.
numberUsed for a number, for example 10, that you have to input.
"Commands are case sensitive! Enter commands exactly as seen in the
command interface. Remember to also include underscores if required.
Copy and Paste Commands
You can copy and paste commands directly from this document into your terminal emulation
console window (such as HyperTerminal). Use right-click (not ctrl-v) to paste your command
into the console window as shown next.
ZyWALL (ZyNOS) CLI Reference Guide
7
Document Conventions
Icons Used in Figures
Figures in this guide may use the following generic icons. The ZyWALL icon is not an exact
representation of your device.
Appendices and Index of Commands ................................................................................175
ZyWALL (ZyNOS) CLI Reference Guide
9
Contents Overview
10
ZyWALL (ZyNOS) CLI Reference Guide
PART I
Introduction
How to Access and Use the CLI (13)
Common Commands (17)
11
12
CHAPTER 1
How to Access and Use the CLI
This chapter introduces the command line interface (CLI).
1.1 Accessing the CLI
Use any of the following methods to access the CLI.
1.1.1 Console Port
You may use this method if your ZyWALL has a console port.
1 Connect your computer to the console port on the ZyWALL using the appropriate cable.
2 Use terminal emulation software with the following settings:
Table 3 Default Settings for the Console Port
SETTINGDEFAULT VALUE
Terminal EmulationVT100
Baud Rate9600 bps
ParityNone
Number of Data Bits8
Number of Stop Bits1
Flow ControlNone
3 Press [ENTER] to open the login screen.
1.1.2 Telnet
4 Open a Telnet session to the ZyWALL’s IP address. If this is your first login, use the
default values.
Table 4 Default Management IP Address
SETTINGDEFAULT VALUE
IP Address192.168.1.1
Subnet Mask255.255.255.0
Make sure your computer IP address is in the same subnet, unless you are accessing the
ZyWALL through one or more routers. In the latter case, make sure remote management
of the ZyWALL is allowed via Telnet.
ZyWALL (ZyNOS) CLI Reference Guide
13
Chapter 1 How to Access and Use the CLI
1.1.3 SSH
You may use this method if your ZyWALL supports SSH connections.
1 Connect your computer to one of the Ethernet ports.
2 Use a SSH client program to access the ZyWALL. If this is your first login, use the
default values in Table 4 on page 13 and Table 5 on page 14. Make sure your computer
IP address is in the same subnet, unless you are accessing the ZyWALL through one or
more routers.
1.2 Logging in
Use the administrator username and password. If this is your first login, use the default values.
in some ZyWALLs you may not need to enter the user name.
Table 5 Default User Name and Password
SETTINGDEFAULT VALUE
User Nameadmin
Password1234
The ZyWALL automatically logs you out of the management interface after five minutes of
inactivity . If this happens to you, simply log back in again. Use the sys stdio co mman d to
extend the idle timeout. For example, the ZyWALL automatically logs you out of the
management interface after 60 minutes of inactivity after you use the sys stdio 60
command.
1.3 Using Shortcuts and Getting Help
This table identifies some shortcuts in the CLI, as well as how to get help.
Table 6 CLI Shortcuts and Help
COMMAND / KEY(S)DESCRIPTION
yz (up/down arrow keys)Scrolls through the list of recently-used commands. You can edit
any command or press [ENTER] to run it again.
[CTRL]+UClears the current command.
?Displays the keywords and/or input values that are allowed in
place of the ?.
helpDisplays the (full) commands that are allowed in place of help.
Use the help command to view the available commands on the ZyWALL. Follow these steps
to create a list of supported commands:
14
1 Log into the CLI.
ZyWALL (ZyNOS) CLI Reference Guide
Chapter 1 How to Access and Use the CLI
2 Type help and press [ENTER]. A list comes up which shows all the commands
available for this device.
ras> help
Valid commands are:
sys exit ether aux
config wwan wlan ip
ipsec bridge bm certificates
8021x radius radserv wcfg
ras>
Abbreviations
Commands can be abbreviated to the smallest unique string that differentiates the command.
For example sys version could be abbreviated to s v.
ras> sys version
ZyNOS version: V4.03(XD.0)Preb2_0802_1 | 08/03/2007
romRasSize: 3596736
system up time: 42:41:02 (ea784b ticks)
bootbase version: V1.08 | 01/28/2005
CPU chip revision: 1
CPU chip clock: 266MHz
CPU core revision: 0
ras> s v
ZyNOS version: V4.03(XD.0)Preb2_0802_1 | 08/03/2007
romRasSize: 3596736
system up time: 42:41:05 (ea796a ticks)
bootbase version: V1.08 | 01/28/2005
CPU chip revision: 1
CPU chip clock: 266MHz
CPU core revision: 0
ras>
1.4 Saving Your Configuration
In the ZyWALL some commands are saved as you run them and others require you to run a
save command. For example, type ip stroute save to save the static route rule in nonvolatile memory. See the related section of this guide to see if a save command is required.
"Unsaved configuration changes to commands that require you to run a save
command are lost once you restart the ZyWALL
ZyWALL (ZyNOS) CLI Reference Guide
15
Chapter 1 How to Access and Use the CLI
1.5 Logging Out
Enter exit to log out of the CLI.
Table 7 Exit Command
COMMANDDESCRIPTIONM
exitLogs you out of the CLI.R+B
16
ZyWALL (ZyNOS) CLI Reference Guide
CHAPTER 2
Common Commands
This chapter introduces some of the more commonly-used commands in the ZyWALL. For
more detailed usage, see the corresponding feature chapter in this guide.
In the following examples, ras is the prompt as that is the default. If you configure a system
name, then that prompt will display as the system name you configured. For example, change
the system name to zyxel using the sys hostname zyxel command; the command
prompt will then display as zyxel>.
2.1 Change the Idle Timeout
By default, the ZyWALL automatically logs you out of the management interface after five
minutes of inactivity. Use the sys stdio command to extend the idle timeout. The
following example extends the idle timeout to 120 minutes.
ZyWALL interfaces are defined as shown in Table 2 on page 6.
ZyWALL (ZyNOS) CLI Reference Guide
17
Chapter 2 Common Commands
The first command in this example shows information about the LAN port, for example, it has
an IP address of 192.168.1.1. The second command is used to change this IP address to
"Afterwards, you have to use this new IP address to access the ZyW ALL via the
LAN port.
To view information on all interfaces, enter ip ifconfig.
To view DHCP information on the LAN port, enter ip dhcp enif0 status.
ras> ip dhcp enif0 status
DHCP on iface enif0 is server
Start assigned IP address: 192.168.1.33/24
Number of IP addresses reserved: 128
Hostname prefix: dhcppc
DNS server: 0.0.0.0 0.0.0.0 0.0.0.0
WINS server: 0.0.0.0 0.0.0.0
Domain Name :
Default gateway: 192.168.1.1
Lease time: 259200 seconds
Renewal time: 129600 seconds
Rebind time: 226800 seconds
Probing count: 4
Probing type: ICMP
slot state timer type hardware address hostname
0 UNCERTAIN 0 0 00
1 UNCERTAIN 0 0 00
18
ZyWALL (ZyNOS) CLI Reference Guide
Chapter 2 Common Commands
Use these commands to release and renew DHCP-assigned information on the specified
interface.
ras> ip dhcp enif1 client release
ras> ip dhcp enif1 status
DHCP on iface enif1 is client
Hostname : zyxel.zyxel.com
Domain Name : zyxel.com
Server IP address: 0.0.0.0
Client IP address: 0.0.0.0/27
DNS server : 0.0.0.0, 0.0.0.0
Default gateway: 0.0.0.0
Lease time : 0 seconds
Renewal time: 0 seconds
Rebind time : 0 seconds
Client State = 8, retry = 0
periodtimer = 286, timer = 0
flags = 2
Status:
Packet InCount: 3, OutCount: 3, DiscardCount: 0
ras> ip dhcp enif1 client renew
ras> ip dhcp enif1 status
DHCP on iface enif1 is client
Hostname : zyxel.zyxel.com
Domain Name : zyxel.com
Server IP address: 172.16.5.2
Client IP address: 172.16.37.48/24
DNS server : 172.16.5.2, 172.16.5.1, 0.0.0.0
Default gateway: 172.16.37.254
Lease time : 604800 seconds
Renewal time: 302400 seconds
Rebind time : 529200 seconds
Client State = 3, retry = 0
periodtimer = 272, timer = 302397
flags = 2
Status:
Packet InCount: 3, OutCount: 2, DiscardCount: 0
ZyWALL (ZyNOS) CLI Reference Guide
19
Chapter 2 Common Commands
To view the ARP table for the LAN port, enter ip arp status enif0.
ras> ip arp status enif0
received 1458 badtype 0 bogus addr 0 reqst in 312 replies 9 reqst out 16
cache hit 11278 (88%), cache miss 1521 (11%)
IP-addr Type Time Addr stat iface
172.16.1.52 10 Mb Ethernet 130 00:0f:fe:32:b4:12 41 enif0
num of arp entries= 13
Each ZyWALL can support a specific number of NAT sessions in total. You can limit the
number of NAT sessions allowed per host by using the ip nat session command. In the
following example, each host may have up to 4000 NAT sessions open at one time. The total
number of NAT sessions must not exceed the number for your ZyWALL.
ras> ip nat session 4000
ip nat session
NAT session number per host: 4000
ras>
To see the IP routing table, enter the following command.
ras> ip route status
Dest FF Len Device Gateway Metric stat Timer Use
Use the following command to reset the ZyWALL to the factory defaults. Make sure you back
up your current configuration first (using the web configurator or SMT). The ZyWALL will
restart and the console port speed will also reset to 9,600 bps.
ras> sys romreset
Do you want to restore default ROM file(y/n)?y
Use the following command to change the console port speed. A higher console port speed is
recommended when uploading firmware via the console port. A console port speed of 1 1 5,200
bps is necessary to view CNM debug messages and packet traces on the ZyWALL.
Use the following command to display all ZyWALL logs. Logs are very useful for
troubleshooting. If you are having problems with your ZyWALL, then customer support may
request that you send them the logs.
80.85.129.103:123 |172.16.17.48:1135
Time set from NTP server: 0.pool.ntp.org, offset: +208949688 sec
4|2001-01-01 00:00:18 |WAN1
|
WAN interface gets IP:172.16.17.48
5|2001-01-01 00:00:16 |WAN1
|
WAN1 connection is up.
6|2001-01-01 00:00:16 |WAN2
|
WAN2 connection is down.
ras>
Use the following command to display all ZyWALL error logs
ras> sys logs errlog disp
47 Mon Jan 1 00:00:03 2001 PINI INFO Channel 0 ok
48 Mon Jan 1 00:00:25 2001 PP0e INFO LAN promiscuous mode <0>
51 Mon Jan 1 00:00:25 2001 PINI INFO main: init completed
52 Mon Jan 1 00:00:25 2001 PP22 INFO No DNS server available
53 Mon Jan 1 00:11:53 2001 PINI INFO Last errorlog repeat 114 Times
54 Mon Jan 1 00:11:53 2001 PINI INFO SMT Session Begin
55 Mon Jan 1 00:15:25 2001 PP22 INFO No DNS server available
56 Mon Jan 1 00:51:15 2001 PINI INFO Channel 0 ok
57 Mon Jan 1 00:51:37 2001 PP0e INFO LAN promiscuous mode <0>
60 Mon Jan 1 00:51:37 2001 PINI INFO main: init completed
61 Mon Jan 1 00:51:37 2001 PP22 INFO No DNS server available
62 Mon Jan 1 00:51:41 2001 PINI INFO SMT Session Begin
63 Mon Jan 1 00:52:37 2001 PP1c INFO No DNS server available
Clear Error Log (y/n):
24
ZyWALL (ZyNOS) CLI Reference Guide
Chapter 2 Common Commands
Use the following commands for system debugging. A console po rt speed of 115,200 bps is
necessary to view packet traces on the ZyWALL.
Extended Ping From device to 172.16.1.202:
Packets: Sent = 5, Received = 5, Lost = 0 (0% loss),
Approximate Round Trip Times in milli-seconds:
RTT: Average = 798ms, Maximum = 1070ms, Minimum = 510ms
ras>
2.4 UTM and myZyXEL.com
Use these commands to create an account at myZyXEL.com and view what services you have
activated.
"Ensure your ZyWALL is connected to the Internet before you use the following
commands.
ZyWALL (ZyNOS) CLI Reference Guide
25
Chapter 2 Common Commands
You need to create an account at my ZyXEL.com in order to activate content filtering, antispam and anti-virus UTM (Unified Threat Management) services. See the myZyXEL.com
chapter for information on the country code you should use.
This command displays your ZyWALL’s registration information.
ras> sys myZyxelCom display
register server address : www.myzyxel.com
register server path : /register/registration?
username : aseawfasf
password : aaaaaa
email : aa@aa.aa.aa
sku : CFRT=1&CFST=319&ZASS=469&ISUS=469&ZAVS=469
country code : 204
register state 1
register MAC : 0000AA220765
CF expired day : 2008-05-26 14:58:19
AS expired day : 2008-10-23 14:58:19
2In1 expired day : 2008-10-23 14:58:19
Last update day : 2007-07-12 14:58:19
This command displays ZyWALL service registration details.
Use these commands to enable anti-spam on the ZyWALL for traffic going from WAN1 to
LAN.
ras> as enable 1
Anti spam: enabled
ras> as dir wan1 lan on
From\To lan wan1 dmz wan2 wlan vpn
=======================================
lan off off off off off off
wan1 on off off off off off
dmz off off off off off off
wan2 off off off off off off
wlan off off off off off off
vpn off off off off off off
ras>
Use the following commands to enable anti-virus on the ZyWALL You first need to use the
load command.
ras> av load
ras> av config enable on
ras> av save
ras> av disp
AV Enable : On
AV Forward Over ZIP Session : Off
AV Forward Over ZIP Session : Off
------------------------------------
Use the following commands to enable content filtering on the ZyWALL, then on the external
database (DB) and then display the default policy.
ras> ip cf common enable on
ras> ip cf externalDB enable on
ras> ip cf policy displayAll
index Name Active IP Group
Start Addr End Addr
==========================================================================
1 Default Policy Y 0.0.0.0/0.0.0.0
The default policy does not actually block anything. Use the following commands to edit the
default policy, turn the external database service content filtering (category-based content
filtering), see what the categories are, block a category 92 in the following example) and then
save the policy.
ZyWALL (ZyNOS) CLI Reference Guide
27
Chapter 2 Common Commands
ras> ip cf policy edit 1
ras> ip cf policy config webControl enable on
ras> ip cf policy config webControl display
The Categories:
type 1 :Adult/Mature Content
type 2 :Pornography
type 3 :Sex Education
type 4 :Intimate Apparel/Swimsuit
type 5 :Nudity
type 6 :Alcohol/Tobacco
type 7 :Illegal/Questionable
type 8 :Gambling
type 9 :Violence/Hate/Racism
type10 :Weapons
type11 :Abortion
type12 :Hacking
type13 :Phishing
type14 :Arts/Entertainment
type15 :Business/Economy
type16 :Alternative Spirituality/Occult
type17 :Illegal Drugs
type18 :Education
type19 :Cultural/Charitable Organization
type20 :Financial Services
type21 :Brokerage/Trading
type22 :Online Games
type23 :Government/Legal
type24 :Military
type25 :Political/Activist Groups
type26 :Health
type27 :Computers/Internet
type28 :Search Engines/Portals
type29 :Spyware/Malware Sources
type30 :Spyware Effects/Privacy Concerns
type31 :Job Search/Careers
type32 :News/Media
type33 :Personals/Dating
type34 :Reference
type35 :Open Image/Media Search
type36 :Chat/Instant Messaging
type37 :Email
type38 :Blogs/Newsgroups
type39 :Religion
type40 :Social Networking
type41 :Online Storage
type42 :Remote Access Tools
type43 :Shopping
type44 :Auctions
type45 :Real Estate
type46 :Society/Lifestyle
type47 :Sexuality/Alternative Lifestyles
type48 :Restaurants/Dining/Food
type49 :Sports/Recreation/Hobbies
type50 :Travel
type51 :Vehicles
type52 :Humor/Jokes
type53 :Software Downloads
type54 :Pay to Surf
type55 :Peer-to-Peer
type56 :Streaming Media/MP3s
type57 :Proxy Avoidance
type58 :For Kids
type59 :Web Advertisements
type60 :Web Hosting
type61 :Unrated
ras> ip cf policy config webControl category block 2
The Categories:
type 1 :Adult/Mature Content
type 2 (block):Pornography
------ras> ip cf policy save
ras>
28
ZyWALL (ZyNOS) CLI Reference Guide
You may also configure and schedule new policies using commands as well as configure what
to block using the external database.
2.5 Firewall
Use the following command to enable the firewall on the ZyWALL.
ras> sys firewall active yes
ras>
2.6 VPN
Use the following command to show what IPsec VPN tunnels are active on your ZyWALL.
ras> ipsec show_runtime sa
Runtime SA status:
Chapter 2 Common Commands
No phase 1 IKE SA exist
No phase 2 IPSec SA exist
Active SA pair = 0
ras>
Use the following command to manually bring up a previously configured VPN tunnel.
ras> ipsec dial 1
Start dialing for tunnel <rule# 1>...
.....................
2.7 Dialing PPPoE and PPTP Connections
This example shows dialing up remote node “WAN 1” using PPPoE.
ras> poe dial "WAN 1"
Start dialing for node <WAN 1>...
### Hit any key to continue.###
$$$ DIALING dev=6 ch=0..........
$$$ OUTGOING-CALL phone()
$$$ CALL CONNECT speed<100000000> type<6> chan<0>
$$$ LCP opened
$$$ PAP sending user/pswd
$$$ IPCP negotiation started
$$$ IPCP neg' Primary DNS 192.168.30.1
$$$ IPCP neg' Primary DNS 172.16.5.2
$$$ IPCP opened
ZyWALL (ZyNOS) CLI Reference Guide
29
Chapter 2 Common Commands
This example shows dialing up remote node “WAN 1” using PPTP.
ras> pptp dial "WAN 1"
Start dialing for node <WAN 1>...
### Hit any key to continue.###
ras>
30
ZyWALL (ZyNOS) CLI Reference Guide
Loading...
+ 174 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.