搜档网
当前位置:搜档网 › 思科5505配置详解

思科5505配置详解

思科5505配置详解
思科5505配置详解

Cisco ASA 5505配置详解

(2011-06-10 09:46:21)

分类:IT

标签:

it

在配ASA 5505时用到的命令

2009-11-22 22:49

nat-control命令

在6.3的时候只要是穿越防火墙都需要创建转换项,比如:nat;static等等,没有转换项是不能穿越防火墙的,但是到了7.0这个规则有了变化,不需要任何转换项也能正常的像路由器一样穿越防火墙。但是一个新的命令出现了!当你打上nat-control这个命令的时候,这个规则就改变得和6.3时代一样必须要有转换项才能穿越防火墙了。7.0以后开始nat-control 是默认关闭的,关闭的时候允许没有配置NAT规则的前提下和外部主机通信,相当于路由器一样,启用NAT开关后内外网就必须通过NAT转换才能通信

1、定义外口

interface Ethernet0/0 进入端口

nameif outside 定义端口为外口

security-level 0 定义安全等级为0

no shut 激活端口

ip address ×.×.×.× 255.255.255.248 设置IP

2、定义内口

interface Ethernet0/1

nameif inside 定义端口为内

security-level 100 定义端口安去昂等级为100

no shut

ip address 192.168.1.1 255.255.255.0

3、定义内部NAT范围。

nat (inside) 1 0.0.0.0 0.0.0.0 任何IP都可以NAT,可以自由设置范围。

4、定义外网地址池

global (outside) 1 10.21.67.10-10.21.67.14 netmask 255.255.255.240

global (outside) 1 interface 当ISP只分配给一个IP是,直接使用分配给外口的IP地址。5、设置默认路由

route outside 0 0 218.17.148.14 指定下一条为IPS指定的网关地址

查看NAT转换情况

show xlate

---------------------------------------------------

一:6个基本命令:nameif、interface、ip address 、nat、global、route。

二:基本配置步骤:

step1: 命名接口名字

nameif ethernet0 outside security0

nameif ethernet1 inside security100

nameif ethernet2 dmz security50

**7版本的配置是先进入接口再命名。

step2:配置接口速率

interface ethernet0 10full auto

interface ethernet1 10full auto

interface ethernet2 10full

step3:配置接口地址

ip address outside 218.106.185.82

ip address inside 192.168.100.1 255.255.255.0

ip address dmz 192.168.200.1 255.255.255.0

step4:地址转换(必须)

* 安全高的区域访问安全低的区域(即内部到外部)需NAT和global;

nat(inside) 1 192.168.1.1 255.255.255.0

global(outside) 1 222.240.254.193 255.255.255.248

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

* 如果内部有服务器需要映射到公网地址(外网访问内网)则需要static和conduit或者acl. static (inside, outside) 222.240.254.194 192.168.1.240

static (inside, outside) 222.240.254.194 192.168.1.240 10000 10

后面的10000为限制连接数,10为限制的半开连接数。

conduit permit tcp host 222.240.254.194 eq www any

conduit permit icmp any any (这个命令在做测试期间可以配置,测试完之后要关掉,防止不必要的漏洞)

ACL实现的功能和conduit一样都可实现策略访问,只是ACL稍微麻烦点。conduit现在在7版本已经不能用了。

Access-list 101 permit tcp any host 222.240.254.194 eq www

Access-group 101 in interface outside (绑定到接口)

***允许任何地址到主机地址为222.240.254.194的www的tcp访问。

Step5:路由定义:

Route outside 0 0 222.240.254.193 1

Route inside 192.168.10.0 255.255.255.0 192.168.1.1 1

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

Step6:基础配置完成,保存配置。

Write memory write erase 清空配置

reload

---------------------------------------------------

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

常用命令有: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口出去。

-----------------------------------------------

例子:

sh run

: Saved

:

ASA Version 8.0(2)

!

hostname ciscoasa

enable password 2KFQnbNIdI.2KYOU encrypted

names

!

interface Vlan1

nameif inside

security-level 100

ip address 10.115.25.1 255.255.255.0

!

interface Vlan2

nameif outside

security-level 0

ip address 124.254.4.78 255.255.255.248

!

interface Ethernet0/0

switchport access vlan 2

!

interface Ethernet0/1

!

interface Ethernet0/2

