搜档网
当前位置:搜档网 › cisco_ASA配置思科的防火墙命令

cisco_ASA配置思科的防火墙命令

cisco_ASA配置思科的防火墙命令
cisco_ASA配置思科的防火墙命令

要想配置思科的防火墙得先了解这些命令:

常用命令有:nameif、interface、ip address、nat、global、route、static等。

global

指定公网地址范围:定义地址池。

Global命令的配置语法:

global (if_name) nat_id ip_address-ip_address [netmark global_mask]

其中:

(if_name):表示外网接口名称,一般为outside。

nat_id:建立的地址池标识(nat要引用)。

ip_address-ip_address:表示一段ip地址范围。

[netmark global_mask]:表示全局ip地址的网络掩码。

nat

地址转换命令,将内网的私有ip转换为外网公网ip。

nat命令配置语法:nat (if_name) nat_id local_ip [netmark]

其中:

(if_name):表示接口名称,一般为inside.

nat_id:表示地址池,由global命令定义。

local_ip:表示内网的ip地址。对于0.0.0.0表示内网所有主机。

[netmark]:表示内网ip地址的子网掩码。

route

route命令定义静态路由。

语法:

route (if_name) 0 0 gateway_ip [metric]

其中:

(if_name):表示接口名称。

0 0 :表示所有主机

Gateway_ip:表示网关路由器的ip地址或下一跳。

[metric]:路由花费。缺省值是1。

static

配置静态IP地址翻译,使内部地址与外部地址一一对应。

语法:

static(internal_if_name,external_if_name) outside_ip_addr inside_ ip_address 其中:

internal_if_name表示内部网络接口,安全级别较高,如inside。

external_if_name表示外部网络接口,安全级别较低,如outside。

outside_ip_address表示外部网络的公有ip地址。

inside_ ip_address表示内部网络的本地ip地址。

(括号内序顺是先内后外,外边的顺序是先外后内)

例如:

asa(config)#static (inside,outside) 133.0.0.1 192.168.0.8

表示内部ip地址192.168.0.8,访问外部时被翻译成133.0.0.1全局地址

********************************************************************* asa#conf t

asa(config)# hostname asa //设置主机名

asa(config)#enable password cisco //设置密码

配置外网的接口,名字是outside,安全级别0,输入ISP给您提供的地址就行了。

asa(config)#interface GigabitEthernet0/0

asa(config)#nameif outside //名字是outside

asa(config)#securit-level 0 //安全级别0

asa(config)#ip address *.*.*.* 255.255.255.0 //配置公网IP地址

asa(config)#duplex full

asa(config)#

asa(config)#no shutdown

配置内网的接口,名字是inside,安全级别100

asa(config)#interface GigabitEthernet0/1

asa(config)#nameif inside

asa(config)#securit-level 100

asa(config)#duplex full

asa(config)#speed 100

asa(config)#no shutdown

配置DMZ的接口,名字是dmz,安全级别50

asa(config)#interface GigabitEthernet0/2

asa(config)#nameif dmz

asa(config)#securit-level 50

asa(config)#duplex full

asa(config)#

asa(config)#no shutdown

网络部分设置

asa(config)#nat(inside) 1 192.168.1.1 255.255.255.0

asa(config)#global(outside) 1 222.240.254.193 255.255.255.248

asa(config)#nat (inside) 0 192.168.1.1 255.255.255.255 //表示192.168.1.1这个地址不需要转换。直接转发出去。

asa(config)#global (outside) 1 133.1.0.1-133.1.0.14 //定义的地址池

asa(config)#nat (inside) 1 0 0 //0 0表示转换网段中的所有地址。

定义内部网络地址将要翻译成的全局地址或地址范围

配置静态路由

asa(config)#route outside 0 0 133.0.0.2 //设置默认路由133.0.0.2为下一跳

如果内部网段不是直接接在防火墙内口,则需要配置到内部的路由。

asa(config)#Route inside 192.168.10.0 255.255.255.0 192.168.1.1 1

地址转换

asa(config)#static (dmz,outside) 133.1.0.1 10.65.1.101 ;静态NAT

asa(config)#static (dmz,outside) 133.1.0.2 10.65.1.102 ;静态NAT

asa(config)#static (inside,dmz) 10.66.1.200 10.66.1.200 ;静态NAT

