学习啦>学习电脑>网络知识>路由器>路由器设置>cisco思科>

cisco设置方法步骤

时间: 春健736 分享

  思科(Cisco)路由器是一个集成多业务路由器,福利综合服务网络路由器,以及获得回报的网络路由器。cisco路由器怎么设置??有网友提到自己不会设置思科的设备,该怎么办?学习啦小编在网上找了一些教程及命令,需要的朋友可以参考下。

  以下是cisco路由器设置具体命令

  一、 host到router

  1、实验网络拓扑:

  pc( client 4.01)---switch---router1720 ( access server)

  pc配置:

  ip:10.130.23.242/28

  gw:10.130.23.246

  1720接口ip:

  f0:10.130.23.246/28

  lo0:172.16.1.1/24

  1720的ios为c1700-k93sy7-mz.122-8.T5.bin

  2、步骤:

  1、配置isakmp policy:

  crypto isakmp policy 1

  encr 3des

  authen pre-share

  group 2

  2、配置 client地址池

  cry isa client conf address-pool local pool192

  ip local pool pool192 192.168.1.1 192.168.1.254

  3、配置 client有关参数

  cry isa client conf group vclient-group

  ####vclient-group就是在 client的连接配置中需要输入的group authentication name。

  key vclient-key

  ####vclient-key就是在 client的连接配置中需要输入的group authentication password。

  pool pool192 ####client的ip地址从这里选取

  ####以上两个参数必须配置,其他参数还包括domain、dns、wins等,根据情况进行配置。

  4、配置ipsec transform-set

  cry ipsec trans vclient-tfs esp-3des esp-sha-hmac

  5、配置map模板

  cry dynamic-map template-map 1

  set transform-set vclient-tfs ####和第四步对应

  6、配置map

  cry map map 1 ipsec-isakmp dynamic template-map

  #### 使用第?*脚渲玫?map 模板

  cry map map isakmp author list vclient-group ####使用第三步配置的参数authorization

  cry map map client conf address respond ####响应client分配地址的请求

  7、配置静态路由

  ip route 192.168.1.0 255.255.255.0 fastethernet0

  3、说明几点:

  (1)因为1720只有一个fastethernet口,所以用router1720上的lo0地址来模拟router内部网络。

  (2) client使用的ip pool地址不能与router内部网络ip地址重叠。

  (3)10.130.23.0网段模拟公网地址,172.16.1.0网段用于1720内部地址,192.168.1.0网段用于通道。

  (4)没有找到设置 client获取的子网掩码的办法。看来是ios还不支持这个功能。

  (5)关于split tunnel。配置方法:首先,设置access 133 permit ip 172.16.1.0 0.0.0.255 any,允许1720本地网络数据通过tunnel,然后在第三步骤中添加一个参数:acl 133。

  4、附1720的完整配置:

  1720#sh run

  Building configuration...

  Current configuration : 1321 bytes

  !

  version 12.2

  service timestamps debug uptime

  service timestamps log uptime

  no service password-encryption

  !

  hostname 1720

  !

  enable secret 5 class="main">

cisco设置方法步骤