!

interface Ethernet0/3

!

interface Ethernet0/4

!

interface Ethernet0/5

!

interface Ethernet0/6

!

interface Ethernet0/7

!

passwd 2KFQnbNIdI.2KYOU encrypted

ftp mode passive

dns domain-lookup inside

dns domain-lookup outside

access-list 100 extended permit icmp any any

access-list 100 extended permit tcp any host 124.254.4.78 eq www

access-list 100 extended permit tcp any host 124.254.4.78 eq smtp

access-list 100 extended permit tcp any host 124.254.4.78 eq pop3

access-list 100 extended permit tcp any host 124.254.4.78 eq ftp

access-list 100 extended permit tcp any host 124.254.4.78 eq ssh

access-list 100 extended permit tcp any host 124.254.4.78 eq pcanywhere-data access-list 100 extended permit udp any host 124.254.4.78 eq pcanywhere-status access-list 100 extended permit tcp any host 124.254.4.78 eq 8086

access-list 100 extended permit tcp any host 124.254.4.78 eq 3389

access-list 100 extended permit tcp any host 124.254.4.78 eq 2401

access-list 100 extended permit ip any any

access-list 100 extended permit ip any host 124.254.4.78

pager lines 24

mtu inside 1500

mtu outside 1500

icmp unreachable rate-limit 1 burst-size 1

no asdm history enable

arp timeout 14400

global (outside) 1 interface

nat (inside) 1 0.0.0.0 0.0.0.0

static (inside,outside) tcp 124.254.4.78 www 10.115.25.2 www netmask 255.255.255.255 static (inside,outside) tcp 124.254.4.78 ftp 10.115.25.2 ftp netmask 255.255.255.255 static (inside,outside) tcp 124.254.4.78 smtp 10.115.25.2 smtp netmask 255.255.255.255 static (inside,outside) tcp 124.254.4.78 pop3 10.115.25.2 pop3 netmask 255.255.255.255 static (inside,outside) tcp 124.254.4.78 3389 10.115.25.2 3389 netmask 255.255.255.255 static (inside,outside) tcp 124.254.4.78 8086 10.115.25.2 8086 netmask 255.255.255.255 static (inside,outside) 124.254.4.78 10.115.25.2 netmask 255.255.255.255

access-group 100 in interface outside

route outside 0.0.0.0 0.0.0.0 124.254.4.73 1

timeout xlate 3:00:00

timeout conn 1:00:00 half-closed 0:10:00 udp 0:02:00 icmp 0:00:02

timeout sunrpc 0:10:00 h323 0:05:00 h225 1:00:00 mgcp 0:05:00 mgcp-pat 0:05:00 timeout sip 0:30:00 sip_media 0:02:00 sip-invite 0:03:00 sip-disconnect 0:02:00 timeout uauth 0:05:00 absolute

dynamic-access-policy-record DfltAccessPolicy

no snmp-server location

no snmp-server contact

snmp-server enable traps snmp authentication linkup linkdown coldstart

no crypto isakmp nat-traversal

telnet 10.115.25.0 255.255.255.0 inside

telnet timeout 5

ssh timeout 5

console timeout 0

threat-detection basic-threat

threat-detection statistics access-list

!

class-map inspection_default

match default-inspection-traffic

!

!

policy-map type inspect dns preset_dns_map

parameters

message-length maximum 512

policy-map global_policy

class inspection_default

inspect dns preset_dns_map

inspect ftp

inspect h323 h225

inspect h323 ras

inspect netbios

inspect rsh

inspect rtsp

inspect skinny

inspect esmtp

inspect sqlnet

inspect sunrpc

inspect tftp

inspect sip

inspect xdmcp

inspect http

!

service-policy global_policy global

prompt hostname context

Cryptochecksum:deca4473c55485d04a622b1b9fca73d8

: end

ciscoasa#

-----------------------------------------------

asa 5505

1.配置防火墙名

ciscoasa> enable

ciscoasa# configure terminal

ciscoasa(config)# hostname asa5505

2.配置telnet

asa5505(config)#telnet 192.168.1.0 255.255.255.0 inside

//允许内部接口192.168.1.0网段telnet防火墙

3.配置密码

asa5505(config)# password cisco

//远程密码

asa5505(config)# enable password cisco

//特权模式密码

4.配置IP