如果内部有服务器需要映射到公网地址(外网访问内网)则需要static

asa(config)#static (inside, outside) 222.240.254.194 192.168.1.240

asa(config)#static (inside, outside) 222.240.254.194 192.168.1.240 10000 10 //后面的10000为限制连接数,10为限制的半开连接数

ACL实现策略访问

asa(config)#access-list 101 permit ip any host 133.1.0.1 eq www;设置ACL

asa(config)#access-list 101 permit ip any host 133.1.0.2 eq ftp;设置ACL

asa(config)#access-list 101 deny ip any any ;设置ACL

asa(config)#access-group 101 in interface outside ;将ACL应用在outside端口当内部主机访问外部主机时,通过nat转换成公网IP,访问internet。

当内部主机访问中间区域dmz时,将自己映射成自己访问服务器,否则内部主机将会映射成地址池的IP,到外部去找。

当外部主机访问中间区域dmz时,对133.0.0.1映射成10.65.1.101,static 是双向的。

PIX的所有端口默认是关闭的,进入PIX要经过acl入口过滤。

静态路由指示内部的主机和dmz的数据包从outside口出去。

思科交换机命令大全

思科交换机常用命令大全 1.1 用户模式与特权模式 用户模式:可以使用一些基本的查询命令 特权模式:可以对交换机进行相关的配置 进入特权模式命令:Switch>enable 退出特权模式命令:Switch#exit 启用命令查询:? 时间设置:Switch#clock set 时间(自选参数,参数必须符合交换机要求) 显示信息命令:Switch#show 可选参数 注意:可以用TAB键补齐命令,自选参数为用户自定义参数,可选参数为交换机设定参数 查看交换机配置: Switch#show running-config 保存交换机配置:Switch#copy running-config startup-config Switch#wr 查看端口信息:Switch#show interface 查看MAC地址表:Switch#show mac-address-table 查看交换机CPU的状态信息:Switch#show processes 1.2 全局配置模式 进入全局配置模式:Switch#configure terminal

主机名修改:Switch(config)#hostname 主机名(自选参数) 特权模式进入密码: Switch(config)#enable secret 密码(自选参数) 取消特权模式密码:Switch(config)#no enable secret 取消主机名设置: Switch(config)#no hostname 退出配置模式: Switch(config)#exit 需要特别注意的是在配置模式中无法使用show命令,如果要使用 的话show前必须加do和空格,例如:do show * 指定根交换机命令:Switch(config)#spanning-tree vlan 自选参数(VLAN号)root primary 例如: Switch(config)#spanning-tree vlan 1 root primary 需要注意的是:设置根交换机是基于VLAN的 关闭生成树协议命令:Switch(config)#no spanning-tree vlan 自选参数(VLAN 号) 例如: Switch(config)#no spanning-tree vlan 1 1.3 接口配置模式 进入接口配置模式:Switch(config)#interface 端口名称(可选参数) 启用端口:Switch(config-if)#no shutdown 停用端口:Switch(config-if)#shutdown 进入同种类型多端口配置:Switch(config)# interface range fastethernet 0/1-5 进入不同类型多端口配置:Switch(config)#interface range fastethernet 0/1-5,gigabitethernet 0/1-2

Cisco ASA配置

Cisco ASA配置 思科防火墙ASA5520配置 思科防火墙ASA5520配置: 目的:1、内网可以上网 2、内网可以访问DMZ区域的服务器 3、外网可以通过公网IP访问DMZ区域的服务器 要求:1、内网的网段192.168.10.0 2、DMZ的网段192.168.5.0 3、外网IP地址:200.200.200.82 200.200.200.83 网关255.255.255.248(这个地址一般是运营商提供) 4、外网路由:200.200.200.81 5、DMZ区域的服务器IP地址:192.168.5.2 步骤1:配置接口inside、outside和dmz interface g0/0 speed auto duplex auto nameif inside Security-level 100 ip address 192.168.10.1 255.255.255.0 no shut exit interface g0/1 speed auto duplex auto nameif outside Security-level 0 ip address 200.200.200.82 255.255.255.248 no shut exit interface g0/2 speed auto duplex auto nameif dmz Security-level 50 ip address 192.168.5.1 255.255.255.0 no shut exit 步骤2、添加外网路由 route outside 0 0 200.200.200.81

