透明防火墙
流量处理
添加源mac到mac地址表中
若mac表中存在目的mac则转发
若无则尝试查询
在同一网段,发arp请求
不在同一网段,ping该IP
配置要求
内外接口直连网络必须在相同的子网内部,每一个接口必须在不同的VLAN
必须要配置一个网管IP (重要),可以指定一个特定接口抵达的IP为默认网关,这条路由只起到网管作用,网管IP必须要和内外网段相同,且不能做为网关
组播和广播流量,即便是高到低,需要明确放行(穿越)
单播和路由模式一样,高到低和acl
所有的流量都可以通过extended access list(ACL)(for IP traffic)或者EtherType ACL(for no IP traffic)来放行
ARP默认能够穿越防火墙(双向),可以通过ARP inspection这个技术来控制。
CDP是无法穿越的
实验图
三到七层配置
切换到透明墙
ciscoasa(config)# firewall transparent
切换回路由模式
ciscoasa(config)# no firewall transparent
ciscoasa(config)# clear configure all
查看当前模式
ciscoasa(config)# show firewall
Firewall mode: Router
配置接口
interface GigabitEthernet0/0
nameif DMZ
bridge-group 1
security-level 50
!
interface GigabitEthernet0/1
nameif outside
bridge-group 1
security-level 0
!
interface GigabitEthernet0/2
nameif inside
bridge-group 1
security-level 100
ciscoasa(config)# interface bVI 1 //这个对应 相应的bridge-group ID号
ciscoasa(config-if)# ip address 10.1.10.139 255.255.255.0 //必须配,否则各个接口通不了
现在高安全到低安全 能通信,低到高需明确放行
ciscoasa(config)#access-list dmz-inside line 1 extended permit tcp host 10.1.10.17 host 10.1.10.12 eq telnet
ciscoasa(config)# access-group dmz-inside in interface dmz
ciscoasa(config)# show conn
1 in use, 23 most used
TCP DMZ 10.1.10.17:23519 inside 10.1.10.12:23, idle 0:02:08, bytes 115, flags UIOB
ospf穿越transport asa
ciscoasa(config)# access-list in-ospf-dmz permit ospf any any
ciscoasa(config)# access-group in-ospf-dmz in interface inside
ciscoasa(config)# access-list dmz-ospf-in permit ospf any any
ciscoasa(config)# access-group dmz-ospf-in in interface dmZ
此时已经能看到ospf路由
inside#show ip route ospf
O 7.7.7.7 [110/2] via 10.1.10.17, 00:01:08, FastEthernet0/0
DMZ#show ip route ospf
O 2.2.2.2 [110/2] via 10.1.10.12, 00:00:52, FastEthernet0/0
但却不能通信,默认高到低是能通的,但如果自己接口写了acl(之前放行ospf),那么就不存在默认,必须自己写
in telnet dmz
access-list in-ospf-dmz extended permit tcp any any eq telnet
access-group in-ospf-dmz in interface inside
dmz telnet in
access-list dmz-ospf-in extended permit tcp any any eq telnet
access-group dmz-ospf-in in interface DMZ
in telnet dmz 时的表项
ciscoasa(config)# show conn
TCP DMZ 7.7.7.7:23 inside 10.1.10.12:49046, idle 0:00:03, bytes 112, flags UIO
二层配置(即非IP流量)
PPPOE
PPPOE服务器配置:
username pppoeuser password 0 cisco
!
bba-group pppoe global
virtual-template 1
!
interface FastEthernet0/0
ip add 10.1.10.16 255.255.255.0
no shu
pppoe enable group global
!
interface Virtual-Template1
ip unnumbered FastEthernet0/0
peer default ip address pool ippool
ppp authentication pap
!
ip local pool ippool 10.1.10.100 10.1.10.110
PPPOE客户端配置:
interface FastEthernet0/0
no ip add
no shu
pppoe-client dial-pool-number 1
!
interface Dialer1
ip address negotiated
ip mtu 1492
encapsulation ppp
dialer pool 1
ppp pap sent-username pppoeuser password 0 cisco
在asa放行非IP流量 PPPOE
access-list in-l2-out ethertype permit 8863
access-list in-l2-out ethertype permit 8864
access-list out-l2-in ethertype permit 8863
access-list out-l2-in ethertype permit 8864
access-group out-l2-in in interface outside
access-group in-l2-out in interface inside
查看
inside#show ip inter b
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 unassigned YES manual up up
Dialer1 10.1.10.100 YES IPCP up up
Virtual-Access1 unassigned YES unset up up
注:在一个接口的一个方向只能应用三个acl,类型分别为:ipv4-acl 、ipv6-acl 、二层-acl
ARP Inspection
错误映射的ARP包被丢弃 配置静态ARP映射 激活ARP监控
arp-inspection DMZ enable no-flood //no-flood表示有表就查,没就丢弃
arp-inspection outside enable no-flood
由于asa上没有写静态ARP映射所以通不了
DMZ#show arp
Protocol Address Age (min) Hardware Addr Type Interface
Internet 10.1.10.16 0 Incomplete ARPA //最终arp表项建立失败
Internet 10.1.10.17 - 0007.0007.0007 ARPA FastEthernet0/0
arp-inspection DMZ enable flood //flood表示有表就查,没就放行
arp-inspection outside enable flood
没有静态ARP映射的arp直接放行
DMZ#show arp
Protocol Address Age (min) Hardware Addr Type Interface
Internet 10.1.10.16 0 0006.0006.0006 ARPA FastEthernet0/0
Internet 10.1.10.17 - 0007.0007.0007 ARPA FastEthernet0/0
写静态ARP映射
ciscoasa(config)# arp dmz 10.1.10.16 9.9.9 //我们在dmz口上写一个错误的表项
DMZ#show arp //无论是flood还是no-flood,第一先查表
Protocol Address Age (min) Hardware Addr Type Interface
Internet 10.1.10.16 0 Incomplete ARPA
Internet 10.1.10.17 - 0007.0007.0007 ARPA FastEthernet0/0
在outside口抓包,可以看到其实outside是回复了正确的arp响应,但该包里的ip和mac对应关系与ASA表项不符,直接丢弃
ciscoasa(config)# show arp-inspection
ciscoasa(config)# show arp
ciscoasa(config)# show mac-address-table
ciscoasa(config)# clear arp
MAC Address Table
cam表主要来自动态学习
收到未知目的mac的包直接丢弃
ciscoasa(config)# mac-learn dmz disable //关闭mac动态学习,可以防止mac的***,当然你得自己添加静态表项
ciscoasa(config)# mac-address-table static dmz 0001.0001.0001 //静态添加cam表项
ciscoasa(config)# arp dmz ip mac //写静态arp 也能添到cam表中,但这arp是需要ip的,cam不需要
多模式防火墙
一个防火墙虚拟多个虚拟防火墙
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。