asa5505(config)# interface vlan 2

//进入vlan2

asa5505(config-if)# ip address 218.xxx.37.222 255.255.255.192 //vlan2配置IP

asa5505(config)#show ip address vlan2

//验证配置

5.端口加入vlan

asa5505(config)# interface e0/3

//进入接口e0/3

asa5505(config-if)# switchport access vlan 3

//接口e0/3加入vlan3

asa5505(config)# interface vlan 3

//进入vlan3

asa5505(config-if)# ip address 10.10.10.36 255.255.255.224 //vlan3配置IP

asa5505(config-if)# nameif dmz

//vlan3名

asa5505(config-if)# no shutdown

//开启

asa5505(config-if)# show switch vlan

//验证配置

6.最大传输单元MTU

asa5505(config)#mtu inside 1500

//inside最大传输单元1500字节

asa5505(config)#mtu outside 1500

//outside最大传输单元1500字节

asa5505(config)#mtu dmz 1500

//dmz最大传输单元1500字节

7.配置arp表的超时时间

asa5505(config)#arp timeout 14400

//arp表的超时时间14400秒

8.FTP模式

asa5505(config)#ftp mode passive

//FTP被动模式

9.配置域名

asa5505(config)#domain-name https://www.sodocs.net/doc/636670024.html,

10.启动日志

asa5505(config)#logging enable

//启动日志

asa5505(config)#logging asdm informational

//启动asdm报告日志

asa5505(config)#Show logging

//验证配置

11.启用http服务

asa5505(config)#http server enable

//启动HTTP server,便于ASDM连接。

asa5505(config)#http 0.0.0.0 0.0.0.0 outside

//对外启用ASDM连接

asa5505(config)#http 0.0.0.0 0.0.0.0 inside

//对内启用ASDM连接

12.控制列表

access-list acl_out extended permit tcp any any eq www

//允许tcp协议80端口入站

access-list acl_out extended permit tcp any any eq https

//允许tcp协议443端口入站

access-list acl_out extended permit tcp any host 218.xxx.37.223 eq ftp

//允许tcp协议21端口到218.xxx.37.223主机

access-list acl_out extended permit tcp any host 218.xxx.37.224 eq 3389

//允许tcp协议3389端口到218.xxx.37.224主机

access-list acl_out extended permit tcp any host 218.xxx.37.225 eq 1433

//允许tcp协议1433端口到218.xxx.37.225主机

access-list acl_out extended permit tcp any host 218.xxx.37.226 eq 8080

//允许tcp协议8080端口到218.xxx.37.226主机

asa5505(config)#show access-list

//验证配置

13.设置路由

asa5505(config)#route dmz 10.0.0.0 255.0.0.0 10.10.10.33 1

//静态路由到10.0.0.0网段经过10.10.10.33网关跳数为1

asa5505(config)#route outside 0.0.0.0 0.0.0.0 218.16.37.193 1

//默认路由到所有网段经过218.xxx.37.193网关跳数为1

asa5505# show route

//显示路由信息

14.静态NAT

asa5505(config)# static (inside,outside) 218.xxx.37.223 192.168.1.6 netmask 255.255.255.255 //外网218.xxx.37.223映射到内网192.168.1.6

asa5505(config)#access-list acl_out extended permit icmp any any

//控制列表名acl_out允许ICMP协议

asa5505(config)#access-group acl_out in interface outside

//控制列表acl_out应用到outside接口

asa5505(config)#static (inside,dmz) 10.10.10.37 192.168.1.16 netmask 255.255.255.255

//dmz10.10.10.37映射到内网192.168.1.16

asa5505(config)#access-list acl_dmz extended permit icmp any any

//控制列表名acl_dmz允许ICMP协议

asa5505(config)#access-group acl_dmz in interface dmz

//控制列表acl_out应用到dmz接口

asa5505(config)#Show nat

//验证配置

15.动态NAT

asa5505(config)#global(outside) 1 218.201.35.224-218.201.35.226

//定义全局地址池

asa5505(config)#nat(inside) 1 192.168.1.20-192.168.1.22

//内部转换地址池

asa5505(config)# show xlate

//验证配置

16.基于端口NAT(PAT)

asa5505(config)#global (outside) 2 interface

//定义全局地址即outside地址:218.xxx.37.222