Cisco设备的基本配置命令

switch> 用户模式 1:进入特权模式 enable switch> enable switch# 2:进入全局配置模式 configure terminal switch> enable switch#c onfigure terminal switch(conf)# 3:交换机命名 hostname aptech2950 以aptech2950为例 switch> enable switch#c onfigure terminal switch(conf)#hostname aptch-2950 aptech2950(conf)# 4:配置使能口令 enable password cisco 以cisco为例 switch> enable switch#c onfigure terminal switch(conf)#hostname aptch2950 aptech2950(conf)# enable password cisco 5:配置使能密码 enable secret ciscolab 以cicsolab为例 switch> enable switch#c onfigure terminal switch(conf)#hostname aptch2950 aptech2950(conf)# enable secret ciscolab 6:设置虚拟局域网vlan 1 interface vlan 1 switch> enable switch#c onfigure terminal switch(conf)#hostname aptch2950 aptech2950(conf)# interface vlan 1 aptech2950(conf-if)#ip address 192.168.1.1 255.255.255.0 配置交换机端口ip 和子网掩码 aptech2950(conf-if)#no shut 是配置处于运行中aptech2950(conf-if)#exit aptech2950(conf)#ip default-gateway 192.168.254 设置网关地址 7:进入交换机某一端口 interface fastehernet 0/17 以17端口为例switch> enable switch#c onfigure terminal switch(conf)#hostname aptch2950 aptech2950(conf)# interface fastehernet 0/17 aptech2950(conf-if)#

思科交换机-常用命令及配置

思科交换机-常用命令及配置 switch> 用户模式 1:进入特权模式enable switch> enable switch# 2:进入全局配置模式configure terminal switch> enable switch#configure terminal switch(conf)# 3:交换机命名hostname name 以cisco001 为例 switch> enable switch#c onfigure terminal switch(conf)#hostname cisco001 cisco001(conf)# 4:配置使能口令(未加密)enable password cisco 以cisco 为例switch> enable switch#configure terminal cisco001(conf)# enable password cisco 5:配置使能密码(加密)enable secret ciscolab 以cicsolab 为例switch> enable switch#configure terminal switch(conf)# enable secret ciscolab

6:设置虚拟局域网vlan 1 interface vlan 1 switch> enable switch#configure terminal switch(conf)# interface vlan 1 switch(conf)# ip address 192.168.1.1 255.255.255.0 配置交换机端口ip 和子网掩码 switch (conf-if)#no shut 激活端口 switch (conf-if)#exit switch (conf)#ip default-gateway 192.168.254 设置网关地址 7:进入交换机某一端口interface fastehernet 0/17 以17 端口为例 switch> enable switch#configure terminal switch(conf)# interface fastehernet 0/17 switch(conf-if)# 8:查看命令show switch> enable switch# show version 察看系统中的所有版本信息 show interface vlan 1 查看交换机有关ip 协议的配置信息 show running-configure 查看交换机当前起作用的配置信息 show interface fastethernet 0/1 察看交换机1 接口具体配置和统计信息 show mac-address-table 查看mac 地址表

cisco交换机(Switch)配置命令大全

1.在基于IOS的交换机上设置主机名/系统名: switch(config)# hostname hostname 在基于CLI的交换机上设置主机名/系统名: switch(enable) set system name name-string 2.在基于IOS的交换机上设置登录口令: switch(config)# enable password level 1 password 在基于CLI的交换机上设置登录口令: switch(enable) set password switch(enable) set enalbepass 3.在基于IOS的交换机上设置远程访问: switch(config)# interface vlan 1 switch(config-if)# ip address ip-address netmask switch(config-if)# ip default-gateway ip-address 在基于CLI的交换机上设置远程访问: switch(enable) set interface sc0 ip-address netmask broadcast-address switch(enable) set interface sc0 vlan switch(enable) set ip route default gateway 4.在基于IOS的交换机上启用和浏览CDP信息: switch(config-if)# cdp enable switch(config-if)# no cdp enable

