首页 > 文库大全 > 精品范文库 > 11号文库

cisco2811路由器接入公网的具体配置方法

cisco2811路由器接入公网的具体配置方法



第一篇:cisco2811路由器接入公网的具体配置方法

路由器接入公网的配置方法

电信宽带为2M, 分配给的固定IP地址:202.249.11.101 子网掩码:255.255.255.248 网关:202.249.11.20 局域网规划地址范围为: 192.168.0.2202.249.11.102”中的任意一个外网地址。后面的“overload”则表示,如果有多于地址池中定义的地址数量(比如原来有6个用户上网,他们各自所用的外网地址是202.249.11.97、202.249.11.98、202.249.11.99、202.249.11.100、202.249.11.101、202.249.11.102。而现在突然有30个用户上网了,这时就会按照上面的命令执行一个任务,那就是让多个内网用户使用同一个外网地址。这样一来,这个nanpool地址池就可以带动内网所有用户上网了。所以说,这一条命令是非常重要的!)。

Router#enable password 12345//设置密码为“12345” Router#enable secret 12345//设置特权密文为“12345” Router#line console 0//进入主控制台的“0”端口

Router#password cisco//将进入主控台登录密码设置为“cisco” Router#login//将主控台的“0”端口设置为“允许登录” Router#exit//退出

Router#line vty 0 4//进入VTY(virtue terminal line 虚拟终端,一般针对Telnet登录方式)Router#password cisco//设置虚拟终端登陆时的密码为“cisco” Router#exec-timeout 5 0//设置在登录路由器后,不做任何操作的情况下,5分0秒后将与路由器断开。如果不输入此命令,当你进入路由器没有输入任何内容时,10分钟后将被路由器自动踢出。“exec-timeout”命令的完整形式为:exec-timeout x x(也就是exec-timeout 分秒)注:如果你在此输入“exec-timeout 0 0”则表示你将永远与路由器保持联接,除非你自己logout。

Router#login//千万别忘了这最后一个login,呵~ 这是允许虚拟终端登录的重要命令。好了,现在配置过程基本完成。

在以上配置中,路由器没有启用DHCP功能,所以,客户机如果想上网的话,还要对网卡进行相关设置。例: 客户端网卡的IP地址设置为: 192.168.0.3 子网掩码:255.255.255.0 网关:192.168.0.1 主DNS地址: 202.106.0.20 备用DNS地址:202.106.46.151 不过,大部份朋友使用Cisco 1721路由器后,都会在局域网内架设一台DHCP服务器,即可办公,又可给局域网内机器分配IP地址,从而节

省了1721的内存。建议大家不妨也用这种办法组网。对了,说到路由器的内存,下面再给大家介绍几个常用命令,一定要记住哦~

以下这几条命令都是在“ Router# ”状态下键入的:

show version: 显示系统的硬件配置、软件版本、配置文件的源和名字以及启动镜像等信息。show processes: 显示当前活动进程 show protocols: 显示已经配置的协议 show memory: 显示路由器的内存信息 show ip route: 显示路由表信息 show flash: 显示闪存设备的信息 show running-config: 显示当前活动信息 show startup-config: 显示备份配置文件

show interfaces: 显示已经配置的端口属性。如:show interface eth0 则会显示Ethernet 0的相关配置信息:)

DHCP router(config)#ip dhcp pool word(dhcp pool 的名称,任意取)router(dhcp-config)#network X.X.X.X /24(下放某个网段)router(dhcp-config)#default-router x.x.x.x router(dhcp-config)#dns-server x.x.x.x router(dhcp-config)#lease 1

还要在全局模式下面将网关地址去除,不能下放

router(config)#ip dhcp excluded-address x.x.x.x(gateway)

原本是在SERVER上开启DHCP服务,现在想在CIsco 路由器上设置 IP 范围是 192.168.1.1-192.168.1.255 可以根据MAC分配IP 再做ARP 绑定MAC与IP(会做)自动DHCP范围是 192.168.1.32-64 conf t ip dhcp pool ruef dhcp-config #network 192.168.1.32 255.255.255.224 dhcp-config #dns-server 192.168.1.11 dhcp-config #default-router 192.168.1.1 dhcp-config #lease 30 接下来根据MAC分配指定IP 这里如何配置 dhcp-config #host 192.168.1.129 dhcp-config #client-identifier 0100.2100.f66c.1e 好像绑定不了,什么原因呢

搜索更多相关主题的帖子: Cisco DHCP

第二篇:CISCO路由器IOS升级方法总结

CISCO路由器IOS升级方法总结

前不久,朋友在对一台带语音模快的CISCO2610进行IOS升级时,由于路由器的内存(flash)为8M,IOS软件为7M多,升级后路由器无法正常启动。启动后到rommon 1 >状态,请求帮助。由于本人长期从事计算机网络管理工作,在对CISCO路由器的长期日常维护和管理实践中积累了一定的经验。现总结归纳出CISCO路由器IOS映像升级的几种方法,供广大网络爱好者或同仁参考。在介绍CISCO路由器IOS升级方法前,有必要对Cisco路由器的存储器的相关知识作以简单介绍。路由器与计算机相似,它也有内存和操作系统。在Cisco路由器中,其操作系统叫做互连网操作系统(Internetwork Operating System),常简称为IOS.路由器的存储器主要有:

ROM:只读存储器包含路由器正在使用的IOS的一份副本;

RAM:IOS将随机访问存储器分成共享和主存。主要用来存储运行中的路由器配置和与路由协议有关的IOS数据结构;

FLASH(闪存):用来存储IOS软件映像文件,闪存是可以擦除内存,它能够用IOS的新版本覆写,IOS升级主要是闪存中的IOS映像文件进行更换。

NVRAM:非易失性随机访问存储器,用来存储系统的配置文件。

IOS升级方法一

在对能够正常启动的CISCO路由器的IOS进行升级时,比较简单。具体步骤如下:

1、寻找一种TFTP服务器软件(有CISCO公司的TFTPServer或3COM公司的3Cserver等,在升级较大IOS映象文件时,建议用3Cserver),安装在一台计算机上,将要升级的IOS映象文件拷贝到相关的目录中(例:D:),并运行TFTP服务器软件,通过菜单设置Root目录为拷贝IOS映象文件所在目录(如D:)。假设该计算机的IP地址为10.32.10.1;

2、连接路由器的console口与PC机的COM1(有文档说明),使用PC的超级终端软件访问路由器,将路由器的地址设为10.32.10.32(与计算机的IP地址同网段即可)。建议在进行IOS升级前将原有IOS文件备份下来,防止待升级的IOS文件存在问题不可用; 也可用Router#Show version)QUOTE:Router# dir flash:(查看目前IOS映象文件名,Directory of flash:/ 1-rw-5998292 C2600-I-MZ.122-11.BIN 8388608 bytes total(2390252 bytes free)

Router#copy flash tftp(备份IOS文件)Source filename []?c2600-i-mz.122-11.bin Address or name of remote host []? 10.32.10.1(指定TFTP服务器地址)

Destination filename [c2600-i-mz.122-11.bin]?

!!!!!!!!!!!!!!!!!!!!!

!!!!!!!!!!!!!!!!!!!!!

5998292 bytes copied in 324.071 secs(18509 bytes/sec)Router#

3、对路由器进行IOS升级;

QUOTE:Router#copy tftp flash Address or name of remote host []? 10.32.10.1(指定TFTP服务器地址)

Source filename []? c2600-i-mz.122-11.bin(需升级的新IOS映象文件名)

Destination filename [c2600-i-mz.122-11.bin]?

Do you want to over write? [confirm]

(确认)

Accessing tftp://10.32.10.1/c2600-i-mz.122-11.bin……

Erase flash: before copying? [confirm] Erasing the flash filesystem will remove all files!Continue? [confirm] Erasing device…… eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee ……erasedee