asa5505(config)#nat (inside) 2 192.168.1.0 255.255.255.0

//内部转换地址池

asa5505(config)# show xlate

//验证配置

17.基于LAN故障倒换(failover)

1).主防火墙配置

asa5505(config)#failover mac addr outside 001a.2b3c.4d11 001a.2b3c.4w12

//故障倒换虚拟MAC地址

asa5505(config)#failover mac addr inside 001a.2b3c.4d21 001a.2b3c.4w22

//故障倒换虚拟MAC地址

asa5505(config)#failover mac addr inside 001a.2b3c.4d21 001a.2b3c.4w32

//故障倒换虚拟MAC地址

asa5505(config)#failover

//启动故障倒换

asa5505(config)#failover lan unit primary

//设置主要防火墙

asa5505(config)#failover lan interface standby Vlan4

//故障倒换接口名standby

asa5505(config)#failover interface ip standby 172.168.32.1 255.255.255.252 standby 172.168.32.2

//配置主防火墙IP:172.168.32.1,备用防火墙IP:172.168.32.2

asa5505# show failover

//验证配置

2).备防火墙配置

asa5505(config)#failover mac addr outside 001a.2b3c.4d11 001a.2b3c.4w12

//故障倒换虚拟MAC地址

asa5505(config)#failover mac addr inside 001a.2b3c.4d21 001a.2b3c.4w22

//故障倒换虚拟MAC地址

asa5505(config)#failover mac addr inside 001a.2b3c.4d21 001a.2b3c.4w32

//故障倒换虚拟MAC地址

asa5505(config)#failover

//启动故障倒换

asa5505(config)#failover lan unit secondary

//设置备用防火墙

asa5505(config)#failover lan interface standby Vlan4

//故障倒换接口名standby

asa5505(config)#failover interface ip standby 172.168.32.1 255.255.255.252 standby 172.168.32.2

//配置主防火墙IP:172.168.32.1,备用防火墙IP:172.168.32.2

asa5505# show failover

//验证配置

18.显示mac地址

asa5505# show switch mac-address-table

19.保存配置

asa5505# write memory

思科交换机命令大全

思科交换机常用命令大全 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路由器配置ACL控制列表

如果有人说路由交换设备主要就是路由和交换的功能,仅仅在路由交换数据包时应用的话他一定是个门外汉。 如果仅仅为了交换数据包我们使用普通的HUB就能胜任,如果只是使用路由功能我们完全可以选择一台W I N D O W S服务器来做远程路由访问配置。 。 ? 。 则 由于ACL涉及的配置命令很灵活,功能也很强大,所以我们不能只通过一个小小的例子就完全掌握全部ACL的配置。在介绍例子前为大家将ACL设置原则罗列出来,方便各位读者更好的消化A C L知识。

1、最小特权原则 只给受控对象完成任务所必须的最小的权限。也就是说被控制的总规则是各个规则的交集,只满足部分条件的是不容许通过规则的。 2、最靠近受控对象原则 。 则 。 的权限级别等。因此,要达到端到端的权限控制目的,需要和系统级及应用级的访问权限控制结合使用。 标准访问列表:

访问控制列表ACL分很多种,不同场合应用不同种类的ACL。其中最简单的就是标准访问控制列表,标准访问控制列表是通过使用IP包中的源IP地址进行过滤,使用的访问控制列表号1到99来创建相应的A C L 标准访问控制列表的格式 99 。 。 址 。192.168.1.00.0.0.25 5 通过上面的配置将来自192.168.1.0/24的所有计算机数据包进行过滤丢弃。为什么后头的子网掩码表示的是0.0.0.255呢?这是因为CISCO规定在ACL中用反向掩玛表示子网掩码,反向掩码为0.0.0.255的代表他的子网掩码为255.255.255.0。

小提示:对于标准访问控制列表来说,默认的命令是HOST,也就是说access-list 10 deny 192.168.1.1表示的是拒绝192.168.1.1这台主机数据包通讯,可以省去我们输入host 命令。 标准访问控制列表实例一 , 。 的 。 经过设置后E1端口就只容许来自172.16.4.13这个IP地址的数据包传输出去了。来自其他IP地址的数据包都无法通过E1传输。 小提示:由于CISCO默认添加了DENY ANY的语句在每个ACL中,所以上面的access-list 1 deny any这句命令可以省略。另外在路由器连接网络不多的情况下也可以在E0端口使用ip access-group 1 out命令来宣告,宣告结果和上面最后两句命令效果一样。 标准访问控制列表实例二

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)#