为了查看Cisco邻接设备的CDP通告信息: switch# show cdp interface [type modle/port] switch# show cdp neighbors [type module/port] [detail] 在基于CLI的交换机上启用和浏览CDP信息: switch(enable) set cdp {enable|disable} module/port 为了查看Cisco邻接设备的CDP通告信息: switch(enable) show cdp neighbors[module/port] [vlan|duplex|capabilities|detail] 5.基于IOS的交换机的端口描述: switch(config-if)# description description-string 基于CLI的交换机的端口描述: switch(enable)set port name module/number description-string 6.在基于IOS的交换机上设置端口速度: switch(config-if)# speed{10|100|auto} 在基于CLI的交换机上设置端口速度: switch(enable) set port speed moudle/number {10|100|auto} switch(enable) set port speed moudle/number {4|16|auto} 7.在基于IOS的交换机上设置以太网的链路模式: switch(config-if)# duplex {auto|full|half} 在基于CLI的交换机上设置以太网的链路模式: switch(enable) set port duplex module/number {full|half}

1-cisco路由器基本配置及远程登录

实训目的: (1)学习和掌握科路由器的配置方式和要求。 (2)学习和掌握科路由器的工作模式分类、提示符、进入方式。1、路由器的配置方式 ①超级终端方式。该方式主要用于路由器的初始配置,路由器不需要IP地址。基本方法是:计算机通过COM1/COM2口和路由器的Console口连接,在计算机上启用“超级终端”程序,设置“波特率:9600 ,数据位:8,停止位:1,奇偶校验: 无,校验:无”即可。常用 ②Telnet方式。该方式配置要求路由器必须配置了IP地址。基本方法是:计算机通过网卡和路由器的以太网接口相连,计算机的网卡和路由器的以太网接口的IP地址必须在同一网段。常用 ③其他方式:AUX口接MODEM,通过电话线与远方运行终端仿真软件的微机;通过Ethernet上的TFTP服务器;通过Ethernet上的SNMP网管工作站。 2、路由器的工作模式 在命令行状态下,主要有以下几种工作模式: ①一般用户模式。主要用于查看路由器的基本信息,只能执行少数命令,不能对路由 器进行配置。提示符为:Router>;进入方式为:Telnet或Console ②使能(特权)模式。主要用于查看、测试、检查路由器或网络,不能对接口、路由 协议进行配置。提示符为:Router#;进入方式为:Router>enable。 ③全局配置模式。主要用于配置路由器的全局性参数。提示符为:Router(config)#; 进入方式为:Router#config ter。 ④全局模式下的子模式。包括:接口、路由协议、线路等。其进入方式和提示符如下: Router(config)#ineterface e0 //进入接口模式 Router(config-if)#//接口模式提示符 Router(config)#rip //进入路由协议模式 Router(config-router)# //路由协议模式 Router(config)#line con 0 //进入线路模式

思科基本配置命令详解

思科交换机基本配置实例讲解

目录 1、基本概念介绍 (2) 2、密码、登陆等基本配置 (2) 3、C ISCO 设备端口配置详解 (8) 4、V LAN的规划及配置 (13) 4.1核心交换机的相关配置 (13) 4.2接入交换机的相关配置 (25) 5、配置交换机的路由功能 (30) 6、配置交换机的DHCP功能 (31) 7、常用排错命令 (32)

1、基本概念介绍 IOS: 互联网操作系统,也就是交换机和路由器中用的操作系统 VLAN: 虚拟Ian VTP: VLAN TRUNK PROTOCOL DHCP: 动态主机配置协议 ACL :访问控制列表 三层交换机:具有三层路由转发能力的交换机本教程中“ #”后的蓝色文字为注释内容。 2、密码、登陆等基本配置 本节介绍的内容为cisco路由器或者交换机的基本配置,在目前版本的cisco交换机或 路由器上的这些命令是通用的。本教程用的是cisco的模拟器做的介绍,一些具体的端口显 示或许与你们实际的设备不符,但这并不影响基本配置命令的执行。 Cisco 3640 (R4700) processor (revisi on OxFF) with 124928K/6144K bytes of memory. Processor board ID 00000000 R4700 CPU at 100MHz, Implementation 33, Rev 1.2 2 Ether net in terfaces 8 Serial in terfaces DRAM configuration is 64 bits wide with parity enabled. 125K bytes of NVRAM. 8192K bytes of processor board System flash (Read/Write) ---System Configuration Dialog -- Would you like to enter the initial configuration dialog? [yes/no]: n #此处我们选择no,不进入他的初始化配置向导 Press RETURN to get started! #选择no以后,提示你按回车键开始,此处我们需要按回车键 *Mar 1 00:43:56.591: %IP-5-WEBINST_KILL: Term in ati ng DNS process *Mar 1 00:43:58.379: %SYS-5-RESTART: System restarted - Cisco IOS Software, 3600 Software (C3640-JK9O3S-M), Version 12.3(14)T7, RELEASE SOFTWARE (fc2) Tech ni cal Support: https://www.sodocs.net/doc/5d14705330.html,/techsupport

