频 道 直 达 - 新闻 - 读书 - 培训 - 教程 - 前沿 - 组网 - 系统应用 - 安全 - 编程 - 存储 - 操作系统 - 数据库 - 服务器 - 专题 - 产品 - 案例库 - 技术圈 - 博客 - BBS
51CTO.COM_中国领先的IT技术网站
找资料:

加装防火墙前后的路由器配置

作者: 出处:Cisco.com  (  ) 砖  (  ) 好  评论 ( ) 条  进入论坛
更新时间:2006-07-03 10:32
关 键 词:Cisco配置实例
阅读提示:

随着人们对网络知识的普及,企业或公司的网络安全性,就变得更加重要起来了。关于网络安全的最可靠方法是加装防火墙。 
在这里我讲述一下关于加装防火墙前后的路由配置变化,因为在原先没有防火墙的情况下,路由既起到路由选择的作用,又起到网关的作用。当加装防火墙的后,局域网的网关就设为防火墙的局域网IP地址。要修改路由首先还是先看该网络的拓扑结构。在这里我所描述的是这样拓扑结构:
图1

一、先将进入路由器设置将原来的配置备份一份,虽然这一份备份以后不一定用的上,可是万一防火墙安装失败呢?
图2

下面为没有安装防火墙以前的路由器配置情况。

User Access Verification

Password: (键入TELNET密码,如果你是直接用CONSOLE口进入没有此项提示)

Router>en

Password:

Router#show config (察看ROUTER配置情况命令)

Using 810 out of 7506 bytes

!

version 12.1

service timestamps debug uptime

service timestamps log uptime

no service password-encryption

!

hostname Router (ROUTER名字,这里为默认名字ROUTER)

!

enable secret 5 $1$FreK$4oQGtvDEF1jv8dh3NNXnN0.

enable password 123456789 (特权密码,当然这是加密的)

!

ip subnet-zero

!

interface Ethernet0 (配置局域网e0口)

ip address 192.168.1.1 255.255.255.0 (e0口在其局域网中对应的ip为192.168.1.1

ip nat inside 255.255.255.0是表示为C类网络)

!

interface Ethernet1 (E1口没有激活,也没有配置)

no ip address

shutdown

!

interface Serial0

bandwidth 2048

ip address 211.97.213.41 255.255.255.252 (此为定义ROUTER外部接口的IP

ip nat outside 255.255.255.252表示此合法的INTERNET-IP)

encapsulation ppp

!

ip nat pool 165 211.97.213.41 211.97.213.46 netmask 255.255.255.248 (isp给你分配的ip)

ip nat inside source list 1 pool 165 overload

ip classless

ip route 0.0.0.0 0.0.0.0 Serial0

no ip http server

!

access-list 1 permit 192.168.1.0 0.0.0.255

!

line con 0

transport input none

line vty 0 1

password 123456

login

!

end

Router#


二、按照图1装上防火墙。

将从路由器到交换机上的线,改为先从路由器到防火墙,然后用防火墙的E0口接交换机。

图3

进入路由器配置模式修改,将路由器的配置改为:

Using 942 out of 7506 bytes

!

version 12.1

service timestamps debug uptime

service timestamps log uptime

service password-encryption

!

hostname router

!enable secret 5 $1$FreK$4oQGtvDEF1jv8dh3NNXnN0

enable password 123455676!

!

ip subnet-zero

!

crypto ipsec transform-set test esp-des esp-md5-hmac

!

crypto map vpnmap 1 ipsec-isakmp

! Incomplete

set transform-set test

match address 100

interface Ethernet0

ip address 211.97.213.41 255.255.255.248

interface Ethernet1

no ip address

ip nat inside

no ip route-cache

no ip mroute-cache

shutdown

!

!

interface Serial0

description internet

bandwidth 2048

ip address 211.97.209.145 255.255.255.252

ip nat outside

encapsulation ppp

no ip route-cache

no ip mroute-cache

!

ip classless

ip route 0.0.0.0 0.0.0.0 Serial0

ip http server

!

route-map nonat permit 10

match ip address 110

!

!

line con 0

transport input none

line vty 0 4

password 123456

login

!

end


三、这时候,你可以配置你的防火墙了,以下是防火墙的配置情况:

PIX Version 5.1(2)

nameif ethernet0 outside security0

