Configuring Application Port-Mapping with CBAC

简介:

【实验说明】
基于非标准端口号的应用配置CBAC

【实验配置】
 

IOS: c2691-advsecurityk9-mz.124-11.T2.bin

 


【实验配置向导】

  • 配置上图网络为 IP service 中的“Configuring Static PAT” ,配置后使得R1与R6的服务器的telnet端口发生变化
  • 在R4上配置CBAC拦截规则,命名为INSPECT_TELNET,拦截telnet 协议
  • 在R4上创建访问控制列表 99 匹配 23.1.1.0/24 网络
  • 为访问控制列表99 中的网络 映射端口号1023和6023 作为telnet端口
  • 在路由器的串口的in方向应用 INSPECT_TELNET 规则
  • 创建扩展访问控制列表 INSIDE 拒绝所有
  • 在R4的内网口的入方向应用 INSIDE
【实验配置】
----------------------------------------Static NAT 配置----------------------------------------------------------------

 
R1:
interface FastEthernet0/0
ip address 10.0.0.1 255.255.255.0
ip route 0.0.0.0 0.0.0.0 10.0.0.4

 
R6:
interface FastEthernet0/0
ip address 10.0.0.6 255.255.255.0
ip route 0.0.0.0 0.0.0.0 10.0.0.4

R4:
interface Loopback0
ip address 150.1.4.4 255.255.255.0
ip ospf network point-to-point
!
interface FastEthernet0/0
ip address 10.0.0.4 255.255.255.0
ip nat inside
!
interface Serial0/0
en fram
no sh
!
interface Serial0/0.1 point-to-point
ip address 155.1.0.4 255.255.255.0
frame-relay interface-dlci 405
ip nat outside
!
interface Serial0/1
ip address 155.1.45.4 255.255.255.0
clock rate 2000000
ip nat outside
!
router ospf 1
router-id 150.1.4.4
network 150.1.4.4 0.0.0.0 area 0
network 155.1.0.4 0.0.0.0 area 0
network 155.1.45.4 0.0.0.0 area 0
!
router bgp 1
bgp router-id 150.1.4.4
neighbor 150.1.5.5 remote-as 2
neighbor 150.1.5.5 ebgp-multihop 255
neighbor 150.1.5.5 update-source Loopback0

 
ip nat inside source static tcp 10.0.0.1 23 interface Loopback0 1023
ip nat inside source static tcp 10.0.0.6 23 interface Loopback0 6023

R5:
interface Loopback0
ip address 150.1.5.5 255.255.255.0
ip ospf network point-to-point
!
interface Serial0/0
encapsulation frame-relay
!
interface Serial0/0.1 point-to-point
ip address 155.1.0.5 255.255.255.0
frame-relay interface-dlci 504
!
interface Serial0/1
ip address 155.1.45.5 255.255.255.0
clock rate 2000000
!
router ospf 1
router-id 150.1.5.5
network 150.1.5.5 0.0.0.0 area 0
network 155.1.0.5 0.0.0.0 area 0
network 155.1.45.5 0.0.0.0 area 0
!
router bgp 2
bgp router-id 150.1.5.5
neighbor 150.1.4.4 remote-as 1
neighbor 150.1.4.4 ebgp-multihop 255
neighbor 150.1.4.4 update-source Loopback0
neighbor 150.1.4.4 default-originate