思科交换机路由器命令大全

思科交换机路由器命令 大全 YUKI was compiled on the morning of December 16, 2020

1. 交换机支持的命令:交换机基本状态: 交换机口令设置: switch>enable ;进入特权模式switch#config terminal ;进入全局配置模式 switch(config)#hostname ;设置交换机的主机名 switch(config)#enable secret xxx ;设置特权加密口 令switch(config)#enable password xxa ;设置特权非 密口令switch(config)#line console 0 ;进入控制台 口switch(config-line)#line vty 0 4 ;进入虚拟终端 switch(config-line)#login ;允许登录 switch(config-line)#password xx ;设置登录口令 xxswitch#exit ;返回命令 交换机VLAN设置:

switch(vlan)#vlan 2 ;建VLAN 2switch(vlan)#no vlan 2 ;删vlan 2switch(config)#int f0/1 ;进入端 口1switch(config-if)#switchport access vlan 2 ; 当前端口加入vlan 2switch(config-if)#switchport mode trunk ;设置为干线switch(config- if)#switchport trunk allowed vlan 1,2 ;设置允许 的vlanswitch(config-if)#switchport trunk encap dot1q ;设置vlan 中继switch(config)#vtp domain ;设置发vtp域名switch(config)#vtp password ;设置发vtp密码switch(config)#vtp mode server ;设置发vtp模式switch(config)#vtp mode client ;设置发vtp模式 交换机设置IP地址: 交换机显示命令:

cisco防火墙配置的基本配置

cisco防火墙配置的基本配置 1、nameif 设置接口名称,并指定安全级别,安全级别取值范围为1~100,数字越大安全级别越高。 使用命令: PIX525(config)#nameifethernet0outsidesecurity0 PIX525(config)#nameifethernet1insidesecurity100 PIX525(config)#nameifethernet2dmzsecurity50 2、interface 配置以太口工作状态,常见状态有:auto、100full、shutdown。 auto:设置网卡工作在自适应状态。 100full:设置网卡工作在100Mbit/s,全双工状态。 shutdown:设置网卡接口关闭,否则为激活。 命令: PIX525(config)#interfaceethernet0auto PIX525(config)#interfaceethernet1100full PIX525(config)#interfaceethernet1100fullshutdown 3、ipaddress 配置网络接口的IP地址 4、global 指定公网地址范围:定义地址池。 Global命令的配置语法:

global(if_name)nat_idip_address-ip_address[netmarkglobal_mask] 其中: (if_name):表示外网接口名称,一般为outside。 nat_id:建立的地址池标识(nat要引用)。 ip_address-ip_address:表示一段ip地址范围。 [netmarkglobal_mask]:表示全局ip地址的网络掩码。 5、nat 地址转换命令,将内网的私有ip转换为外网公网ip。 6、route route命令定义静态路由。 语法: route(if_name)00gateway_ip[metric] 7、static 配置静态IP地址翻译,使内部地址与外部地址一一对应。 语法: static(internal_if_name,external_if_name)outside_ip_addrinside_ip_addre ss 8、conduit 管道conduit命令用来设置允许数据从低安全级别的接口流向具有较高安全级别的接口。 语法: conduitpermit|denyprotocolglobal_ipport[-port]foreign_ip[netmask]

cisco配置命令大全

933a LMI使用Q933A标准.LMI(Local management Interface)有3种:ANSI:T1.617;CCITTY:Q933A和CISCO特有的标准。 # fram-relay intf-typ ABC ABC为帧中继设备类型,它们分别是DTE设备,DCE交换机或NNI(网络接点接口)支持。# frame_relay interface_dlci 110 br 配置DLCI(数据链路连接标识符)。 # frame-relay map ip ABCD XXXX broadcast 建立帧中继映射。ABCD为对方ip地址,XXXX为本地DLCI号,broadcast允许广播向前转发或更新路由。 # no shutdown 激活本端口. # exit ---- 5 .帧中继子接口的配置: # conf t # int s0.1 point-to-point