CISCO路由器配置手册----帧中继(Frame Relay)配置

CISCO路由器配置手册----Frame Relay 1. 帧中继技术 帧中继是一种高性能的WAN协议,它运行在OSI参考模型的物理层和数据链路层。它是一种数据包交换技术,是X.25的简化版本。它省略了X.25的一些强健功能,如提供窗口技术和数据重发技术,而是依靠高层协议提供纠错功能,这是因为帧中继工作在更好的WAN设备上,这些设备较之X.25的WAN设备具有更可靠的连接服务和更高的可靠性,它严格地对应于OSI参考模型的最低二层,而X.25还提供第三层的服务,所以,帧中继比X.25具有更高的性能和更有效的传输效率。 帧中继广域网的设备分为数据终端设备(DTE)和数据电路终端设备(DCE),Cisco 路由器作为 DTE设备。 帧中继技术提供面向连接的数据链路层的通信,在每对设备之间都存在一条定义好的通信链路,且该链路有一个链路识别码。这种服务通过帧中继虚电路实现,每个帧中继虚电路都以数据链路识别码(DLCI)标识自己。DLCI的值一般由帧中继服务提供商指定。帧中继即支持PVC也支持SVC。 帧中继本地管理接口(LMI)是对基本的帧中继标准的扩展。它是路由器和帧中继交换机之间信令标准,提供帧中继管理机制。它提供了许多管理复杂互联网络的特性,其中包括全局寻址、虚电路状态消息和多目发送等功能。 2. 有关命令: 端口设置 任务命令 设置Frame Relay封装encapsulation frame-relay[ietf] 1 设置Frame Relay LMI类型frame-relay lmi-type {ansi | cisco | q933a}2 设置子接口interface interface-type interface-number.subinterface -number [multipoint|point-to-point] 映射协议地址与DLCI frame-relay map protocol protocol-address dlci

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 //进入线路模式

最新思科CISCO路由器配置步骤

前思科路由器已经成为路由行业的领军人物,可能好多人还不了解Cisco路由器配置的步骤,没有关系,看完本文你肯定有不少收获,希望本文能教会你更多东西,该单位公司总部在北京,全国有3个分支机构。 要求做到在4个地点的数据能够实时查询,便于业务员根据具体情况作出正确决策。早期方案是使用路由器,通过速率为256Kbps的DDN专网连接北京总部。但技术人员通过市场调研,发现该网络运营成本过高。通过进一步的咨询和调整,最终方案是分支机构使用DDN在本地接入Internet,总部使用以太网就近接入Internet。并对互联的Cisco路由器配置,使用VPN技术,保证内部数据通过Internet安全传输。该企业的网络分布见附图。 配置过程及测试步骤 在实施配置前,需要检查硬件和软件是否支持VPN。对于Cisco路由器配置,要求IOS 版本高于12.0.6(5)T,且带IPSec功能。本配置在Cisco路由器配置通过。以下是分支网络1的路由器实际配置过程,其他路由器的配置方法与此基本一致,只需修改具体的环境参数(IP 地址和接口名称)即可。 配置路由器的基本参数,并测试网络的连通性 (1) 进入Cisco路由器配置模式 将计算机串口与路由器console口连接,并按照路由器说明书配置“终端仿真”程序。执行下述命令进入配置模式。 Router>en Router#config terminal Router(config)# (2)配置路由器的基本安全参数 主要是设置特权口令、远程访问口令和路由器名称,方便远程调试。 Router(config)#enable secret xxxxxxx Router(config)#line vty 0 4 Router(config-line)#password xxxxxx Router(config-line)#exit Router(config)#hostname huadong

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

思科交换机路由器命令 大全 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地址: 交换机显示命令:

思科基本配置命令详解

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

目录 1、基本概念介绍............................................... 2、密码、登陆等基本配置....................................... 3、CISCO设备端口配置详解...................................... 4、VLAN的规划及配置........................................... 4.1核心交换机的相关配置..................................... 4.2接入交换机的相关配置..................................... 5、配置交换机的路由功能....................................... 6、配置交换机的DHCP功能...................................... 7、常用排错命令...............................................