nameif ethernet1 inside security100

nameif ethernet2 pix/intf2 security10

hostname imrac_c_pix

fixup protocol ftp 21

fixup protocol http 80

fixup protocol h323 1720

fixup protocol rsh 514

fixup protocol smtp 25

fixup protocol sqlnet 1521

no names

access-list 100 permit ip 192.168.1.1 255.255.255.0 192.168.0.0 255.255.255.0

access-list 100 permit ip 192.168.1.1 255.255.255.0 192.100.0.0 255.255.255.0

pager lines 24

logging on

no logging timestamp

no logging standby

no logging console

no logging monitor

no logging buffered

no logging trap

logging facility 20

logging queue 512

interface ethernet0 auto

interface ethernet1 auto

interface ethernet2 auto shutdown

mtu outside 1500

mtu inside 1500

mtu pix/intf2 1500

ip address outside 211.97.213.44 255.255.255.248

ip address inside 192.168.1.1 255.255.255.0

ip address pix/intf2 127.0.0.1 255.255.255.255

no failover

failover timeout 0:00:00

failover ip address outside 0.0.0.0

failover ip address inside 0.0.0.0

failover ip address pix/intf2 0.0.0.0

arp timeout 14400

global (outside) 1 211.97.213.45 netmask 255.255.255.248

nat (inside) 0 access-list 100

nat (inside) 1 0.0.0.0 0.0.0.0 0 0

route outside 0.0.0.0 0.0.0.0 211.97.213.41 1

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

timeout rpc 0:10:00 h323 0:05:00

aaa-server RADIUS protocol radius

no snmp-server location

no snmp-server contact

snmp-server community public

no snmp-server enable traps

floodguard enable

sysopt connection permit-ipsec

crypto ipsec transform-set trans esp-des esp-md5-hmac

crypto map vpnmap 40 ipsec-isakmp

crypto map vpnmap 40 match address 100

crypto map vpnmap 40 set transform-set trans

crypto map vpnmap interface outside

isakmp enable outside

isakmp identity address

isakmp policy 1 authentication pre-share

isakmp policy 1 encryption des

isakmp policy 1 hash md5

isakmp policy 1 group 1

isakmp policy 1 lifetime 86400

telnet 192.168.1.88 255.255.255.255 inside

telnet timeout 5

terminal width 80

Cryptochecksum:7fd10854228b7e32b2808508f49a65a7

(责任编辑:城尘 68476636-8003)


发表
查看
我也说两句

匿名发表

(如果看不清请点击图片进行更换)


中 国 领 先 的 IT 技 术 网 站 ·
技 术 成 就 梦 想
·路由器设置与口令恢复 (查看60640次)
·常用交换机典型配置 (查看36407次)
·网络管理员考试全真模拟试题(八.. (查看32855次)
·三层交换技术专题 (查看28555次)
·子网掩码教程 (查看25829次)
订阅技术快讯
电子杂志下载
名称:网络安全精品应用黄皮书
简介:《2007精品网络安全黄皮书》包括了9个大类24个小类, 800余篇文章,内容包含了熊猫烧香病毒、DDOS攻击、ARP病等热点问题的介绍及解决方案。从病毒查杀、防范、系统、数据等各方面的安全设置到黑客技术的了解、防范,涉及到了安全应用的全部领域, 由浅至深内容全面。
名称:Vista精品应用黄皮书
简介:《Vista精品应用黄皮书》囊括了Vista的各方面内容。此次的精简版,是将里面的内容做了提取,便于用户下载和使用。内容包含了各种Vista的安装与实施、技巧与解析以及各种Vista相关学习文档和相关软件的安全下载。该电子书是了解和应用Vista人员必备的工具手册,并且也是第一本
名称:2006中国IT论坛精品集合
简介:本书由“51CTO论坛推广联盟”制作完成。书中所有内容均来自各联盟成员的论坛(网站)。制作本书的目的是为了集中大家的优势资源,将更多更精彩的内容带给广大技术爱好者。本书是联盟成立以来制作的第一本书。
关键字阅读
频道精选
主编信箱 热线:010-66476606 告诉我们您想看的:专题 文章
关于我们 | 诚聘英才 | 联系我们 | 网站大事 | 意见反馈 | 网站地图
Copyright©2005-2007 51CTO.COM 版权所有