对应S0的子接口1,点对点方式。 # ip addr ABCD XXXX ABCD为子口1的IP地址,XXXX为子网掩码。# frame-relay intreface-dlci 100 br 6.配置拨号备份 (1).配置备份主口 # conf t # int s0 S0为主口. # backup int asy 1 A1口为备份口. # backup delay 0 1 延时1秒. (2).配置虚拟接口 # conf t # ip addr ABCD XXXX

ABCD为虚拟接口IP地址,XXXX为子网掩码。 # encap ppp 封装ppp协议. # dialer in-band 激活随叫随拨功能. # dialer idle-timeout 7200 # dialer map ip ABCD modem-script call broadcast 6225481 br 映射对应的拨号口.ABCD为对方拨号口的ip地址,6225481为对应的电话号码。 # dialer_group 1 定义拨号组成员. (3).配置防火墙 # dialer_list 1 pro ip permit 允许ip协议通过。 (4).配置连接口令 # user name ABCD pass XXXX ABCD为对方主机名,XXXX为连接口令. (5).配置拨号字符串

思科ASA防火墙ASDM安装和配置

CISCO ASA防火墙ASDM安装和配置 准备工作: 准备一条串口线一边接台式机或笔记本一边接防火墙的CONSOLE 接口,通过开始——>程序——> 附件——>通讯——>超级终端 输入一个连接名,比如“ASA”,单击确定。 选择连接时使用的COM口,单击确定。 点击还原为默认值。 点击确定以后就可能用串口来配置防火墙了。 在用ASDM图形管理界面之前须在串口下输入一些命令开启ASDM。 在串口下输入以下命令: ciscoasa> ciscoasa> en Password: ciscoasa# conf t 进入全局模式 ciscoasa(config)# webvpn 进入WEBVPN模式 ciscoasa(config-webvpn)# username cisco password cisco 新建一个用户和密码ciscoasa(config)# int m 0/0 进入管理口 ciscoasa(config-if)# ip address 192.168.4.1 255.255.255.0 添加IP地址ciscoasa(config-if)# nameif guanli 给管理口设个名字 ciscoasa(config-if)# no shutdown 激活接口 ciscoasa(config)#q 退出管理接口 ciscoasa(config)# http server enable 开启HTTP服务 ciscoasa(config)# http 192.168.4.0 255.255.255.0 guanli 在管理口设置可管理的IP 地址 ciscoasa(config)# show run 查看一下配置 ciscoasa(config)# wr m 保存 经过以上配置就可以用ASDM配置防火墙了。 首先用交叉线把电脑和防火墙的管理口相连,把电脑设成和管理口段的IP地址,本例中设为192.168.4.0 段的IP打开浏览器在地址栏中输入管理口的IP地址: https://192.168.4.1 弹出一下安全证书对话框,单击“是” 输入用户名和密码(就是在串口的WEBVPN模式下新建的用户和密码),然后点击“确定”。出现也下对话框,点击“Download ASDM Launcher and Start ASDM”开始安装ASDM管理器,安装完以后从网上下载一个JAVA虚拟机软件(使用1.4以上Java 版本),进入https://www.sodocs.net/doc/5d14705330.html,下载安装,安装完后点击下面的“R un ASDM as a Java Applet ”。 出现以下对话框,点击“是”。 出现以下对话框,输入用户名和密码(就是在串口的WEBVPN模式下新建的用户和密码),然后点击“是”。 出现以下对话框,点击“是”。 进入ASDM管理器。 这样就可以通过ASDM来配置防火墙了。 以后就可以直接使用ASDM来管理防火墙了。

Cisco交换机常用配置命令