1、基本概念介绍 IOS: 互联网操作系统,也就是交换机和路由器中用的操作系统VLAN: 虚拟lan VTP: VLAN TRUNK PROTOCOL DHCP: 动态主机配置协议 ACL:访问控制列表 三层交换机:具有三层路由转发能力的交换机 本教程中“#”后的蓝色文字为注释内容。 2、密码、登陆等基本配置 本节介绍的内容为cisco路由器或者交换机的基本配置,在目前版本的cisco交换机或路由器上的这些命令是通用的。本教程用的是cisco的模拟器做的介绍,一些具体的端口显示或许与你们实际的设备不符,但这并不影响基本配置命令的执行。 Cisco 3640 (R4700) processor (revision 0xFF) with 124928K/6144K bytes of memory. Processor board ID 00000000 R4700 CPU at 100MHz, Implementation 33, Rev 1.2

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

思科路由器基本配置与常用配置命令(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 ]

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).配置拨号字符串

思科交换机实用配置步骤详解

1.交换机支持的命令: 交换机基本状态: switch: ;ROM状态,路由器是rommon> hostname> ;用户模式 hostname# ;特权模式 hostname(config)# ;全局配置模式 hostname(config-if)# ;接口状态交换机口令设置: 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 ;设置登录口令xx switch#exit ;返回命令

交换机VLAN设置: switch#vlan database ;进入VLAN设置 switch(vlan)#vlan 2 ;建VLAN 2 switch(vlan)#no vlan 2 ;删vlan 2 switch(config)#int f0/1 ;进入端口1 switch(config-if)#switchportaccess vlan 2 ;当前端口加入vlan 2 switch(config-if)#switchport mode trunk ;设置为干线 switch(config-if)#switchport trunk allowed vlan 1,2 ;设置允许的vlan switch(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地址: switch(config)#interface vlan 1 ;进入vlan 1 switch(config-if)#ipaddress ;设置IP地址 switch(config)#ip default-gateway ;设置默认网关

思科Cisco交换机、路由器设置命令(附详解)

交换机口令设置: switch>enable ;进入特权模式 switch#config terminal ;进入全局配置模式 switch(config)#hostname ;设置交换机的主机名switch(config)#enable secret xxx ;设置特权加密口令为xxx switch(config)#enable password xxx ;设置特权非密口令为xxx switch(config)#line console 0 ;进控制台口(Rs232)初始化switch(config-line)#line vty 0 4 ;进入虚拟终端virtual tty switch(config-line)#login ;允许登录 switch(config-line)#password xx ;设置登录口令xx switch#exit ;返回命令 交换机VLAN设置: switch#vlan database ;进入VLAN设置 switch(vlan)#vlan 2 ;建VLAN 2 switch(vlan)#no vlan 2 ;删vlan 2 switch(config)#int f0/1 ;进入端口1

switch(config-if)#switchport access vlan 2 ;当前端口1加入VLAN 2 switch(config-if)#switchport mode trunk ;设置为干线 switch(config-if)#switchport trunk allowed vlan 1,2 ;设置允许的vlan switch(config-if)#switchport trunk encap dot1q ;设置vlan 中继 switch(config)#vtp domain ; 设置发vtp域名 switch(config)#vtp password switch(config)#vtp mode server switch(config)#vtp mode client 交换机设置IP地址: switch(config)#interface vlan 1 ;进入vlan 1 switch(config-if)#ip address ;添加远程登录IP switch(config)#ip default-gateway ;添加默认网关 switch#dir flash: ;查看内存 交换机显示命令: switch#write ;写入保存 switch#show vtp switch#show run ;查看当前配置信息 switch#show vlan ;看VLAN

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 ;查看端口信息

思科路由器配置命令和方法

第一章:路由器配置基础 一、基本设置方式 一般来说,可以用5种方式来设置路由器: 1.Console口接终端或运行终端仿真软件的微机; 2.AUX口接MODEM,通过电话线与远方的终端或运行终端仿真软件的微机相连;3.通过Ethernet上的TFTP服务器; 4.通过Ethernet上的TELNET程序; 5.通过Ethernet上的SNMP网管工作站。 但路由器的第一次设置必须通过第一种方式进行,此时终端的硬件设置如下: 波特率:9600 数据位:8 停止位:1 奇偶校验: 无 二、命令状态 1. router> 路由器处于用户命令状态,这时用户可以看路由器的连接状态,访问其它网络和主机,但不能看到和更改路由器的设置内容。 2. router# 在router>提示符下键入enable,路由器进入特权命令状态router#,这时不但可以执行所有的用户命令,还可以看到和更改路由器的设置内容。 3. router(config)# 在router#提示符下键入configure terminal,出现提示符router(config)#,此时路由器处于全局设置状态,这时可以设置路由器的全局参数。 4. router(config-if)#; router(config-line)#; router(config-router)#;… 路由器处于局部设置状态,这时可以设置路由器某个局部的参数。 5. > 路由器处于RXBOOT状态,在开机后60秒内按ctrl-break可进入此状态,这时路由器不能完成正常的功能,只能进行软件升级和手工引导。 设置对话状态 这是一台新路由器开机时自动进入的状态,在特权命令状态使用SETUP命令也可进入此状态,这时可通过对话方式对路由器进行设置。 三、设置对话过程 显示提示信息 全局参数的设置 接口参数的设置 显示结果 利用设置对话过程可以避免手工输入命令的烦琐,但它还不能完全代替手工设置,一些特殊的设置还必须通过手工输入的方式完成。 进入设置对话过程后,路由器首先会显示一些提示信息: --- System Configuration Dialog --- At any point you may enter a question mark '?' for help. Use ctrl-c to abort configuration dialog at any prompt. Default settings are in square brackets '[]'. 这是告诉你在设置对话过程中的任何地方都可以键入“?”得到系统的帮助,按ctrl-c可以退

思科2960交换机配置命令

思科2960交换机配置命令 交换机的端口工作模式一般可以分为三种:Access(普通模式),Multi(多vlan模式),Trunk(中继模式)。1、允许多个vlan的是multi模式,而不是trunk 模式。2、两个都设为trunk模式:一:如果在同一交换机上,则决不会在同一vlan;二:如果是两个交换机上,且两端口物理连接的话,共享vlan信息。但是这两个端口已经被使用,所以只能说,使用与这两个端口相同vlan的端口的计算机是同一虚拟局域网。3、access和multi模式下,端口用于计算机;trunk 模式下,端口用于交换机间连接。所以access和trunk没有可比性。 交换机基本状态: switch ;ROM状态,路由器是rommon hostname ;用户模式 hostname# ;特权模式 hostname(config)# ;全局配置模式 hostname(config-if)# ;接口状态 交换机口令设置: switchenable ;进入特权模式 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 ;设置登录口令xx switch#exit ;返回命令

Cisco路由器的SSH配置详解

C i s c o路由器的S S H配 置详解 The document was finally revised on 2021

Cisco路由器的SSH配置详解 2008-06-18 13:04 如果你一直利用Telnet控制网络设备,你可以考虑采用其他更安全的方式。 本文告诉你如何用SSH替换Telnet. 使用Telnet这个用来访问远程计算机的TCP/IP协议以控制你的网络设备相当于在离开某个建筑时大喊你的用户名和口令。很快地,会有人进行监听,并且他们会利用你安全意识的缺乏。 SSH是替代Telnet和其他远程控制台管理应用程序的行业标准。SSH命令是加密的并以几种方式进行保密。 在使用SSH的时候,一个数字证书将认证客户端(你的工作站)和服务器(你的网络设备)之间的连接,并加密受保护的口令。SSH1使用RSA加密密钥,SSH2使用数字签名算法(DSA)密钥保护连接和认证。 加密算法包括Blowfish,数据加密标准(DES),以及三重DES (3DES)。SSH保护并且有助于防止欺骗,“中间人”攻击,以及数据包监听。 实施SSH的第一步是验证你的设备支持SSH.请登录你的路由器或交换机,并确定你是否加载了一个支持SSH的IPSec IOS镜像。 在我们的例子中,我们将使用Cisco IOS命令。运行下面的命令: 该命令显示已加载的IOS镜像名称。你可以用结果对比你的供应商的支持特性列表。 在你验证了你的设备支持SSH之后,请确保设备拥有一个主机名和配置正确的主机域,就像下面的一样: 在这个时候,你就可以启用路由器上的SSH服务器。要启用SSH服务器,你首先必须利用下面的命令产生一对RSA密钥:

相关主题