CISCO ASA防火墙配置实验
实验要求:
分别划分inside(内网),outside(外网),dmz(服务器区)三个区
配置PAT,直接使用outside接口的ip地址进行转换
配置静态NAT,发布内网服务器
启用NAT控制,配置NAT豁免,pc2访问outside区中的主机时,不做NAT转换
配置远程管理ASA,配置telnet,只允许pc2使用telnet接入
配置ssh,允许pc2和outside区ssh接入
在GNS3模拟器上配置如下:
一、接口和路由配置
1)asa配置
ciscoasa>
ciscoasa> en
Password:
ciscoasa# conf t
ciscoasa(config)# int e0/0
ciscoasa(config-if)# ip add 192.168.1.2 255.255.255.0
ciscoasa(config-if)# no sh
ciscoasa(config-if)# nameif inside
INFO: Security level for "inside" set to 100 by default.
ciscoasa(config-if)# int e0/1
ciscoasa(config-if)# ip add 192.168.2.1 255.255.255.0
ciscoasa(config-if)# no sh
ciscoasa(config-if)# nameif dmz
INFO: Security level for "dmz" set to 0 by default.
ciscoasa(config-if)# security-level 50
ciscoasa(config-if)# int e0/2
ciscoasa(config-if)# ip add 200.0.0.1 255.255.255.0
ciscoasa(config-if)# no sh
ciscoasa(config-if)# nameif outside
INFO: Security level for "outside" set to 0 by default.
ciscoasa(config)# enable password asa 设置特权密码
ciscoasa(config)# passwd asa 设置远程连接密码
ciscoasa(config-if)# sh int ip bri
Interface IP-Address OK? Method Status Protocol
Ethernet0/0 192.168.1.2 YES manual up up
Ethernet0/1 192.168.2.1 YES manual up up
Ethernet0/2 200.0.0.1 YES manual up up
Ethernet0/3 unassigned YES unset administratively down up
Ethernet0/4 unassigned YES unset administratively down up
Ethernet0/5 unassigned YES unset administratively down up
ciscoasa(config-if)# sh nameif
Interface Name Security
Ethernet0/0 inside 100
Ethernet0/1 dmz 50
Ethernet0/2 outside 0
ciscoasa(config)# route inside 0 0 192.168.1.1
ciscoasa(config)# route outside 172.16.16.0 255.255.255.0 200.0.0.2
ciscoasa(config)# sh route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is 192.168.1.1 to network 0.0.0.0
C 200.0.0.0 255.255.255.0 is directly connected, outside
S 172.16.16.0 255.255.255.0 [1/0] via 200.0.0.2, outside
C 192.168.1.0 255.255.255.0 is directly connected, inside
C 192.168.2.0 255.255.255.0 is directly connected, dmz
S* 0.0.0.0 0.0.0.0 [1/0] via 192.168.1.1, inside
2)R3配置
R3>en
R3#
R3#conf t
R3(config)#int f0/0
R3(config-if)#ip add 10.0.0.1 255.255.255.0
R3(config-if)#no sh
R3(config-if)#int f1/0
R3(config-if)#ip add 10.1.1.1 255.255.255.0
R3(config-if)#no sh
R3(config-if)#int f2/0
R3(config-if)#ip add 192.168.1.1 255.255.255.0
R3(config-if)#no sh
R3(config)# ip route 0.0.0.0 0.0.0.0 192.168.1.2
R3(config)#end
R3#sh ip int bri
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 10.0.0.1 YES manual up up
FastEthernet1/0 10.1.1.1 YES manual up up
FastEthernet2/0 192.168.1.1 YES manual up up
3)ISP配置
ISP(config)#int f0/0
ISP(config-if)#ip add 200.0.0.2 255.255.255.0
ISP(config-if)#no sh
ISP(config)#int f1/0
ISP(config-if)#ip add 172.16.16.1 255.255.255.0
ISP(config-if)#no sh
ISP(config)#ip route 0.0.0.0 0.0.0.0 200.0.0.1
4)pc配置
pc1(config)#int f0/0
pc1(config-if)#ip add 10.0.0.2 255.255.255.0
pc1(config-if)#no sh
pc1(config)#ip route 0.0.0.0 0.0.0.0 10.0.0.1 (在模拟器上有路由模拟的pc,这条是配置网关)
pc2(config)#int f0/0
pc2(config-if)#ip add 10.1.1.2 255.255.255.0
pc2(config-if)#no sh
pc2(config)#ip route 0.0.0.0 0.0.0.0 10.1.1.1
pc3(config)#int f0/0
pc3(config-if)#ip add 172.16.16.2 255.255.255.0
pc3(config-if)#no sh
pc3(config)#ip route 0.0.0.0 0.0.0.0 172.16.16.1
server(config)#int f0/0
server(config-if)#ip add 192.168.2.2 255.255.255.0
server(config-if)#no sh
server(config)#ip route 0.0.0.0 0.0.0.0 192.168.2.1
二、动态PAT配置
直接使用outside接口的ip地址进行转换
ciscoasa(config)# nat-control 启用NAT控制
ciscoasa(config)# nat (inside) 1 10.0.0.0 255.255.255.0 需要进行转换的网段
ciscoasa(config)# global (outside) 1 interface
或者
nat(inside)1 10.0.0.0 255.255.255.0
global(outside)1 200.0.0.1
这时pc2访问那台主机都已不行,因为启用NAT控制,pc2发起连接不匹配NAT规则,所以禁止出站。
pc2#telnet 172.16.16.2
Trying 172.16.16.2 ...
% Connection refused by remote host
配置豁免
ciscoasa(config)# nat (inside) 0 10.1.1.2 255.255.255.255
WARNING: IP address <10.1.1.2> and netmask <255.255.255.255> inconsistent
nat 0 10.1.1.0 will be identity translated for outbound
或者
asa(config)#access-list nonat permit ip host10.1.1.2 host 172.16.16.2
asa(config)nat (inside) 0 access-list nonat
pc2#telnet 172.16.16.2
Trying 172.16.16.2 ... Open
User Access Verification
Username:
这样就绕过了NAT规则。
ciscoasa(config)# sh xlate detail
2 in use, 3 most used
Flags: D - DNS, d - dump, I - identity, i - dynamic, n - no random,
r - portmap, s - static
TCP PAT from inside:10.0.0.2/11004 to outside:200.0.0.1/1024 flags ri
三,静态NAT(发布DMZ区的服务器)一对一的固定转换
ciscoasa(config)# static (dmz,outside) 200.0.0.5 192.168.2.2
ciscoasa(config)#access-list out_to_dmz permit ip host 172.16.16.2 host 200.0.0.5
ciscoasa(config)# access-group out_to_dmz in int outside
注意:acl配置命令中的目的地址应配置为映射地址200.0.0.5,而不是192.168.2.2
server(config)#ip http server 启动http
pc3#telnet 200.0.0.5 80
Trying 200.0.0.5, 80 ... Open
ciscoasa(config)# sh xlate detail 查看NAT转换表
3 in use, 3 most used
Flags: D - DNS, d - dump, I - identity, i - dynamic, n - no random,
r - portmap, s - static
NAT from dmz:192.168.2.2 to outside:200.0.0.5 flags s
四,远程管理ASA
1)配置允许telnet接入
ciscoasa(config)# username lijun password 123456
ciscoasa(config)# aaa authentication telnet console LOCAL
ciscoasa(config)# telnet 10.1.1.2 255.255.255.255 inside
只有pc2能telnet ASA防火墙
pc2#telnet 192.168.1.2
Trying 192.168.1.2 ... Open
User Access Verification
Username: lijun
Password: ******
Type help or '?' for a list of available commands.
ciscoasa>
pc1#telnet 192.168.1.2
Trying 192.168.1.2 ...
% Connection timed out; remote host not responding
pc1 是不能连接
2)配置ssh接入
ciscoasa(config)# host asa 配置主机名
asa(config)# username lihao password 123456
asa(config)# aaa authentication ssh console LOCAL
asa(config)# domain-name benet.com 配置域名
asa(config)# crypto key generate rsa modulus 1024 生成RSA密钥对
INFO: The name for the keys will be: <Default-RSA-Key>
Keypair generation process begin. Please wait...
asa(config)# ssh 10.1.1.2 255.255.255.255 inside 允许pc2 连接防火墙
asa(config)# ssh 0 0 outside 允许外部连接ASA 防火墙
pc2#SSH -L lihao 192.168.1.2
Password:
Type help or '?' for a list of available commands.
asa>
内部只有pc2可以使用ssh接入,外部任何主机
pc3#ssh -l lihao 200.0.0.1
Password:
Type help or '?' for a list of available commands.
asa>
(额外补充)端口映射命令
static (dmz,outside) tcp 200.0.0.5 80 192.168.2.2 80
access-list out_to_dmz permit ip host 172.16.2.2 host 200.0.0.5
access-group out_to_dmz in int outside
五,查询命令
sh nameif 查询区域
sh int ip bri 查询ip配置
sh ssh 查看ssh配置信息
sh crypto key mypubkey rsa 查看产生的rsa密钥值
crypto key zeroize
asa(config)# capture telnet interface outside 抓包排错
ASA(config)# no capture telnet 关闭抓包
asa(config)# sh capture ssh
119 packets captured
1: 02:36:50.108057 172.16.16.2.11005 > 200.0.0.1.22: P 710551790:710551842(52) ack 856118752 win 3644
2: 02:36:50.108057 200.0.0.1.22 > 172.16.16.2.11005: . ack 710551842 win 8192
3: 02:36:50.108041 200.0.0.1.22 > 172.16.16.2.11005: P 856118752:856118804(52) ack 710551842 win 8192
4: 02:36:50.139809 172.16.16.2.11005 > 200.0.0.1.22: . ack 856118804 win 4128
5: 02:36:51.418099 172.16.16.2.11005 > 200.0.0.1.22: P 710551842:710551894(52) ack 856118804 win 4128
6: 02:36:51.418099 200.0.0.1.22 > 172.16.16.2.11005: . ack 710551894 win 8192
7: 02:36:51.418099 200.0.0.1.22 > 172.16.16.2.11005: P 856118804:856118856(52) ack 710551894 win 8192
8: 02:36:51.680583 172.16.16.2.11005 > 200.0.0.1.22: . ack 856118856 win 4076
9: 02:36:52.698755 172.16.16.2.11005 > 200.0.0.1.22: P 710551894:710551946(52) ack 856118856 win 4076
10: 02:36:52.698755 200.0.0.1.22 > 172.16.16.2.11005: . ack 710551946 win 8192
转载于:https://blog.51cto.com/xiaoxiao1001/1302708
CISCO ASA防火墙配置实验相关推荐
- ASA基本配置实验报告
网络运维 ASA基本配置 实验报告 姓名: 李军 班级: NTD1710 日期: 2017 年 12 月 29 日 实验任务 验证R1可以telnet到R2和R3,R3可以telnet到R2但不能te ...
- Cisco ASA防火墙基础
Cisco ASA防火墙基础 1.Cisco 防火墙简介: 硬件与软件防火墙: .软件防火墙: Cisco新版本的IOS软件提供了IOS防火墙特性集,它具有应用层智能状态监测防火墙引擎. Cisco ...
- Cisco ASA防火墙实现IPSec 虚拟专用网,可跟做!!!
通过博文CIsco路由器实现IPSec 虚拟专用网原理及配置详解已经初步了解IPSec 虚拟专用网的原理以及如何在Cisco的路由器上实现IPSec 虚拟专用网技术.千万不要以为在CIsco路由器可以 ...
- Cisco ASA SSH配置
1.配置服务器端 ciscoasa(config)#crypto key generate rsa (创建RSA密钥,默认是1024bit) //指定rsa系数的大小,这个值越大,产生rsa的时间越长 ...
- Cisco PIX防火墙配置命令大全
Cisco PIX防火墙配置命令大全 来源: 作者:XUEYAN 出处:巧巧读书 2007-04-26 进入讨论组 关 键 词:子网掩码 协议 路由器 服务器 访问控制 一.PI ...
- Cisco网络防火墙配置方法
这篇文章主要介绍了Cisco网络防火墙配置方法,需要的朋友可以参考下 由于网络防火墙默认禁止所有的通信,因为,只有对其进行适当配置后,才能实现正常的网络通信. 如何配置Cisco网络防火墙 1.进入全 ...
- Cisco ASA IPSec配置流程(9.8.2)
Cisco ASA IPSec 配置流程(9.8.2) 定义感兴趣流: object-group network remote //创建peer的地址组network-object 192.168.1 ...
- Cisco ASA防火墙简易配置与调试手册
一. 基础配置 1.1 密码配置 ciscoasa(config)#passwd password 一般用于telnet登陆ASA的登录密码 1.2 Enable密码配置 ciscoasa(confi ...
- Cisco PIX防火墙配置指南
总结了防火墙基本配置十个方面的内容. 硬件防火墙,是网络间的墙,防止非法侵入,过滤信息等,从结构上讲,简单地说是一种pc式的电脑主机加上闪存(flash)和防火墙操作系统.它的硬件跟共控机差不多,都 ...
最新文章
- 1.gcForest 包安装和集成学习方法的 Python 实现2.minepy安装方法(Windows版本)
- 《计算机组成与体系结构:性能设计》读后小记 4、cache存储器
- go 编译 android arm,golang交叉编译
- sqlite使用模糊查询数据库数据的三种方式
- 【学习笔记】多重背包相关优化——二进制优化/单调队列优化
- thinkphp mysql日志_MySQL的日志基础知识及基本操作学习教程
- iOS开发UI篇-在UItableview中实现加载更多功能
- date设置时间_解决 IDEA 无法找到 java.util.Date 的问题
- Arrays.asList()和Collections.singletonList()比较
- Eigen--Array
- 逐渐摆脱高通和联发科!华为手机将采用更多麒麟芯片
- GitHub星标数超4.2万的火爆之作!
- js 数组合并并且去重
- 微信小程序 图片显示不出来的问题 100%管用
- uniapp通过fir.im 实现应用更新
- WPS文字绿色版下载 WPS Office 2010 中文绿色版
- python投票系统项目ppt_python fastApi实战项目 - 爱投票管理系统(一)
- 编程要从娃娃抓起,北乔治亚大学教授的python编程指南在此
- redux之compose的理解
- Vue3 企业级网站建设
热门文章
- python3.7.4安装教程win7_Window10下python3.7 安装与卸载教程图解
- 计算机专业课如何阅卷,全国计算机等级考试评卷老师是如何阅卷的?
- easyUI s MVC h分页
- mysql多实例访问代理_一台MySQL数据库启动多个实例
- c语言编译错误c267,为啥编译出现HAHA.C(31): error C267: 'adc0832': requires ANSI-style prototype.......
- oracle数据库操作文档,oracle数据库操作
- python的类和对象例题_Python类、类对象和实例对象、组合、绑定详细讲解
- 界址点圆圈怎么生成_手机联系人怎么加入黑名单
- 心音与心电信号分析之一--6.26--心音信号检测系统软件设计
- linux安装steam