Cisco交换机常用配置命令 CISCO交换机基本配置 switch>ena 進入特权模式 switch#erasenvram 全部清除交换机的所有配置 switch#reload 重新启动交换机(初始提示符为switch> ) ------------------------------------------------------------------------------------ CISCO交换机基本配置:Console端口连接 用户模式hostname>; 特权模式hostname(config)# ; 全局配置模式hostname(config-if)# ; 交换机口令设置: switch>enable ;进入特权模式 switch#config;进入全局配置模式 switch(config)#hostname cisco ;设置交换机的主机名 switch(config)#enable secret csico1 ;设置特权加密口令 switch(config)#enable password csico8 ;设置特权非密口令 switch(config)#line console 0 ;进入控制台口 switch(config-line)#line vty 0 4 ;进入虚拟终端 switch(config-line)#login ;虚拟终端允许登录 switch(config-line)#password csico6 ;设置虚拟终端登录口令csico6 switch#write 保存配置設置 switch#copy running-config startup-config 保存配置設置,與write一樣switch#exit;返回命令 配置终端过一会时间就会由全局配置模式自动改为用户模式,将超时设置为永不超时 switch#conf t switch(config)#line con 0 switch(config-line)#exec-timeout 0 --------------------------------------------------------------------------------- 交换机显示命令: switch#write;保存配置信息 switch#showvtp;查看vtp配置信息 switch#show run ;查看当前配置信息 switch#showvlan;查看vlan配置信息 switch#showvlan name vlan2 switch#show interface ;查看端口信息

思科路由器基本配置与常用配置命令

思科路由器基本配置与常用配置命令(simple for CCNA) 启动接口,分配IP地址: router> router> enable router# router# configure terminal router(config)# router(config)# interface Type Port router(config-if)# no shutdown router(config-if)# ip address IP-Address Subnet-Mask router(config-if)# ^z 配置RIP路由协议:30秒更新一次 router(config)# router rip router(config-if)# network Network-Number router(config-if)# ^z 配置IGRP路由协议:90秒更新一次 router(config)# router igrp AS-Number router(config-if)# network Network-Number router(config-if)# ^z配置Novell IPX路由协议:Novell RIP 60秒更新一次 router(config)# ipx routing [node address] router(config)# ipx maximum-paths Paths router(config)# interface Type Port router(config-if)# ipx network Network-Number [encapsulation encapsulation-type] [secondary] router(config-if)# ^z配置DDR: router(config)# dialer-list Group-Number protocol Protocol-Type permit [list ACL-Number] router(config)# interface bri 0 router(config-if)# dialer-group Group-Number router(config-if)# dialer map Protocol-Type Next-Hop-Address name Hostname Telphone-Number router(config-if)# ^z配置ISDN: router(config)# isdn swith-type Swith-Type router(config-if)# ^z 配置Frame Relay: router(config-if)# encapsulation frame-relay [cisco | ietf ] router(config-if)# frame-relay lmi-type [ansi | cisco | q933a ] router(config-if)# bandwidth kilobits router(config-if)# frame-relay invers-arp [ Protocol ] [dlci ] router(config-if)# ^z配置标准ACL: router(config)# access-list Access-List-Number [ permit | deny ] source [ source-mask ] router(config)# interface Type Port router(config-if)# ip access-group Access-List-Number [ in | out ] router(config-if)# ^z配置扩展ACL: router(config)# access-list Access-List-Number [ permit | deny ] [ Protocol | Protocol-Number ] source source-wildcard [ Source-Port ] destination destination-wildcard [ Destination-Port ] [ established ]

思科网络设备配置命令

思科网络设备常用配置命令 一、VLAN配置 1、添加VLAN vlan database //VLAN数据库模式 vlan name 真实设备还可以采用全局模式添加VLAN: config terminal vlan name 2、分配接口 interface range f0/m – n switchport mode access switchport access vlan 3、查看配置 show vlan brief show vlan id 二、中继配置 1、配置Trunk interface f0/m switchport mode trunk switchport trunk encapsulation { isl | dot1q | negotiate } //配封装方式,可不配2、查看接口模式 show interface f0/m switchport 三、VTP配置 vtp domain <域名> //创建VTP域 vtp mode { server | client | transparent } //配VTP模式 vtp password <密码> //配VTP口令 show vtp status //查看配置 四、以太网通道配置 interface range f0/m – n channel-protocol {pagp | lacp} //可以不配 channel-group mode on 五、STP配置 spanning-tree vlan root { primary | secondary } //配为主或次根网桥spanning-tree vlan priority <0~655535> //配优先级,越小越优先show spanning-tree //查看STP 六、三层交换机配置,实现VLAN互通 ip routing //启动路由 interface vlan //配置VLAN的IP地址 ip address no shutdown interface f0/m //配f0/m为路由接口 no switchport