Erase of flash: complete

:!!!!!!!Loading c2600-i-mz.122-11.bin from 10.32.10.1(via Ethernet0/0)!

!!!!!!!!!!!!!!!!!!!!!!

!!!!!!!!!!!!!!!!!!!

[OKRestricted Rights clause at FAR sec.52.227-19 and subparagraph(c)(1)(ii)of the Rights in Technical Data and Computer Software clause at DFARS sec.252.227-7013.cisco Systems,Inc.170 West Tasman Drive San Jose,California 95134-1706 Cisco Internetwork Operating System Software,(11)IOS(tm)C2600 Software(C2600-I-M)Version 12.2T9,RELEASE SOFTWARE(fc1)

TAC Support: http://www.teniu.cc/tac

Copyright(c)1986-2003 by cisco Systems,Inc.Compiled Mon 23-Jun-03 15:42 by cmong Image text-base: 0x8000809C,data-base: 0x80A68B48 cisco 2610(MPC860)processor(revision 0x203)with 22528K/2048K bytes of memory Processor board ID JAD03483395(1128032249)

M860 processor: part number 0,mask 49 Bridging software.X.25 software,Version 3.0.0.1 Ethernet/IEEE 802.3 interface(s)

Serial(sync/async)network interface(s)

32K bytes of non-volatile configuration memory.8192K bytes of processor board System flash(Read/Write)

Press RETURN to get started!

*Mar 1 00:00:05.652: %PA-2-UNDEFPA: Undefined Port Adaptor type 100 in bay 1 *Mar 1 00:00:07.996: %LINK-3-UPDOWN: Interface Ethernet0/0,changed state to up *Mar 1 00:00:07.996: %LINK-3-UPDOWN: Interface Serial0/0,changed state to down *Mar 1 00:00:07.996: %LINK-3-UPDOWN: Interface Serial0/1,changed state to down *Mar 1 00:00:09.142: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/0,changed state to up *Mar 1 00:00:09.142: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0,changed state to down *Mar 1 00:00:09.142: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/1,changed state to down *Mar 1 00:00:09.458: %SYS-5-CONFIG_I: Configured from memory by console *Mar 1 00:00:11.245: %LINK-5-CHANGED: Interface Serial0/1,changed state to administratively down *Mar 1 00:00:12.275: %SYS-5-RESTART: System restarted ——Cisco Internetwork Operating System Software,(11)IOS(tm)C2600 Software(C2600-I-M)Version 12.2T9,RELEASE SOFTWARE(fc1)

TAC Support: http://www.teniu.cc/tac

Copyright(c)1986-2003 by cisco Systems,Inc.Compiled Mon 23-Jun-03 15:42 by cmong *Mar 1 00:00:12.279: %SNMP-5-COLDSTART: SNMP agent on host NE16 is undergoing a cold start Router采用这种方法时,由于使用console口来传送,速率为9600bps,需要时间较长。因此可修改console口速率利用xmodem命令实现快速升级IOS.具体方法如下:

QUOTE:rommon 1 > confreg 回车

Configuration Summary enabled are:

load rom after netboot fails console baud: 9600

原始的速率9600bps boot: image specified by the boot system commands or default to: cisco2-C2600 do you wish to change the configuration? y/n [n]: y(选择 yes)

enable “diagnostic mode”? y/n [n]: n(选择 no)

enable “use net in IP bcast address”? y/n [n]: n(选择 no)

disable “load rom after netboot fails”? y/n [n]: n(选择 no)

enable “use all zero broadcast”? y/n [n]: n(选择 no)

enable “break/abort has effect”? y/n [n]: n(选择 no)

enable “ignore system config info”? y/n [n]: n(选择 no)

change console baud rate? y/n [n]: y(选择 yes)

enter rate: 0 = 9600,1 = 4800,2 = 1200,3 = 2400 4 = 19200,5 = 38400,6 = 57600,7 = 115200 [0]: 7(选择 7,用最大的11520 速率的xmodem传输)

change the boot characteristics? y/n [n]: n(选择 no)

Configuration Summary enabled are:

load rom after netboot fails console baud: 115200 boot: image specified by the boot system commands or default to: cisco2-C2600 do you wish to change the configuration? y/n [n]: n(选择 no)

You must reset or power cycle for new config to take effect rommon 2 > reset 回车注意:在按reset键前,需要修改串口速度(我的电脑——端口属性——串口速度调为115200),然后再修改超级终端里设置速率为115200,记住,一定要这么做,否则会出现乱码!然后关闭这个超级终端,重新建立一个超级终端连接,重新启动系统后,出现

QUOTE:rommon 1> 提示符然后,输入

QUOTE:rommon 1> xmodem-r

Do not start the sending program yet……

Invoke this application only for disaster recovery.Do you wish to continue? y/n [n]: y(选择 yes)

Ready to receive file ……

此时,在超级终端的菜单上的“传送”——“发送文件”——选择IOS映像文件所在地以及选择使用“xmodem”协议,点击“发送”即可。等待10-20分钟左右就可升级完3-6M的IOS文件!待升级完成后,请记住修改回计算机串口与超级终端、路由器confreg下的xmodem等传输速率为9600bps.方法如下:

QUOTE:Router>en 进入新IOS的特权模式

Router#reload 重启系统

Proceed with reload? [confirm] 回车

00:01:04: %SYS-5-RELOAD: Reload requested System Bootstrap,Version 11.3(2)XA4,RELEASE SOFTWARE(fc1)

Copyright(c)1999 by cisco Systems,Inc.TAC:Home:SW:IOS:Specials for info PC = 0xfff0a530,Vector = 0x500,SP = 0x680127b0 C2600 platform with 24576 Kbytes of main memory PC = 0xfff0a530,Vector = 0x500,SP = 0x80004684 monitor: command “boot” aborted due to user interrupt 30秒内按ctrl+break键 rommon 1 > confreg(输入“confreg”命令)

Configuration Summary enabled are:

load rom after netboot fails console baud: 115200

boot: image specified by the boot system commands or default to: cisco2-C2600 do you wish to change the configuration? y/n [n]: y(选择 yes)

enable “diagnostic mode”? y/n [n]: n(选择 no)

enable “use nn IP bcast address”? y/n [n]: n(选择 no)

disable “load rom after netboot fails”? y/n [n]: n(选择 no)

enable “use all zero broadcast”? y/n [n]: n(选择 no)

enable “break/abort has effect”? y/n [n]: n(选择 no)

enable “ignore system config info”? y/n [n]: n(选择 no)

change console baud rate? y/n [n]: y(选择 yes)

enter rate: 0 = 9600,1 = 4800,2 = 1200,3 = 2400 4 = 19200,5 = 38400,6 = 57600,7 = 115200 [7]: 0(选择 0,改回用标准速率速率9600的xmodem传输)

change the boot characteristics? y/n [n]: n(选择 no)

Configuration Summary enabled are:

load rom after netboot fails console baud: 9600 boot: image specified by the boot system commands or default to: cisco2-C2600 do you wish to change the configuration? y/n [n]: n You must reset or power cycle for new config to take effect rommon 2 > 此时手工改回计算机串口与超级终端2者传输速率为9600 然后敲入:

QUOTE:rommon 2 >reset

最好关掉电源后,重新启动。利用xmodem命令实现路由器IOS升级速度较慢,往往等上很长时间,为了快速升级,可以采用下列方法。

(二)通过tftpdnld命令升级IOS,具体步骤如下:

1、用Cisco原配的线缆连接路由器的console口与PC机的COM1,使用PC机的超级终端软件访问路由器;用一根双绞线连接路由器的eth0/0口与PC机的网卡。

2、将路由器的eth0/0口IP地址设为10.32.10.32;PC机的IP地址设为10.32.10.1.将要升级的IOS映象文件拷贝到相关的目录中,并运行TFTP服务器软件,通过菜单设置Root目录为拷贝IOS映象文件所在目录。

3、通过set 命令查看配置参数

QUOTE:rommon 2 > set PS1=rommon!> BOOT= BSI=0 RET_2_RTS= ?=0

4、在 rommon 状态下输入:(注意大小写)

QUOTE:rommon 3 >IP_ADDRESS=10.32.10.1(路由器的ip地址)

rommon 4 >IP_SUBNET_MASK=255.255.255.0(路由器的掩码)

rommon 5 >DEFAULT_GATEWAY=10.32.10.32(缺省网关,是pc机的ip地址)rommon 6 >TFTP_SERVER=10.32.10.32(是pc机的ip地址)

rommon 7 >TFTP_FILE=C2600-I-MZ.122-11.BIN(上传ios文件的名称)

rommon 8>sync(保存参数配置)

rommon 9 >set(查看)

PS1=rommon!> BOOT= IP_ADDRESS=10.32.10.1 IP_SUBNET_MASK=255.255.255.0 DEFAULT_GATEWAY=10.32.10.32 TFTP_SERVER=10.32.10.32 TFTP_FILE=C2600-I-MZ.122-11.BIN BSI=0 RET_2_RTS= ?=0 rommon 10 >tftpdnld执行tftpdnld命令进行ios升级,有时可能会报错或命令不执行,这时只要用sync命令保存配置后,重新启动路由器(最好关掉电源再开机)后,再执行tftpdnld命令就可以了。

QUOTE:rommon 10 >tftpdnld(传送文件)出现提示选择y IP_ADDRESS: 10.32.10.1 IP_SUBNET_MASK: 255.255.255.0 DEFAULT_GATEWAY: 10.32.10.32 TFTP_SERVER: 10.32.10.32 TFTP_FILE: C2600-I-MZ.122-11.BIN Invoke this command for disaster recovery only.WARNING: all existing data in all partitions on flash will be lost!Do you wish to continue? y/n: [n]:

y

!!!!!!!!!!!!!!!Receiving C2600-I-MZ.122-11.BIN from 10.32.10.32!

!!!!!!!!!!!!!!!!!!!!

!!!!!!!!!!!!!!!!!!!!!

File reception completed.Copying file C2600-I-MZ.122-11.BIN to flash.Erasing flash at 0x607c0000 program flash location 0x605b0000 rommon 11> 在rommon 11>提示符下键入reset,或重新启动路由器(power-cycle),进入正常引导状态,即:

rommon 11 >reset 笔者在Cisco2500、2600、7200等系列路由器上均实际操作过,以上为在Cisco2610路由器上实际操作捕获或截屏,所配地址只是特例,大家可根据实际需要予以修改。最后建议:大家在作正常路由器系统升级时,为防止不正确操作等引起的升级失败,请先把路由器原有的系统备份下来。

第三篇:cisco交换机、路由器配置的几个典型试验

实验一:

1.口令和设备名设置

添加任意的交换机或路由器,先对交换机进行操作,双击SwitchA switch>en password:

;第一次密码为空,直接回车 switch#conf t

;进入全局配置模式 switch(config)#hostname swa

;设置交换机名

swa(config)#enable secret aaa

;设置特权加密口令为 aaa swa(config)#enable password aax

;设置特权非密口令为 aax swa(config)#line console 0

;进入控制台口(Rs232)状态 swa(config-line)#login

;允许登录 swa(config-line)#password aa

;设置登录口令aa swa(config-line)#line vty 0 4

;进入虚拟终端virtual tty swa(config-line)#login

;允许登录 swa(config-line)#password a

;设置登录口令a swa(config-line)#exit

;返回上一层 swa(config)#exit

;返回上一层 swa#sh run

;看配置信息 swa#exit

;返回命令

swa>en password:

;试验 哪一个口令可以通过

双击ROA对路由器进行与交换机类似的设置。

2.清除口令

清除交换机口令,实际中是在开机时按住交换机上的mode钮,本模拟机按Ctrl+Break

清除路由器口令,参考如下:双击ROA

先配置路由的特权口令:

router>en password:

;第一次密码为空,直接回车 router#conf t

;进入全局配置模式 router(config)#enable secret aaa

;设置特权加密口令为 aaa router(config)#exit

;返回 router#exit router>en password:aaa router#

清除口令是打开寄存器配置开关:

router#reload

;重新启动,按Ctrl+Break rommon> rommon>confreg 0x2142

;跳过配置,26xx 36xx 45xx rommon>reset

;重新引导,等效于重开机 router>en password: router#conf t router(config)#enable secret bbb

;设置特权加密口令为 aaa router(config)#config-register 0x2102

;正常使用配置文件 router(config)#exit router#exit router>en password:bbb router#

实验二:计算机与交换机IP地址设置 图文件:switch1 规划ip地址:

PCA: 10.65.1.1

PCB: 10.65.1.2

SWA: 10.65.1.3

1.双击PCA

输入用户名:root

输入口令:linux

设置 IP :[root#PCA root]# ifconfig eth0 10.65.1.1 netmask 255.255.0.0

查看 IP :[root#PCA root]# ifconfig 删除 IP : [root#PCA root]# ifconfig eth0 10.65.1.1 netamsk 255.255.0.0 down 设置网关:[root#PCA root]# route add default gw 10.65.1.9 查看网关:[root#PCA root]# route

删除网关:[root#PCA root]# route del default gw 10.65.1.9 2.双击PCB

输入用户名:root

输入口令:linux

设置 IP :[root#PCB root]# ifconfig eth0 10.65.1.2 netmask 255.255.0.0

设置网关:[root#PCB root]# route add default gw 10.65.1.9 3.双击SWA

进入特权模式

: switch>en

进入全局配置模式: switch#conf t

进入默认VLAN状态: switch(config)#int vlan 1

设置ip地址和掩码: switch(config-if)#ip address 10.65.1.3 255.255.0.0

设置switch的网关: switch(config)#ip defaule-gateway 10.65.1.9

查看设置

: #sh run 4.回PCA

[root@PCA root]# ping 10.65.1.1

[root@PCA root]# ping 10.65.1.2

[root@PCA root]# ping 10.65.1.3

5.修改PCB的ip地址

修改为不同网段的一个ip地址,再从PCA Ping PCB。

修改为相同网段的一个ip地址,再从PCA Ping PCB。

断开交换机与PCB计算机连线,再从PCA Ping PCB。

[root@PCA root]# ping 10.65.1.2

实验三 交换机VLAN实验 图文件:switch2

规划ip地址

PCA的ip 地址: 10.65.1.1

PCB的ip 地址: 10.66.1.1

PCC的ip 地址: 10.65.1.3

PCD的ip 地址: 10.66.1.3

SWA的ip 地址: 10.65.1.7

SWB的ip 地址: 10.65.1.8

SWA的f0/1~f0/3 vlan 2 ,f0/8为trunk

SWB的f0/2~f0/4 valn 2 ,f0/1为trunk

2.设置VLAN 双击SWA: 改名Switch为SWA,建立2个vlan: 2 3 SWA#vlan database SWA(vlan)#vlan 2 SWA(vlan)#vlan 3 SWA(vlan)#exit SWA#conf t SWA#sh vlan 将f0/1,f0/2,f0/3 加入到vlan 2 SWA(config)#int f0/1 SWA(config-if)#switchport access vlan 2 SWA(config-if)#int f0/2 SWA(config-if)#switchport access vlan 2 SWA(config-if)#int f0/3 SWA(config-if)#switchport access vlan 2 SWA(config-if)# Ctrl+z SWA#sh vlan 与SWA类似设置SWB 的VLAN。

3.测试可通性

从PCA到PCC测试:(通)[root@PCA root]# ping 10.65.1.3

从PCA到PCB测试:(不通:不是一个网段,且不在一个VLAN)[root@PCA root]# ping 10.66.1.1

从PCB到PCD测试:(不通:要求trunk)[root@PCB root]# ping 10.66.1.3 从PCA到SWA测试:(通)

[root@PCA root]# ping 10.65.1.7 从PCA到SWB测试:(通)

[root@PCA root]# ping 10.65.1.8

从SWA到PCA测试:(通)SWA#ping 10.65.1.1 从SWA到SWB测试:(通)

SWB#ping 10.65.1.8

再将连接两个交换机的接口设置成trunk。SWA(config)#int f0/8 SWA(config-if)#switchport mode trunk SWB(config)#int f0/1 SWB(config-if)#switchport mode trunk 测试从PCA和PCB到PCC、PCD、SWA、SWB的可通性。

5.装入Switch3图文件

(1)都不设vlan情况下,测试连通性。(2)设置有vlan情况下,测试连通性。(3)使用trunk情况下,测试连通性。

实验四:路由器的升级

1.在ROM监控模式下,使用console通过计算机的超级终端设置。装入图文件:router1a

要求路由器的console与计算机的rs232相连。

router>Ctrl+Break

;进入ROM监控状态

rommon>copy xmodem:c2621.bin flash:c2621.bin ;从console升级IOS

#### ok!rommon>dir flash: c2621.bin

这种方式传送的速度比较慢,使用的是RS232串行接口的速率,波特率一般为9600,但不需要IOS的支持,在IOS损坏的情况下往往使用这种方式。

2.在特权模式下的升级 装入图文件:router1b

要求TFTP Server(PCA)接入路由器的以太口,且PCA的ip 地址与路由接口的ip地址 在一个网络段。设置TFTP的ip地址为:10.65.1.1 双击HostA: login: root password: linux [root#linux root]# ifconfig eth0 10.65.1.1 netmask 255.255.0.0 [root#linux root]# ifconfig

;查看IP地址

双击要升级的路由器:

设置与之tftp server相联接口f0/0的ip地址 router(cnfig-if)#ip address 10.65.1.2 255.255.0.0 router#copy tftp flash: tftp server ip address:10.65.1.1 flash file name:C2621.bin

ok!router#dir flash: c2621.bin

这种方式传输的速度较快,使用的是以太网的速率。但要求IOS是好的,所以升级 IOS使用这种方式较好。

3.在rommon监控状态下,使用TFTP升级 装入图文件:router1c

要求路由器console与计算机rs232相连,路由器f0/0与计算机网卡相连。router>Ctrl+Break

;进入ROM监控状态

rommon>ip_address=10.65.1.10

;设置路由器IP

rommon>ip_subnet_mask=255.255.0.0

;设置路由器掩码 rommon>tftp_server=10.65.1.1

;指定TFTP服务器IP rommon>tftp_file=c2600.bin

;所要下载的文件

rommon>tftpdnld

;ROM监控状态升级IOS

ok!rommon>dir flash:

;查看闪存中的内容 c2621.bin rommon>boot

;引导IOS router>

实验五

路由器接口ip设置

装入图文件:router1d 本实验两个计算机,一个路由器,测试路由器的直路由。设置PCA的IP地址为:10.65.1.1 255.255.0.0 设置PCB的IP地址为:10.66.1.1 255.255.0.0 设置RO f0/0的IP为:10.65.1.2 255.255.0.0 设置RO f0/1的IP为:10.66.1.2 255.255.0.0

1.设置计算机ip地址

设置 IP :[root#PCA root]# ifconfig eth0 10.65.1.1 netmask 255.255.0.0

查看 IP :[root#PCA root]# ifconfig

设置网关:[root#PCA root]# route add default gw 10.65.1.2

查看网关:[root#PCA root]# route

设置 IP :[root#PCB root]# ifconfig eth0 10.65.1.1 netmask 255.255.0.0

查看 IP :[root#PCB root]# ifconfig

2.双击ROA,配置路由器的接口IP地址: router>en router#conf t router(config)#hostname roa

roa(config)int f0/0

roa(config-if)#ip address 10.65.1.2 255.255.0.0 roa(config-if)#no shutdown

roa(config)int f0/1

roa(config-if)#ip address 10.66.1.2 255.255.0.0 roa(config-if)#no shut

roa(config)int s0/0

roa(config-if)#clock rate 64000 roa(config-if)#ip address 10.67.1.2 255.255.0.0 roa(config-if)#no shut

roa(config)int s0/1

roa(config-if)#clock rate 64000 roa(config-if)#ip address 10.68.1.2 255.255.0.0 roa(config-if)#no shut

3.在计算机PCA分别ping 路由器的四个接口f0/0、f0/

1、s0/0、s0/1 [root#PCA root]# ping 10.65.1.2 [root#PCA root]# ping 10.66.1.2 [root#PCA root]# ping 10.67.1.2 [root#PCA root]# ping 10.68.1.2

[root#PCB root]# ping 10.65.1.2 [root#PCB root]# ping 10.66.1.2 [root#PCB root]# ping 10.67.1.2 [root#PCB root]# ping 10.68.1.2 上面的ping命令,这PCA都可以通,但PCB只能与直联口通,因为PCB没有设置网关。下面设置PCB的网关: [root#PCB root]# route add default gw 10.66.1.2 [root#PCB root]# route

设置网关:[root#PCB root]# route add default gw 10.65.1.9

查看网关:[root#PCB root]# route 再从PCB ping 各个接口,结果如何?(通)。

实验六 路由器接口的secondary ip 装入图文件:router1e 这个图含有一个路由器,一个交换机,两个计算机。计算机的IP不变,即: 1.检查计算机和交换机的IP和网关,要求: PCA的IP地址:10.65.1.1 网关指向:10.65.1.2 PCB的IP地址:10.66.1.1 网关指向:10.66.1.2 此时PCA与PCB是不通的,因为它们的网络Id不一样。设置交换机的IP地址: switch(config)#int vlan 1 switch(config-if)#ip address 10.65.1.8 255.255.0.0

2.设置路由器的接口f0/0的有两个ip地址。roa(config)int f0/0

roa(config-if)#ip address 10.65.1.2 255.255.0.0 roa(config-if)#no shut roa(config-if)#ip address 10.66.1.2 255.255.0.0 secondary roa(config-if)#no shut roa#sh run

3.测试可通性

[root#PCA root]# ping 10.66.1.1 [root#PCA root]# ping 10.66.1.2 [root#PCB root]# ping 10.65.1.1 [root#PCB root]# ping 10.65.1.2 switch#ping 10.65.1.1 switch#ping 10.66.1.1

以上都是可以通的,如果去掉交换机与路由的连线,PCA和PCB还可以通吗? 可见PCA到PCB的发包是经过路由器的,称之为单臂路由。

这种情况PCA和PCB在同广播域中,对工作带宽不利。如果划分VLAN可以隔离广播域,下面实验是子接口对不同VLAN的路由。

实验七 使用路由器子接口路由情况 装入图文件:router1e(同上图)

此实验计算机和交换机的IP地址和网关不变,但要求交换机工作在两个VLAN的情况下,一个是原有的默认VALN,另一个是新设置的VLAN 2,含f0/

5、f0/6。

1.设置交换机,增加一个vlan 2 switch#vlan database Switch(vlan)#vlan 2 Switch(vlan)#exit Switch#conf t Switch(config)#hostname SWA SWA(config)#int f0/5 SWA(config-if)#switchport access vlan 2 SWA(config-if)#int f0/6 SWA(config-if)#switchport access vlan 2 SWA(config-if)#int f0/1 SWA(config-if)#switchport mode trunk SWA(config-if)# SWA#sh vlan SWA#sh run(检查设置情况)

2.路由器f0/0 有两个子接口

roa(config)int f0/0 roa(config-if)#int f0/0.1 roa(config-subif.1)#encapsulation isl roa(config-subif.1)#ip address 10.65.1.2 255.255.0.0 roa(config-subif.1)#no shut roa(config-subif.1)#int f0/0.2 roa(config-subif.2)#encapsulation isl roa(config-subif.2)#ip address 10.66.1.2 255.255.0.0 roa(config-subif.2)#no shut roa#sh run

检查计算机ip地址与子接口ip地址同网络,计算机网关指向网络的子接口ip。

3.测试可通性

[root#PCA root]# ping 10.66.1.1 [root#PCA root]# ping 10.66.1.2 [root#PCB root]# ping 10.65.1.1 [root#PCB root]# ping 10.65.1.2

在使用一个路由器接口的情况下,如果下接的网络含有不同的VLAN,则要求路由器的接口

要划分成子接口,并绑定isl协议。在交换机上通过多个VLAN的接口,要设置成trunk。

如果去掉交换机与路由的连线,PCA和PCB还可以通吗?可见这也是一种单臂路由。实验八 静态路由实验

装入图文件:router2

先实验有两个路由器,两个计算机。规划IP地址: 1.设置计算机和路由器的IP 设置ROA的IP: f0/0: 10.65.1.2

-->PCA:10.65.1.1 f0/1: 10.66.1.2

s0/0: 10.67.1.2

s0/1: 10.68.1.2-->

设置ROB的IP:

s0/0: 10.68.1.1 <--s0/1: 10.69.1.2 f0/0: 10.70.1.2

f0/1: 10.71.1.2

-->PCB:10.71.1.1

2.静态路由:

ROA(config)#ip route 10.71.0.0 255.255.0.0 10.68.1.1 ROA(config)#ip routing ROA#show ip route

从PCA ping PCB 即: [root@PCA root]# ping 10.71.1.1 [root@PCA root]# ping 10.70.1.2

3.默认路由

ROA(config)#no ip route 10.71.0.0 255.255.0.0 10.68.1.1 ROA(config)#ip route 0.0.0.0 0.0.0.0 10.68.1.1 ROA#show ip route

[root@PCA root]# ping 10.71.1.1 [root@PCA root]# ping 10.70.1.2 使用指定静态路由时,只ping能指定网络,使用默认路由时,不判断目的网络。

4.静态路由接力

再装入图文件:router3

这个网络有三个路由器,四个计算机。假设计算机PCC的IP地址是:10.90.1.1 假设计算机PCD的IP地址是:10.91.1.1 如果要从PCA到PCC可通,要在路经的路由器接力设置静态路由。如: ROA(config)#ip route 10.90.0.0 255.255.0.0 ROA(config)#ip route 10.90.0.0 255.255.0.0 [root@PCA root]# ping 10.90.1.1

实验九 三个路由器的静态路由 装入图文件:router3 设置ROA的IP: f0/0: 10.65.1.2-->PCA:10.65.1.1 f0/1: 10.66.1.2-->PCB:10.66.1.1 s0/0: 10.67.1.2

s0/1: 10.68.1.2-->

设置ROB的IP:

s0/0: 10.68.1.1 <--s0/1: 10.69.1.2--> f0/0: 10.70.1.2

f0/1: 10.71.1.2

设置ROC的IP:

s0/0: 10.69.1.1 <--s0/1: 10.72.1.2

f0/1: 10.73.1.2-->PCC:10.73.1.1 f0/0: 10.74.1.2-->PCD:10.74.1.1

设置从PCA到PCC的静态路由 ROA(config)#ip routing ROA(config)#ip route 10.73.0.0 255.255.0.0 10.68.1.1 ROA#show ip route

ROB(config)#ip route 10.73.0.0 255.255.0.0 10.71.1.1 ROB#show ip route

[root@PCA root]#ping 10.73.1.1

使用默认路由

ROA(config)#no ip route 10.73.0.0 255.255.0.0 10.66.1.1 [root@PCA root]#ping 10.73.1.1 ROA(config)#ip route 0.0.0.0.0.0.0.0 10.68.1.1 [root@PCA root]#ping 10.73.1.1

实验九 三个路由器动态路由实验 装入图文件:router3 实验网络与上个实验相同,ip地址也不变,现在用动态路由实现网络的连通。ROA(config)#ip routing

ROA(config)#router rip ROA(config-router)#network 10.0.0.0

ROB(config)#ip routing

ROB(config)#router rip ROB(config-router)#network 10.0.0.0

ROC(config)#ip routing

ROC(config)#router rip ROC(config-router)#network 10.0.0.0

ROA#sh ip route ROB#sh ip route ROC#sh ip route

是否可以看到动态路由表?如果看不到,请检查路由的接口是否激活,network指定 的网络是否包含指定网络。

从计算机PCA 测试到各点的连通性

注意同一个路由的不同接口应属不同网络,而一条连接两个路由器网络线的两个端点 IP应该属于同一网络。当设置同一路由器IP,而其它端口已有这个网络时,路由器会阻止设置,提示已有这个网络,并显示对应的端口。如果是本端口可以覆盖。

实验十 交换机和路由器组合 装入文件router3a 1.交换机设置

有两种情况,一种是有vlan,一种是无valn,请逐一实验。2.设置静态路

自定义各点IP,在静态路由下完成任意点的连通性。3.设置动态路由。

去掉静态路由,使用动态路由下完成。

4.路由与静态路由结合

停止某一个路由器的动态路由,写入静态路由,测试任意点的连通性。如:

ROC(config)#no router rip ROC(config)#no network ROB(config)#ip route #sh run

实验十 基本访问控制列表 装入文件或route3b

1.配置路由达到网络各点可通。

本实验使用有动态路由,也可以使用静态路由。假设网络是通畅的。ROA f0/0: 10.65.1.2-->PCA:10.65.1.1 ROA f0/1: 10.66.1.2-->PCB:10.66.1.1 ROA s0/0: 10.67.1.2

ROA s0/1: 10.68.1.2-->

ROB s0/0: 10.68.1.1 <--ROB s0/1: 10.69.1.2--> ROB f0/0: 10.70.1.2

ROB f0/1: 10.71.1.2

ROC s0/0: 10.69.1.1 <--ROC s0/1: 10.72.1.2

ROC f0/1: 10.73.1.2-->PCC:10.73.1.1 ROC f0/0: 10.74.1.2-->PCD:10.74.1.1

1.基本的访问控制列表: 先从PCA ping PCD: [root@PCA @root]#ping 10.74.1.1 应该是可以通的。

在ROD的s0/0写一个输入的访问控制列表: ROB(config)#access-list 1 deny any ROB(config)#int s0/0 ROB(config-if)#ip access-group 1 in ROB#sh access-list

测试PCA至PCD的联通性。(deny)测试PCC至PCD的联通性。(deny)测试PCD至PCA的联通性。(permit)

2.删除这个列表

ROD(config)#no access-lilt 1 ROD(config-if)#no ip access-group 1 in 二者都可能实现去掉访问列表的目的。

前者是从列表号角度删除,后者是从接口及输入和输出的角度删除。可以通过sh run 和sh access-list 命令查看删除情况。

3.再写访问控制列表

ROA(config)#access-lilt 1 ROA(config)#access-list 1 deny 10.65.1.1 ROA(config)#access-list 1 permit any ROA(config)#int s0/0 ROA(config-if)#ip access-group 1 out ROA#sh access-list

再测试PCA至PCD的联通性。(deny)再测试PCB至PCD的联通性。(permit)再测试PCD至PCA的联通性。(permit)

4.重新设置各路由接口有电脑的ip地址。写一个梯形的访问控制列表。参考的访问列表如下:

R0B(config)#access-list 4 permit 10.65.1.1 ROB(config)#access-list 4 deny 10.65.1.0 0.0.0.255

(10.65.1.3 deny)ROB(config)#access-list 4 permit 10.65.0.0 0.0.255.255(10.65.0.0 permit)ROB(config)#access-list 4 deny 10.0.0.0 0.255.255.255

(10.66.0.0 deny)ROB(config)#access-list 4 permit any

(11.0.0.0 premit)ROB(config)#int s0/0 ROB(config-if)#ip access-group 4 in 接口的ip地址,计算机的ip地址,请自定。

实验十一 扩展访问控制列表 装入文件router4

扩展的访问控制列表,有源和目的两个ip,并且有协议。下面提供二个参考的例句: 1.阻止PCA访问PCD: ROB(config)# access-list 101 deny icmp 10.65.1.1 0.0.0.0 10.74.1.1 0.0.0.0 echo ROB(config)# access-list 101 permit ip any any ROB(config)# int s0/0 ROB(config-if)#ip access-group 101 in ROB#sh access-list [root@PCA root]#ping 10.74.1.1(不通)[root@PCC root]#ping 10.74.1.1(通)[root@PCD root]#ping 10.65.1.1(通)

2.删除这个列表

ROB(config)#no access-lilt 101 ROB#sh access-list

(无)[root@PCA root]#ping 10.74.1.1(通)

3.阻止10.65.0.0网络访问 10.74.1.1计算机(PCD)。

ROA(config)#access-list 102 deny ip 10.651.1 0.0.0.255 10.74.1.1 0.0.0.0 ROA(config)#access-list 102 permit ip any any ROA(config)#interface s0/1 ROA(config-if)#ip access-group 102(默认为out)[root@PCA root]#ping 10.74.1.1(不通)[root@PCC root]#ping 10.74.1.1(不通)[root@PCD root]#ping 10.65.1.1(通)

实验十二 综合实验 1.2.3.4.装入文件all 并使窗体最大化。自定义各点IP 配置各个设备,确保各个点可能ping通。适当设置访问控制列表,检查结果。

第四篇:cisco 路由器 EZvpn 总结

实验拓扑图:

PC2192.168.150.2/24分支机构PC1192.168.100.0/24E0/3:.1R1192.168.100.2/24192.168.1.0/24E0/0:.1公司总部192.168.150.0/24192.168.2.0/24E0/3:.1E0/1:.2E0/0:.1E0/1:.2192.168.200.0/24E0/3:.1PC3R2R3192.168.200.2/24

实现目标

分支机构为不固定IP地址,分支机构和公司总部实现VPN互联。分支机构能够获取公司总部的网络资源。

基本配置:

EZvpn network-extension 模式 R1基本配置: R1# R1#show run

Building configuration...Current configuration : 1010 bytes!version 12.4 service timestamps debug datetimemsec service timestamps log datetimemsec no service password-encryption!hostname R1!boot-start-marker boot-end-marker!noaaa new-model memory-sizeiomem 5!ipcef noip domain lookup!ipauth-proxy max-nodata-conns 3 ip admission max-nodata-conns 3!!!!!!!!!!!interface Ethernet0/0 ip address 192.168.1.1 255.255.255.0 ipnat outside ip virtual-reassembly half-duplex!interface Ethernet0/1 noip address shutdown half-duplex!interface Ethernet0/2 noip address shutdown half-duplex!interface Ethernet0/3 ip address 192.168.100.1 255.255.255.0 ipnat inside ip virtual-reassembly half-duplex!ip http server noip http secure-server!ip forward-protocol nd ip route 0.0.0.0 0.0.0.0 192.168.1.2!ipnat inside source list 1 interface Ethernet0/0 overload!access-list 1 permit any!!control-plane!!!!!line con 0 exec-timeout 0 0 line aux 0 linevty 0 4 login!end

R1#

R2的基本配置: R2# R2#show run

Building configuration...Current configuration : 825 bytes!version 12.4 service timestamps debug datetimemsec service timestamps log datetimemsec no service password-encryption!hostname R2!boot-start-marker boot-end-marker!noaaa new-model memory-sizeiomem 5!ipcef noip domain lookup!ipauth-proxy max-nodata-conns 3 ip admission max-nodata-conns 3!!!!!!!!!!!interface Ethernet0/0 ip address 192.168.2.1 255.255.255.0 half-duplex!interface Ethernet0/1 ip address 192.168.1.2 255.255.255.0 half-duplex!interface Ethernet0/2 noip address shutdown half-duplex!interface Ethernet0/3 ip address 192.168.150.1 255.255.255.0 half-duplex!ip http server noip http secure-server!ip forward-protocol nd!!

!control-plane!!!!!line con 0 exec-timeout 0 0 line aux 0 linevty 0 4 login!end R2#

R3的基本配置: R3# *Mar 1 00:13:56.891: %SYS-5-CONFIG_I: Configured from console by console R3# R3#show run Building configuration...Current configuration : 1010 bytes!version 12.4 service timestamps debug datetimemsec service timestamps log datetimemsec no service password-encryption!hostname R3!boot-start-marker boot-end-marker!noaaa new-model memory-sizeiomem 5!ipcef noip domain lookup!ipauth-proxy max-nodata-conns 3 ip admission max-nodata-conns 3!!!!!!!!!!!interface Ethernet0/0 noip address shutdown half-duplex!interface Ethernet0/1 ip address 192.168.2.2 255.255.255.0 ipnat outside ip virtual-reassembly half-duplex!interface Ethernet0/2 noip address shutdown half-duplex!interface Ethernet0/3 ip address 192.168.200.1 255.255.255.0 ipnat inside ip virtual-reassembly half-duplex!ip http server noip http secure-server!ip forward-protocol nd ip route 0.0.0.0 0.0.0.0 192.168.2.1!ipnat inside source list 1 interface Ethernet0/1 overload!access-list 1 permit any!!control-plane!!!!!line con 0 exec-timeout 0 0 line aux 0 linevty 0 4 login!end

联通性测试: 在R1上测试:

在R3上测试:

在PC1上测试

在PC2上测试

在PC3上测试

设定公司总部R3为Ezvpn Server,则R3上配置如下 R3# R3#show run

Building configuration...Current configuration : 1505 bytes!version 12.4 service timestamps debug datetimemsec service timestamps log datetimemsec no service password-encryption!hostname R3!boot-start-marker boot-end-marker!aaa new-model!aaa authorization network ezvpnauthor local!aaa session-id common memory-sizeiomem 5!ipcef noip domain lookup!ipauth-proxy max-nodata-conns 3 ip admission max-nodata-conns 3!!!!!!!!!

!cryptoisakmp policy 1 authentication pre-share group 2!cryptoisakmp client configuration group group1 key cisco!cryptoipsec transform-set mysetesp-des esp-md5-hmac!crypto dynamic-map dymap 1 set transform-set myset reverse-route!crypto map vpnmapisakmp authorization list ezvpnauthor crypto map vpnmap client configuration address respond crypto map vpnmap 1 ipsec-isakmp dynamic dymap!!

interface Ethernet0/0 noip address shutdown half-duplex!interface Ethernet0/1 ip address 192.168.2.2 255.255.255.0 ipnat outside ip virtual-reassembly half-duplex crypto map vpnmap!interface Ethernet0/2 noip address shutdown half-duplex!interface Ethernet0/3 ip address 192.168.200.1 255.255.255.0 ipnat inside ip virtual-reassembly half-duplex!

ip http server noip http secure-server!ip forward-protocol nd ip route 0.0.0.0 0.0.0.0 192.168.2.1!ipnat inside source list 1 interface Ethernet0/1 overload!access-list 1 permit any!!control-plane!!!!!

line con 0 exec-timeout 0 0 line aux 0 linevty 0 4!End

公司分部R1为remote角色,在Ezvpn Remote 上面配置 R1# R1#sho run

Building configuration...Current configuration : 1244 bytes!version 12.4 service timestamps debug datetimemsec service timestamps log datetimemsec no service password-encryption!hostname R1!boot-start-marker boot-end-marker!noaaa new-model memory-sizeiomem 5!ipcef noip domain lookup!ipauth-proxy max-nodata-conns 3 ip admission max-nodata-conns 3!!!!!!!!!!!!

cryptoipsec client ezvpn client1 connect auto group group1 key cisco mode network-extension peer 192.168.2.2 xauthuserid mode interactive!!!interface Ethernet0/0 ip address 192.168.1.1 255.255.255.0 ipnat outside ip virtual-reassembly half-duplex cryptoipsec client ezvpn client1!interface Ethernet0/1 noip address shutdown half-duplex!

interface Ethernet0/2 noip address shutdown half-duplex!interface Ethernet0/3 ip address 192.168.100.1 255.255.255.0 ipnat inside ip virtual-reassembly half-duplex cryptoipsec client ezvpn client1 inside!ip http server noip http secure-server!ip forward-protocol nd ip route 0.0.0.0 0.0.0.0 192.168.1.2!ipnat inside source list 1 interface Ethernet0/0 overload!access-list 1 permit any!

!control-plane!!!!!line con 0 exec-timeout 0 0 line aux 0 linevty 0 4 login!end

R1#

查看R1的vpn状态

在PC1上测试

我们发现,vpn隧道虽然建立起来了,但是,外网和总部内网都ping不通了。这是由于PC1的数据都经由隧道了,包括访问公网的数据包,都被导入隧道中。我们将隧道进行分离,让访问公网的数据能正常被NAT成R1的公网地址。

R3#

show run Building configuration...Current configuration : 1568 bytes!version 12.4 service timestamps debug datetimemsec service timestamps log datetimemsec no service password-encryption!hostname R3!boot-start-marker boot-end-marker!aaa new-model!aaa authorization network ezvpnauthor local!aaa session-id common memory-sizeiomem 5!ipcef noip domain lookup!ipauth-proxy max-nodata-conns 3 ip admission max-nodata-conns 3!!!!!!!!!

!cryptoisakmp policy 1 authentication pre-share group 2!cryptoisakmp client configuration group group1 key cisco acl 100!cryptoipsec transform-set mysetesp-des esp-md5-hmac!crypto dynamic-map dymap 1 set transform-set myset reverse-route!crypto map vpnmapisakmp authorization list ezvpnauthor crypto map vpnmap client configuration address respond crypto map vpnmap 1 ipsec-isakmp dynamic dymap!!

!interface Ethernet0/0 noip address shutdown half-duplex!interface Ethernet0/1 ip address 192.168.2.2 255.255.255.0 ipnat outside ip virtual-reassembly half-duplex crypto map vpnmap!interface Ethernet0/2 noip address shutdown half-duplex!interface Ethernet0/3 ip address 192.168.200.1 255.255.255.0 ipnat inside ip virtual-reassembly half-duplex!ip http server noip http secure-server!ip forward-protocol nd ip route 0.0.0.0 0.0.0.0 192.168.2.1!ipnat inside source list 1 interface Ethernet0/1 overload!access-list 1 permit any access-list 100 permit ip 192.168.200.0 0.0.0.255 any!!control-plane!!!!

!line con 0 exec-timeout 0 0 line aux 0 linevty 0 4!end

R3#

在R1上重建VPN

在R1上查看Vpn状态,我们发现,隧道被成功分离,只有去往192.168.200.0/24的数据才会经由隧道。

这个时候,我们在PC1上进行测试

发现,可以正常访问公网,但是还不能访问vpn对端内网,怎么回事呢?我们查看R3的NAT表。

在R3上面查看NAT表

发现,R3内网192.168.200.2机器icmp reply 全部被NAT成R3的公网接口192.168.2.2地址了。

在R3上修正NAT问题 R3# R3#show run Building configuration...Current configuration : 1678 bytes!version 12.4 service timestamps debug datetimemsec service timestamps log datetimemsec no service password-encryption!hostname R3!boot-start-marker boot-end-marker!aaa new-model!aaa authorization network ezvpnauthor local!aaa session-id common memory-sizeiomem 5!ipcef noip domain lookup!ipauth-proxy max-nodata-conns 3 ip admission max-nodata-conns 3!!!!!!!!!

!cryptoisakmp policy 1 authentication pre-share group 2!cryptoisakmp client configuration group group1 key cisco acl 100!cryptoipsec transform-set mysetesp-des esp-md5-hmac!crypto dynamic-map dymap 1 set transform-set myset reverse-route!crypto map vpnmapisakmp authorization list ezvpnauthor crypto map vpnmap client configuration address respond crypto map vpnmap 1 ipsec-isakmp dynamic dymap!!

!interface Ethernet0/0 noip address shutdown half-duplex!interface Ethernet0/1 ip address 192.168.2.2 255.255.255.0 ipnat outside ip virtual-reassembly half-duplex crypto map vpnmap!interface Ethernet0/2 noip address shutdown half-duplex!interface Ethernet0/3 ip address 192.168.200.1 255.255.255.0 ipnat inside ip virtual-reassembly half-duplex!ip http server noip http secure-server!ip forward-protocol nd ip route 0.0.0.0 0.0.0.0 192.168.2.1!ipnat inside source list 111 interface Ethernet0/1 overload!access-list 1 permit any access-list 100 permit ip 192.168.200.0 0.0.0.255 any access-list 111 deny

ip 192.168.200.0 0.0.0.255 192.168.100.0 0.0.0.255 access-list 111 permit ip any any!!control-plane!!!

!!line con 0 exec-timeout 0 0 line aux 0 linevty 0 4!end

R3#

我们通过ACL,先限制源地址192.168.200.0去往192.168.100.0地址进行NAT转换,然后允许其它流量转换。在PC1上重新测试

在PC3上进行测试

OK,VPN实现成功,总部和分支机构内部访问外网和对端网络都正常。

Ezvpn Client模式 R3上配置 R3# R3#show run

Building configuration...Current configuration : 1811 bytes!version 12.4 service timestamps debug datetimemsec service timestamps log datetimemsec no service password-encryption!hostname R3!boot-start-marker boot-end-marker!aaa new-model!aaa authorization network ezvpnauthor local!aaa session-id common memory-sizeiomem 5!ipcef noip domain lookup!ipauth-proxy max-nodata-conns 3 ip admission max-nodata-conns 3!!!!!!!!!

!cryptoisakmp policy 1 authentication pre-share group 2!cryptoisakmp client configuration group group1 key cisco poolezvpnpool acl 100!cryptoipsec transform-set set1 esp-des esp-md5-hmac!crypto dynamic-map dymap 1 set transform-set set1 reverse-route!crypto map vpnmapisakmp authorization list ezvpnauthor crypto map vpnmap client configuration address respond crypto map vpnmap 1 ipsec-isakmp dynamic dymap!

!interface Ethernet0/0 noip address shutdown half-duplex!interface Ethernet0/1 ip address 192.168.2.2 255.255.255.0 ipnat outside ip virtual-reassembly half-duplex crypto map vpnmap!interface Ethernet0/2 noip address shutdown half-duplex!interface Ethernet0/3 ip address 192.168.200.1 255.255.255.0 ipnat inside ip virtual-reassembly half-duplex!ip local pool ezvpnpool 10.10.10.1 10.10.10.100 ip http server noip http secure-server!ip forward-protocol nd ip route 0.0.0.0 0.0.0.0 192.168.2.1!ipnat inside source list 111 interface Ethernet0/1 overload!access-list 1 permit any access-list 100 permit ip 192.168.200.0 0.0.0.255 any access-list 111 deny

ip 192.168.200.0 0.0.0.255 10.10.10.0 0.0.0.255 access-list 111 deny

ip 192.168.200.0 0.0.0.255 192.168.100.0 0.0.0.255 access-list 111 permit ip any any!!control-plane!!

!!!!line con 0 exec-timeout 0 0 line aux 0 linevty 0 4!end

R3#

R1上的配置 R1#show run

Building configuration...Current configuration : 1396 bytes!version 12.4 service timestamps debug datetimemsec service timestamps log datetimemsec no service password-encryption!hostname R1!boot-start-marker boot-end-marker!noaaa new-model memory-sizeiomem 5!ipcef noip domain lookup!ipauth-proxy max-nodata-conns 3 ip admission max-nodata-conns 3!!!!!!!!!!!!

cryptoipsec client ezvpn client1 connect auto group group1 key cisco mode client peer 192.168.2.2 xauthuserid mode interactive cryptoipsec client ezvpn client connect auto mode network-extension xauthuserid mode interactive!!!interface Loopback0 ip address 10.10.10.1 255.255.255.255!interface Ethernet0/0 ip address 192.168.1.1 255.255.255.0 ipnat outside ip virtual-reassembly half-duplex cryptoipsec client ezvpn client1!interface Ethernet0/1 noip address shutdown half-duplex!interface Ethernet0/2 noip address shutdown half-duplex!interface Ethernet0/3 ip address 192.168.100.1 255.255.255.0 ipnat inside ip virtual-reassembly half-duplex cryptoipsec client ezvpn client1 inside!ip http server noip http secure-server!ip forward-protocol nd ip route 0.0.0.0 0.0.0.0 192.168.1.2!ipnat inside source list 1 interface Ethernet0/0 overload!access-list 1 permit any!!control-plane!!!!!line con 0 exec-timeout 0 0 line aux 0 linevty 0 4 login!end

R1#

在R1上查看vpn状态

我们看到,当R1为client模式的时候,它将获取地址池中的一个地址,为10.10.10.7,所有vpn流量,都会用这个地址进行nat转换。我们看R1上的show ipnat translation

在R1上测试网络连通性

在R3上测试联通性

由于R1内部机器地址都会被NAT成10.10.10.7,所以,对于R3内部用户来说是不可访问的。

配置xauth认证 R3的配置 R3# R3#show run

Building configuration...Current configuration : 1941 bytes!version 12.4 service timestamps debug datetimemsec service timestamps log datetimemsec no service password-encryption!hostname R3!boot-start-marker boot-end-marker!aaa new-model!aaa authentication login ezvpnlogin local aaa authorization network ezvpnauthor local!aaa session-id common memory-sizeiomem 5!

ipcef noip domain lookup!ipauth-proxy max-nodata-conns 3 ip admission max-nodata-conns 3!!!!!!!!username cisco password 0 cisco!

!!cryptoisakmp policy 1 authentication pre-share group 2!cryptoisakmp client configuration group group1 key cisco poolezvpnpool acl 100!cryptoipsec transform-set set1 esp-des esp-md5-hmac!crypto dynamic-map dymap 1 set transform-set set1 reverse-route!crypto map vpnmap client authentication list ezvpnlogin crypto map vpnmapisakmp authorization list ezvpnauthor crypto map vpnmap client configuration address respond crypto map vpnmap 1 ipsec-isakmp dynamic dymap!!interface Ethernet0/0 noip address shutdown half-duplex!interface Ethernet0/1 ip address 192.168.2.2 255.255.255.0 ipnat outside ip virtual-reassembly half-duplex crypto map vpnmap!interface Ethernet0/2 noip address shutdown half-duplex!interface Ethernet0/3 ip address 192.168.200.1 255.255.255.0 ipnat inside ip virtual-reassembly half-duplex!ip local pool ezvpnpool 10.10.10.1 10.10.10.100 ip http server noip http secure-server!ip forward-protocol nd ip route 0.0.0.0 0.0.0.0 192.168.2.1!ipnat inside source list 111 interface Ethernet0/1 overload!access-list 1 permit any access-list 100 permit ip 192.168.200.0 0.0.0.255 any access-list 111 deny

ip 192.168.200.0 0.0.0.255 10.10.10.0 0.0.0.255 access-list 111 deny

ip 192.168.200.0 0.0.0.255 192.168.100.0 0.0.0.255 access-list 111 permit ip any any!!control-plane!!!!!line con 0 exec-timeout 0 0 line aux 0 linevty 0 4!end

R3#

R1上的过程

提示输入crypto ipsec client ezvpnxauth,并输入用户名和密码,VPN则认证成功。另外,cisco VPN Clint 支持Ezvpn client模式。

新建连接信息如下图所示:

第五篇:路由器配置

其实LAN用路由器有两种办法:

1、是把WLAN的进线(电信拉进你家的网线)插在路由器的WAN口(与众不同的那个口),然后登陆路由器设置页面,设置路由器PPPOE的账号和密码,需要上网的所有电脑都连接其他的LAN口,电脑无需拨号即可上网;

2、把WLAN的进线插在路由器的LAN,其他电脑网线也插在LAN口,路由器无需设置,电脑需要拨号上网(其实也就是把路由器的路由功能放弃,当集线器使用),该方法也可以满足多台电脑同时使用网络

首先:你要确保你的路由器设置成自动拨号连接,其次:你要改变你的电脑连接,使用的是本地连接,而不是宽带拨号连接,所以要在网上邻居里面把,宽带连接给取消默认连接,打开本地连接(全部都使用自动获取IP和DNS就可以了),就可以了,有些时候,IE处的Internet选项会是宽带连接(当本地连接断开的时候,它就要拨号连接,可以取消)。

再次:猫-路由器-电脑,都连接好,在电脑里输入,192.168.1.1 进入路由器控制页面,设置一些基本信息,(自动拨号:你先把账号和密码都输入,有个选项pppoe,然后你把下面,自动连接,在开机和断线后自动连接,保存后,在运行状态里面,看看路由器有没有拨号成功,如果没有就在重新找找问题)

D-Link路由器的安装设置(XP系统)

一、硬件连接与准备

1.用直通网线连接电脑有线网卡端口到路由器任一LAN端口,网路商提供的网络信号(光猫、电猫、直通线送来)端接入路由器INTERNET(或WAN)端。电脑、路由器及网络信号均正常通电工作。

2.右键点击桌面“网上邻居”-->“属性”-->右击“本地连接”-->“属性”-->左键双击“Internett协议(TCP/IP)”-->选中“使用下面IP地址”-->分别填入IP地址:192.168.0.200、子网掩码:255.255.255.0、默认网关:192.168.0.1-->选中“使用下面的DNS服务器地址”-->填入首选DNS服务器地址:168.195.1.1-->“确定”。本部分两项都点选“自动获得......”大多数也行。

二、上网设置

1.打开IE浏览器,地址栏输入192.168.0.1-->回车。

2.在“路由器登录”页面,输入用户名:admin、密码:空,点击:“登录”。3.在:网络连接“页面-->“手工配置”-->在网络连接类型中下拉选择我的连接是“PPPoe(Userman/Passwod)”。

4.在“PPPoe”设定中,输入网络商提供的用户名和密码,联机方式选中自动联机(路由器开启会自动拨号上网)。5.点击上方“保存设定”。

三、无线网络设置(没有无线网络功能的路由器或不想加密无线网络供大众用,本部分跳过)

1.点击左边“无线设置”。2.勾选“激活无线”-->取个自己易记好听的无线网络的名称输入“无线网络名称”-->勾选“自动扫描信道”-->勾选“802.11g方式”-->选中打开“WMM”-->“激活隐藏无线”为“空”(以后搜索网络能见该名称)。

3.下拉选中“加密方式”为“激活WPA-Personal无线加密(加强)”-->下拉“密码类型”选中“AES”-->下拉“PSK/EAP”选中“PSK”-->设定可有小写英文字母的8位无线上网“密码”。(注意*****记下无线网名称和密码,以便需要上网的设备使用)4.点击上方“保存设定”。

相关内容

热门阅读

最新更新

随机推荐