通过上面配置后,在R5上telnet 150.1.4.4 1023 即telnet R1;在R5上telnet 150.1.4.4 6023 即telnet R6

 
--------------------------------------------CBAC 配置---------------------------------------
R4:
ip cef
!
ip inspect name INSPECT_TELNET telnet
! port-map 用于人工指定应用程序对应的端口号
ip port-map telnet port tcp 1023 list 99
ip port-map telnet port tcp 6023 list 99
!
ip access-list extended INSIDE
deny ip any any
!
access-list 99 permit 10.0.0.0 0.0.0.255
!在网关出口的入方向应用 cbac ,能让外部的计算机能够发起telnet到内部服务器
interface s0/1
ip inspect INSPECT_TELNET in
interface s0/0.1
ip inspect INSPECT_TELNET in 
!在网关入口的入方向应用扩展访问控制列表,阻止所有
interface FastEthernet0/0
ip access-group INSIDE in

 
【实验验证】
R5 telnet 到内部主机使采用非标准端口号,能够成功,验证了CBAC中如何对付非标准的端口配置。
R5#telnet 150.1.4.4 1023
Trying 150.1.4.4, 1023 ... Open
R1>
R4#show ip inspect sessions
Established Sessions
Session 6507BE4C (155.1.45.5:17996)=>(10.0.0.1:23) telnet SIS_OPEN
R5#telnet 150.1.4.4 6023
Trying 150.1.4.4, 6023 ... Open
R6>
R4#show ip inspect sessions
Established Sessions
Session 6507C0C4 (155.1.45.5:59812)=>(10.0.0.6:23) telnet SIS_OPEN

【port-map相关内容】

Port-map 指应用程序对应端口号信息,在路由器的PAM表中,可以通过show ip port-map 来查看, 使用port-map 可以指定一个5个任意端口,也可以指定一个范围内的端口 ,PAM表信息来源于以下三部分:
1、System-defined
系统默认,可以通过show ip port-map 来查看
2、User-defined
用户指定,可以使用例如 ip port-map http port 8000 来指定http 与端口8000 对应
R2(config)#ip port-map netshow port 21 如果系统中存在了该端口,你需要先将原来的端口映射删除,否则将提示
%Unable to add port-map entry.
It conflicts with the system entry for ftp.
Please delete it before adding this entry

3、Host-specific
基于特定的主机指定,需要配合访问控制列表,例如,指定服务器使用8000端口作为FTP,
access-list 10 permit 192.168.32.43 //访问控制列表10定义服务器地址
ip port-map ftp port 8000 list 10 //在访问控制列表10中的主机,认为FTP使用8000端口
ip port-map realaudio port 21 list 10 // 在访问控制10中的主机将不再认为FTP使用21端口

下面的例子,一个指定的子网使用8080作为HTTP服务,访问控制列表 50 来指定子网


      
 
       
 
       
 
       
 
      
相关实践学习
云安全基础课 - 访问控制概述
课程大纲 课程目标和内容介绍视频时长 访问控制概述视频时长 身份标识和认证技术视频时长 授权机制视频时长 访问控制的常见攻击视频时长
相关文章
|
7月前
|
监控 Dubbo 搜索推荐
No application config found or it‘s not a valid config! Please add <dubbo:application name=“...“ />
No application config found or it‘s not a valid config! Please add <dubbo:application name=“...“ />
687 1
|
5天前
|
Java Spring
Initialization failed for 'https://start.spring.io' Please check URL, network and proxy settings.
Initialization failed for 'https://start.spring.io' Please check URL, network and proxy settings.
355 0
|
6月前
|
SQL JavaScript 关系型数据库
Client does not support authentication protocol requested by server
Client does not support authentication protocol requested by server
47 0
There is no configured/running web-servers found Please, run any web-configuration and hit the
There is no configured/running web-servers found Please, run any web-configuration and hit the
|
XML 应用服务中间件 数据格式
控制台报错: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting proper
控制台报错: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting proper
78 0
控制台报错: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting proper
|
XML 数据格式
警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property ‘source‘ to ‘org.eclips
警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property ‘source‘ to ‘org.eclips
89 0
警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property ‘source‘ to ‘org.eclips
|
Java 关系型数据库 MySQL
mybatis学习(8):The server time zone value ‘???ú±ê×??±??‘ is unrecognized or represents more
mybatis学习(8):The server time zone value ‘???ú±ê×??±??‘ is unrecognized or represents more
124 0
mybatis学习(8):The server time zone value ‘???ú±ê×??±??‘ is unrecognized or represents more
Embedded web server initialization - jar file default-mimetypes.properties
Embedded web server initialization - jar file default-mimetypes.properties
102 0
Embedded web server initialization - jar file default-mimetypes.properties
如何得到当前application server的host name和port number
如何得到当前application server的host name和port number
150 0
如何得到当前application server的host name和port number