思科防火墙登陆及设置过程

一、防火墙登陆过程telnet 192.168.0.1 输入:123 用户名:en 密码:srmcisco

Conf t Show run 二、公网IP与内网IP映射: static (inside,outside) 61.142.114.180 192.168.0.7 netmask 255.255.255.255 0 0

三、再打开端口:输入以下一笔命今如 access-list acl-out permit tcp any host 61.142.114.183 eq 5800 (打开外部5800端口) access-list acl-out permit tcp any host 61.142.114.183 eq 5900 (打开外部5900端口) access-list acl-out permit tcp any host 61.142.114.183 eq 1433 (打开外部1433端口) access-list acl-in permit tcp any host 61.142.114.183 eq 1433 (打开内部1433端口) access-list acl-in permit tcp any host 61.142.114.183 eq 5900 (打开内部5900端口) access-list acl-in permit tcp any host 61.142.114.183 eq 5800 (打开内部5800端口)

四、登出防火墙:logout 五、增加上网电脑 1、nat (inside) 1 192.168.0.188 255.255.255.255 0 0(上网电脑IP地址) 2、arp inside 192.168.0.188 000f.eafa.645d alias(绑定上网电脑网卡MAC地址)

思科交换机基本配置(非常详细)

cisco交换机基本配置 1.Cisco IOS简介 Cisco Catalyst系列交换机所使用的操作系统是IOS(Internetwork Operating System,互联网际操作系统)或COS (Catalyst Operating System),其中以IOS使用最为广泛,该操作系统和路由器所使用的操作系统都基于相同的内核和shell。 IOS的优点在于命令体系比较易用。利用操作系统所提供的命令,可实现对交换机的配置和管理。Cisco IOS操作系统具有以下特点: (1)支持通过命令行(Command-Line Interface,简称CLI)或Web界面,来对交换机进行配置和管理。 (2)支持通过交换机的控制端口(Console)或Telnet会话来登录连接访问交换机。 (3)提供有用户模式(user level)和特权模式(privileged level)两种命令执行级别,并提供有全局配置、接口配置、子接口配置和vlan数据库配置等多种级别的配置模式,以允许用户对交换机的资源进行配置。 (4)在用户模式,仅能运行少数的命令,允许查看当前配置信息,但不能对交换机进行配置。特权模式允许运行提供的所有命令。 (5)IOS命令不区分大小写。 (6)在不引起混淆的情况下,支持命令简写。比如enable通常可简约表达为en。 (7)可随时使用?来获得命令行帮助,支持命令行编辑功能,并可将执行过的命令保存下来,供进行历史命令查询。 1.搭建交换机配置环境 在对交换机进行配置之前,首先应登录连接到交换机,这可通过交换机的控制端口(Console)连接或通过Telnet登录来实现。 (1)通过Console口连接交换机 对于首次配置交换机,必须采用该方式。对交换机设置管理IP地址后,就可采用Telnet登录方式来配置交换机。 对于可管理的交换机一般都提供有一个名为Console的控制台端口(或称配置口),该端口采用RJ-45接口,是一个符合EIA/TIA-232异步串行规范的配置口,通过该控制端口,可实现对交换机的本地配置。 交换机一般都随机配送了一根控制线,它的一端是RJ-45水晶头,用于连接交换机的控制台端口,另一端提供了DB-9(针)和DB-25(针)串行接口插头,用于连接PC机的COM1或COM2串行接口。Cisco的控制线两端均是RJ-45水晶头接口,但配送有RJ-45到DB-9和RJ-45到DB-25的转接头。 通过该控制线将交换机与PC机相连,并在PC上运行超级终端仿真程序,即可实现将PC机仿真成交换机的一个终端,从而实现对交换机的访问和配置。 Windows系统一般都默认安装了超级终端程序,对于Windows 2000 Server系统,该程序位于【开始】菜单下【程序】中【附件】的【通讯】群组下面,若没有,可利用控制面板中的【添加/删除程序】来安装。单击【通讯】群组下面的【超级终端】,即可启动超级终端。 首次启动超级终端时,会要求输入所在地区的电话区号,输入后将显示下图所示的连接创建对话框,在【名称】输入框中输入该连接的名称,并选择所使用的示意图标,然后单击确定按钮。 图9-2 超级终端连接创建对话框

相关主题