时间: 春健736 分享

  !

  mmi polling-interval 60

  no mmi auto-configure

  no mmi pvc

  mmi snmp-timeout 180

  ip subnet-zero

  !

  !

  no ip domain-lookup

  !

  ip audit notify log

  ip audit po max-events 100

  !

  crypto isakmp policy 1

  encr 3des

  authentication pre-share

  group 2

  crypto isakmp client configuration address-pool local pool192

  !

  crypto isakmp client configuration group vclient-group

  key vclient-key

  domain test.com

  pool pool192

  !

  !

  crypto ipsec transform-set vclient-tfs esp-3des esp-sha-hmac

  !

  crypto dynamic-map template-map 1

  set transform-set vclient-tfs

  !

  !

  crypto map map isakmp authorization list vclient-group

  crypto map map client configuration address respond

  crypto map map 1 ipsec-isakmp dynamic template-map

  !

  !

  !

  !

  interface Loopback0

  ip address 172.16.1.1 255.255.255.240

  !

  interface FastEthernet0

  ip address 10.130.23.246 255.255.255.240

  speed auto

  crypto map map

  !

  interface Serial0

  no ip address

  shutdown

  !

  ip local pool pool192 192.168.1.1 192.168.1.254

  ip classless

  ip route 192.168.1.0 255.255.255.0 FastEthernet0

  no ip http server

  ip pim bidir-enable

  !

  !

  !

  !

  line con 0

  line aux 0

  line vty 0 4

  !

  no scheduler allocate

  end

   Client 4.01的配置:

  新建一个connection entry,参数中name任意起一个,host填入 access server的f0地址10.130.23.246,

  group auahentication中name填vclient-group,password填vclient-key.

  5、测试:

  (1)在pc上运行 client,连接 access server。

  (2)ipconfig/all,查看获取到的ip地址与其他参数。

  (3)在router,show cry isa sa,看连接是否成功。

  (4)从router,ping client已经获取到的ip地址,通过。

  (5)从client,ping router的lo0配置的地址172.16.1.1,通过。

  (6)查看 client软件的status--statistics,可以看到加密与解密的数据量。

  (7)1720上show cry ip sa, 也可以查看加密与解密的数据量。

  6、常用调试?

  show cry isakmp sa

  show cry ipsec sa

  clear cry sa

  clear cry isakmp

  debug cry isakmp #####这是最常用的debug命令,连接的基本错误都可以用它来找到

  debug cry ipsec

  二、easy client的配置(network-extension mode)

  实验网络拓扑:

  router3662( client)---switch---router1720 ( access server)

  pc ( client 4.01)------|

  3662接口ip:

  f0/0:10.130.23.244/28

  f0/1:172.16.2.1/24

  1720接口ip:

  f0:10.130.23.246/28

  lo0:172.16.1.1/24

  pc配置:

  ip:10.130.23.242/28

  gw:10.130.23.246

  1720的ios为c1700-k93sy7-mz.122-8.T5.bin

  3662的ios为c3660-jk9o3s-mz.123-1a.bin

  步骤:

  1、配置1720路由器,参照实验一,设置为 server。

  2、配置3662路由器,设置 client参数

  cry ip client ez vclient ####定义crypto-ez name

  mode network-extension ####设置为网络扩展模式

  group vclient-group key vclient-key ####设置登录 server的组名与组口令

  peer 10.130.23.246 ####设置 server的ip地址,如果启用dns,则可以用hostname

  connect auto ####设置为自动连接。如果设为手动,则必须使用cry ip client ez connect vclient命令来启动通道。

  local-address F0/0 ####设置通道本地地址,选用f0/0,可以保证 server找到它

  3、定义加密数据入口,这里为f0/1

  inter f0/1

  cry ip client ez vclient inside

  4、定义加密数据出口,这里为连接 server的f0/0

  inter f0/0

  cry ip client ez vclient outside

  5、在1720上设置静态路由,地址范围为3662路由本地网络的地址

  ip route 172.16.2.0 255.255.255.0 f0

  6、设置ip dhcp服务 ####cisco推荐使用dhcp来进行本地网络ip的分配。此步骤可选。

  service dhcp ####启动dhcp 服务

  ip dhcp pool dhcppool ####定义dhcp pool name

  network 172.16.2.0 /24 ####定义可分配的IP地址段

  default-router 172.16.2.1 ####定义dhcp client的默认网关

  lease 1 0 0 ####设置ip保留时间

  import all ####如果配置了上级dhcp,server,则接受其所有参数

  ip dhcp excluded-address 172.16.2.1 ####将router上的地址排除

  测试:

  (1)配置好3662上的 client后,自动进行连接。可以通过debug cry isa、deb cry ip client ez、deb cry ip等debug命令输出的信息查看过程与结果。

  (2)在1720上扩展ping,source 10.130.23.246 destination 172.16.2.1,通过。查看show cry ip sa,可以发现数据没有进行加密。

  (3)在1720上扩展ping,source 172.16.1.1 destination 172.16.2.1,通过。查看show cry ip sa,可以发现数据通过加密进行传输。

  (4)在3660上扩展ping,source 172.16.2.1 destination 172.16.1.1,通过。查看show cry ip sa,可以发现数据通过加密进行传输。

  (5)在3660上扩展ping,source 10.130.23.244 destination 172.16.1.1,不通。查看show cry ip sa,可以发现数据不通过加密。

  (6)启动pc client,ping 172.16.1.1,通过。在1720上查看show cry ip sa,可以看到数据通过加密进行传输。

  (7)在pc client,ping 172.16.2.1,通过。在1720和3662上查看show cry ip sa,可以看到数据通过加密进行传输。在1720上show cry isa sa,可以看到两个连接。

  (8)在3660上扩展ping,source 172.16.2.1 destination 192.168.1.10(pc client获得的ip),通过。查看show cry ip sa,可以发现数据通过加密进行传输。

  说明:

  (1)不同平台,不同ios版本,easy client的配置有所不同。特别是加密数据入出接口的配置,配置接口前后,用show cry ip client ez来查看与验证。

  (2)network-extension模式, server和 client两端的内部网络之间可以通过ip地址互相访问。

  (3)以上配置均没有启用split tunnel。设置split tunnel的方法:首先参考实验(一),设置acl 133和cry isa client conf group中的参数,完成后,可以实现测试(1)-(5)。要实现Pc client和3662 client 互通,即测试(6)-(8),还要在1720 的acl 133中添加两条,分别是access 133 permit ip 192.168.1.0 0.0.0.255 any、access 133 permit ip 172.16.2.0 0.0.0.255 any。

  (4)修改1720配置后,需要复位通道,才可以起作用。在pc端,是通过disconnect再connect来实现;在3662上,通过clear cry ip client ez来复位。

  常用调试命令:

  show cry ip client ez

  clear cry ip client ez

  deb cry ip client ez

  show cry ip sa

  deb cry isa

  show cry isa sa

  三、easy client的配置(client mode)

  实验网络拓扑同实验(二)

  实验步骤参考实验(二),其中第二步,将mode network-extension改为mode client。

  测试:

  (1)配置好3662上的 client后,自动进行连接。可以通过debug cry isa、deb cry ip client ez、deb cry ip等debug命令输出的信息查看过程与结果。

  (2)在1720上扩展ping,source 10.130.23.246 destination 172.16.2.1,不通。

  (3)在1720上扩展ping,source 172.16.1.1 destination 172.16.2.1,不通。这是因为3662端ip数据流是通过nat进行传输。

  (4)在3660上扩展ping,source 172.16.2.1 destination 172.16.1.1,通过。查看show cry ip sa,可以发现数据通过加密进行传输。在1720上打开deb ip icmp,可以看到echo reply信息的dst地址为192.168.1.19( client 从 server获取的ip地址)。

  (5)在3660上扩展ping,source 10.130.23.244 destination 172.16.1.1,不通。

  说明:

  (1)client 模式, client端内部网络采用nat方式与 server进行通信, client端网络可以访问server端网络资源,server端网络不能访问client端内部网络资源。

  (2)client与network-extension两种模式,show cry ip sa,可以看到local ident是不同的。

  (3)client模式下,用show ip nat statistics,可以看到nat的配置与数据流量。

  (4)关于split tunnel,client模式的easy client,与pc的 client类似,配置split tunnel的方法也相同。

  常用调试命令:

  show cry ip client ez

  clear cry ip client ez

  deb cry ip client ez

  show cry ip sa

  deb cry isa

  show cry isa sa

  show ip nat statistics

  四、site to site 的配置(采用pre-share)

  实验网络拓扑:

  router3662---switch---router1720

  3662接口ip:

  f0/0:10.130.23.244/28

  f0/1:172.16.2.1/24

  1720接口ip:

  f0:10.130.23.246/28

  lo0:172.16.1.1/24

  1720的ios为c1700-k93sy7-mz.122-8.T5.bin

  3662的ios为c3660-jk9o3s-mz.123-1a.bin

  步骤:

  以1720为例进行配置

  (1)配置静态路由 ####在配置之前,需要保证两方的网络可以互相访问。

  ip route 172.16.2.0 255.255.255.0 10.130.23.244

  (2)定义加密数据的acl

  access 144 permit ip 172.16.1.0 0.0.0.255 172.16.2.0 0.0.0.255

  (3)定义isakmp policy

  cry isa policy 1

  authentication pre-share ####采用pre-share key进行验证

  ####authentication参数必须配置,其他参数如group、hash、encr、lifetime等,如果进行配置,需要注意两个路由器上的对应参数配置必须相同。

  (4)定义pre-share key

  cry isa key pre-share-key address 10.130.23.244

  ####其中pre-share-key 为key,两个路由器上要一样

  ####其中10.130.23.244为peer路由器的ip地址。

  (5)定义transform-set

  cry ipsec transform-set -tfs esp-3des esp-sha-hmac

  ####其中-tfs为transform-set name,后面两项为加密传输的算法

  mode transport/tunnel #####tunnel为默认值,此配置可选

  (6)定义crypto map entry

  cry map -map 10 ipsec-isakmp

  ####其中-map为map name,10 是entry 号码,ipsec-isakmp表示采用isakmp进行密钥管理

  match address 144 ####定义进行加密传输的数据,与第二步对应

  set peer 10.130.23.244 ####定义peer路由器的ip

  set transform-set -tfs ####与第?*蕉杂?br />; ####如果一个接口上要对应多个 peer,可以定义多个entry,每个entry对应一个peer

  (7)将crypto map应用到接谏?br />; inter f0 #####通道入口

  cry map -map

  (8)同样方法配置3662路由器。

  1720的完整配置:

  1720#sh run

  Building configuration...

  Current configuration : 1217 bytes

  !

  version 12.2

  service timestamps debug uptime

  service timestamps log uptime

  no service password-encryption

  !

  hostname 1720

  !

  logging buffered 4096 debugging

  no logging rate-limit

  enable password CISCO

  !

  username vclient1 password 0 vclient1

  mmi polling-interval 60

  no mmi auto-configure

  no mmi pvc

  mmi snmp-timeout 180

  ip subnet-zero

  !

  !

  ip domain-name fjbf.com

  !

  ip audit notify log

  ip audit po max-events 100

  !

  crypto isakmp policy 1

  encr 3des

  authentication pre-share

  group 2

  crypto isakmp key pre-share-key address 10.130.23.244

  !

  !

  crypto ipsec transform-set -tfs esp-3des esp-sha-hmac

  !

  crypto map -map 10 ipsec-isakmp

  set peer 10.130.23.244

  set transform-set -tfs

  match address 144

  !

  !

  !

  !

  interface Loopback0

  ip address 172.16.1.1 255.255.255.0

  !

  interface FastEthernet0

  ip address 10.130.23.246 255.255.255.240

  speed auto

  crypto map -map

  !

  interface Serial0

  no ip address

  encapsulation ppp

  no keepalive

  no fair-queue

  !

  ip classless

  ip route 172.16.2.0 255.255.255.0 10.130.23.244

  no ip http server

  ip pim bidir-enable

  !

  !

  access-list 144 permit ip 172.16.1.0 0.0.0.255 172.16.2.0 0.0.0.255

  !

  !

  line con 0

  exec-timeout 0 0

  speed 115200

  line aux 0

  line vty 0 4

  login

  !

  end  以上内容来自互联网,希望对大家有所帮助。

554278