防火墙基础小实验(1)安全
实
验
任
务 实验需求:
配置路由器和ASA的接口,实现网络互通
配置路由
验证R1能够 Telnet到R2和R3,R3能够Telnet到R2可是不能Telnet R1,R2不能Telnet到R1和R3
使用命令show conn detail 查看Conn表
分别查看ASA和RR的路由表
配置ACL禁止在R3上Telnet 到R2
实验拓扑:网络
思
路
及
实
验
步
骤 第一步:配置ASA防火墙对应端口的IP并设置端口名与优先级
enable
tedu.cn
configuration terminal
hostname ASA
enable password 123
passwd 123 (远程密码)
clear configure all
interface gigabitEthernet 0
nameif inside (端口名内部)
security-level 100 (优先级最高)
no shutdown
ip address 10.1.1.254 255.255.255.0
exit
interface gigabitEthernet 1
nameif outside(端口名外部)
security-level 0(优先级最低)
no shutdown
ip address 172.16.1.254 255.255.255.0
exit
interface gigabitEthernet 2
nameif dmz(端口名隔离区)
security-level 50(优先级比outside要高比inside的要低)
no shutdown
ip address 192.168.1.254 255.255.255.0
exittcp
第二步:配置R1 R3 R2 各对应端口的IP地址关闭路由关闭 RR配置
对应端口的IP地址开启路由功能,并验证网络是否互通
R1:
enable
configuration terminal
hostname R1
interface fastEthernet 0/0
no shutdown
ip address 10.1.1.1 255.255.255.0
exit
no ip routing (关闭路由功能)
ip default-gateway 10.1.1.254(设置网关)
end
ping 10.1.1.254 (验证到网关是否互通)ide
R3:
enable
configuration terminal
hostname R3
interface fastEthernet 0/0
no shutdown
ip address 192.168.1.1 255.255.255.0
exit
no ip routing (关闭路由功能)
ip default-gateway 192.168.1.254(设置网关)
end
ping 192.168.1.254 (验证到网关是否互通)测试
RR:
enable
configuration terminal
hostname RR
ip routing (开启路由功能)
interface fastEthernet 0/0
no shutdown
ip address 4.4.4.254 255.255.255.0
exit
interface fastEthernet 1/0
no shutdown
ip address 172.16.1.1 255.255.255.0
end
ping 172.16.1.254 (验证到网关是否互通)code
R2:
enable
configuration terminal
hostname R2
interface fastEthernet 0/0
no shutdown
ip address 4.4.4.1 255.255.255.0
exit
no ip routing (关闭路由功能)
ip default-gateway 4.4.4.254(设置网关)
end
ping 4.4.4.254 (验证到网关是否互通)接口
第三步:
(1)由于ASA上没有4.4.4.0 的路由,所以要添加一个默认路由
route outside 0.0.0.0 0.0.0.0 172.16.1.1 (按流量走向配置
指定端口为outside)
(2)由于RR上没有R1的路由,所以要添加一个more路由
ip route 0.0.0.0 0.0.0.0 172.16.1.254 ip
第四步:在R1 R2 R3 配置远程功能及密码路由
R1:
enable
configuration terminal
enable password 123
line vty 0
password 123
endrem
R2:
enable
configuration terminal
enable password 123
line vty 0
password 123
end
R3:
enable
configuration terminal
enable password 123
line vty 0
password 123
end
第五步:验证在R1上远程R2 R3 ,R3远程R1 R2 ,R2远程R1 R3
R1:
telnet 4.4.4.1
Trying 4.4.4.1 ... Open
User Access Verification
Password:
R2>
exit
telnet 192.168.1.1
Trying 192.168.1.1 ... Open
User Access Verification
Password:
R3>
exit
R2:
telnet 10.1.1.1
Connection timed out; remote host not responding(链接
超时;远程主机没有响应)【由于接口的安全级别高的能够访问低的
而低级别的不能够访问高级别的】
telnet 192.168.1.1
Connection timed out; remote host not responding(链接
超时;远程主机没有响应)
R3:
telnet 4.4.4.1
Trying 4.4.4.1 ... Open
User Access Verification
Password:
R2>
exit
telnet 10.1.1.1
Connection timed out; remote host not responding(链接
超时;远程主机没有响应)
第五步:由于ASA防火墙在流量访问时先看conn表而后再看acl表然
后再看优先级
因此须要配置ACL禁止R3远程访问R2
在ASA上配置
enable
configuration terminal
access-list 333 deny tcp host 192.168.1.1 host 4.4.4.1
eq telnet (拒绝192.168.1.1远程访问4.4.4.1)
access-group 333 in interface dmz(配置在对应的接口)
结
果
验
证 验证与测试
第一步:
在R3远程R2
R3:
telnet 4.4.4.1
Connection refused by remote host(拒绝由远程主机链接)
第二步在R1远程R2时,在ASA查看conn表
show conn detail
1 in use, 1 most used
Flags: A - awaiting inside ACK to SYN, a - awaiting
outside ACK to SYN,
B - initial SYN from outside, b - TCP state-
bypass or nailed, C - CTIQBE media,
D - DNS, d - dump, E - outside back connection, F
第三步在ASA与RR上查看路由表
ASA路由表:
show 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
Gateway of last resort is 172.16.1.1 to network 0.0.0.0
C 172.16.1.0 255.255.255.0 is directly connected,
outside
C 10.1.1.0 255.255.255.0 is directly connected,
inside
C 192.168.1.0 255.255.255.0 is directly connected,
dmz
S* 0.0.0.0 0.0.0.0 [1/0] via 172.16.1.1, outside
在RR上查看路由表
show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B
Gateway of last resort is 172.16.1.254 to network
0.0.0.0
4.0.0.0/24 is subnetted, 1 subnets
C 4.4.4.0 is directly connected, FastEthernet0/0
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.1.0 is directly connected,
FastEthernet1/0
S* 0.0.0.0/0 [1/0] via 172.16.1.254
问题及分析 ICMP在默认状况下是不能容许经过的优先级小的不能直接访问优先级大的ASA先检查conn表再检查acl表再检查优先级