10-23-2018 04:16 AM - edited 02-21-2020 08:23 AM
Hi folks. My first attempt at configuring a ZBF on a 1117-4p ISR (I'm ccent studying for CCNA).
Prior to the ZBF commands being added to the running-config I was getting internet access (albeit with no security). Following this I get nothing - I can't PING, no web access, no DNS lookups which are the 3 types of traffic I'm initially allowing.
Not a massively complicated setup. I have no training on this but as I understand it, being stateful rules then return rules should not be required (should they) ?
In any case if anybody would be kind enough to look through my config and explain where I'm going wrong it would be massiv ely appreciated.
Script below. Cheers. Rob.
C1117ISR#sh run
Building configuration...
Current configuration : 5615 bytes
!
! Last configuration change at 09:15:14 GMT Tue Oct 23 2018 by rhbmcse
!
version 16.6
service timestamps debug datetime msec
service timestamps log datetime msec
service password-encryption
platform qfp utilization monitor load 80
no platform punt-keepalive disable-kernel-core
!
hostname C1117ISR
!
boot-start-marker
boot-end-marker
!
!
enable secret 9 $9$jUR3aCOMA9OFgU$o3a79MhakpqV2vfDatrcHCxftZzba///XoF5BMiuU6Q
!
no aaa new-model
clock timezone GMT -1 0
!
ip name-server 8.8.8.8 8.8.4.4
ip domain name 21RTM.local
ip dhcp excluded-address 192.168.0.1 192.168.0.19
ip dhcp excluded-address 192.168.0.51 192.168.0.254
ip dhcp excluded-address 10.0.0.1
!
ip dhcp pool CLIENTS
network 192.168.0.0 255.255.255.0
default-router 192.168.0.1
dns-server 192.168.0.1
domain-name 21RTM.local
!
ip dhcp pool MANAGEMENT
network 10.0.0.0 255.255.255.0
!
!
subscriber templating
!
!
multilink bundle-name authenticated
!
!
crypto pki trustpoint TP-self-signed-3510874038
enrollment selfsigned
subject-name cn=IOS-Self-Signed-Certificate-3510874038
revocation-check none
rsakeypair TP-self-signed-3510874038
!
!
crypto pki certificate chain TP-self-signed-3510874038
certificate self-signed 01
quit
!
!
license udi pid C1117-4P sn FGL2205927C
license boot level securityk9
!
diagnostic bootup level minimal
spanning-tree extend system-id
!
!
username xxxxxxx privilege 15 password 7 xxxxxxx
!
redundancy
mode none
!
!
controller VDSL 0/2/0
!
!
vlan internal allocation policy ascending
!
!
class-map type inspect match-any ALLOWED-PROTOCOLS
match protocol icmp
match protocol dns
match protocol http
!
policy-map type inspect INSIDE-TO-OUTSIDE-POLICY
class type inspect ALLOWED-PROTOCOLS
inspect
!
zone security INTERNET
zone security INSIDE
zone-pair security ZP-INSIDE-TO-OUTSIDE source INSIDE destination INTERNET
!
!
interface GigabitEthernet0/0/0
no ip address
shutdown
no negotiation auto
!
interface GigabitEthernet0/1/0
description CLIENT LAN
switchport access vlan 10
switchport mode access
!
interface GigabitEthernet0/1/1
shutdown
!
interface GigabitEthernet0/1/2
shutdown
!
interface GigabitEthernet0/1/3
description MANAGEMENT INTERFACE
switchport access vlan 100
switchport mode access
!
interface ATM0/2/0
no ip address
shutdown
no atm ilmi-keepalive
no atm enable-ilmi-trap
!
interface Ethernet0/2/0
mac-address xxxxxxxxx
no ip address
no negotiation auto
!
interface Ethernet0/2/0.101
description SUBINT TO INTERNET
encapsulation dot1Q 101
ip dhcp client request classless-static-route
ip dhcp client client-id hex xxxxxxxx
ip dhcp client hostname xxxxxxxx@skydsl|xxxxxxxx
ip address dhcp
no ip redirects
no ip proxy-arp
ip nat outside
zone-member security INTERNET
ip virtual-reassembly
!
interface Vlan1
no ip address
!
interface Vlan10
ip address 192.168.0.1 255.255.252.0
ip nat inside
zone-member security INSIDE
!
interface Vlan100
ip address 10.0.0.1 255.255.255.0
!
ip nat inside source route-map OUTSIDE-POOL interface Ethernet0/2/0.101 overload
ip forward-protocol nd
no ip http server
ip http authentication local
no ip http secure-server
ip dns server
ip ssh version 2
!
!
ip access-list extended NAT-TO-OUTSIDE
permit ip 192.168.0.0 0.0.3.255 any
!
!
!
route-map OUTSIDE-POOL permit 10
match ip address NAT-TO-OUTSIDE
match interface Ethernet0/2/0.101
!
!
!
control-plane
!
!
line con 0
password 7 075912435E010C164E
login
transport input all
stopbits 1
line vty 0 4
login local
transport input ssh
!
wsma agent exec
!
wsma agent config
!
wsma agent filesys
!
wsma agent notify
!
!
end
Solved! Go to Solution.
10-25-2018 08:09 AM
10-25-2018 08:40 AM
10-25-2018 09:32 AM
10-25-2018 10:31 AM
If you modify the following:-
policy-map type inspect INSIDE-TO-OUTSIDE-POLICY
class type inspect ALLOWED-PROTOCOLS
inspect
class class-default
drop log
then any drops outbound should be logged, then type "show logging" to view the logs.
Can you provide the output of "show policy-map type inspect zone-pair ZP-INSIDE-TO-OUTSIDE" and upload here
10-26-2018 04:59 AM
10-26-2018 05:05 AM
10-26-2018 05:19 AM
10-26-2018 05:41 AM
10-26-2018 05:56 AM
Great!
I can see that tcp/443 from inside to outside is matching "class-default" and is dropped. Can you upload your latest configuration to confirm what the configuration is? Potentiallly modify the class-map temporarily to permit tcp and udp, we can tie down if that works.
Dropping udp pkt from Vlan10 192.168.0.20:63483 => 216.58.206.142:443(target:class)-(ZP-INSIDE-TO-OUTSIDE:class-default) due to Policy drop:classify result with ip ident 52177
I can also see that DNS traffic from the router to the internet is matching "class-default" and dropped. Do the users on the lan use the router as the DNS server, which then forwards on to the internet?
1 udp packet was dropped from internal0/0/rp:0 188.222.79.191:32810 => 90.207.238.99:53 (target:class)-(ZP-SELF-TO-INTERNET:class-default)
Dropping tcp pkt from internal0/0/rp:0 188.222.79.191:42886 => 90.207.238.97:53(target:class)-(ZP-SELF-TO-INTERNET:class-default)
4 tcp packets were dropped from internal0/0/rp:0 188.222.79.191:44361 => 8.8.8.8:53 (target:class)-(ZP-SELF-TO-INTERNET:class-default)
10-26-2018 07:19 AM
10-26-2018 07:29 AM
Ok, cool, if the router is acting as the DNS server for the clients, then DNS requests will originate from the router itself, so therefore you will need to permit DNS from self to internet. Otherwise the users won't be able to resolve the hostnames. Try modifying that.
Class-default is a system default, if it doesn't match your specifically defined class-map then it will hit class-default, which by default will drop.
HTH
10-26-2018 08:14 AM
10-26-2018 09:05 AM
11-05-2018 08:14 AM - edited 11-05-2018 08:18 AM
Firstly - a great big THANK YOU to RJI (Rob) for assisting with all of this.
I have a "working" config and when I do a pen test from outside to my internet IP (local global) I get filtered as a result so nobody is getting in hopefully.
One area of concern though which requires clarification.
Let's say I allow protocol 443 (ssh) outbound on my ZP-Inside-to-outside rule...with an inspect in my class-map and then I get this in the logs:
Dropping udp pkt from Vlan10 192.168.0.20:63483 => 216.58.206.142:443(target:class)-(ZP-INSIDE-TO-OUTSIDE:class-default) due to Policy drop:classify result with ip ident 52177
Now there is a rule there to say - allow 443 but it still drops. The only way I've found around this (and it's not just 443 that gets dropped - it's everything) is to allow IP any (or TCP and UDP any). Fair enough, this works but it would seem that because of the PAT that is going on that I can't just allow protocol 443. The f/w drops it. But if I allow the random translated port (63483) which is covered by the ANY rule, through it goes.
Forgive me if I'm wrong - and clearly I am - I thought I could tie down a lot more securely than this. If NAT is translating my 443 traffic to a random port which has to be allowed (and as far as I can see can only be covered off by an ANY rule as I have no idea what random port it is going to assign) - how do I tie this down to only allow specific protocols? It makes the match PROTOCOL command effectively useless in a PAT configuration! ?
Happy to learn if you're happy to help!
Cheers.
Rob.
11-05-2018 08:28 AM
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide