I'm obviously not doing something right (and Cisco is definitely not my forte, so bare with me), but I'm not having any luck setting up egress filtering from the inside network to the outside, with the goal of denying all outbound traffic save for the HTTP Proxy (Squid) server that's also running DNS, NTP, etc.
If I remove all my ACL rules, it works fine: NAT's fine (double NAT's fine), I can surfing the web, etc.
However, what I thought was correct (and I've been through a pile of confusing documentation, some of it the wrong version, hence my woes in Cisco land), doesn't seem to work, albeit inconsistently.
Doing a telnet test, the first time I apply the
access-group it works. Hit CTRL-] to escape, hit up key, run command again, times out. Remove all access-group assignments, doesn't work. Come back to verify (as I'm typing this) and telnet works again.
Turned on debug logging, show log confirms that the packets are being discarded, but it doesn't look right and I think I may be applying my rules to the wrong interface or the wrong direction.
Here's some relative info:
Server: 192.168.2.5/24 Inside: 192.168.2.0/24 Outside: 10.0.0.254/24 (<-- test environment, has IP on my real LAN).
Here's my relative snippet of my config:
access-list server_out extended permit tcp host 192.168.2.5 any eq www global (outside) 10 interface nat (inside) 10 192.168.2.0 255.255.255.0 access-group server_out in interface inside
Again, a few minutes ago I had no access-group line and it worked. I'm also trying this from several machines and another machine on 192.168.2.0/24 worked once or twice (even a few minutes ago), even though there's no permit rule in there as you can see, and I assumed the default deny rule would apply once you create an ACL.
Here's some logging for your viewing pleasure -- this is a successful telnet to a webserver on my real LAN (10.0.0.12):
%ASA-6-305011: Built dynamic TCP translation from inside:192.168.2.5/36097 to outside:10.0.0.254/57787 %ASA-6-302013: Built outbound TCP connection 172 for outside:10.0.0.12/80 (10.0.0.12/80) to inside:192.168.2.5/36097 (10.0.0.254/57787)
Here's the same request, several seconds later, no changes to config:
%ASA-2-106001: Inbound TCP connection denied from 192.168.2.5/36100 to 10.0.0.12/80 flags FIN ACK on interface outside %ASA-2-106001: Inbound TCP connection denied from 192.168.2.5/36101 to 10.0.0.12/80 flags SYN on interface outside
: Saved : ASA Version 8.0(5) ! terminal width 120 hostname some-host enable password ***** encrypted passwd ***** encrypted names ! interface Vlan1 nameif dmz security-level 50 ip address 192.168.1.1 255.255.255.0 ! interface Vlan2 nameif inside security-level 100 ip address 192.168.2.1 255.255.255.0 ! interface Vlan3 nameif outside security-level 0 ip address 10.0.0.254 255.255.255.0 ! interface Ethernet0/0 switchport access vlan 3 ! interface Ethernet0/1 ! interface Ethernet0/2 switchport access vlan 2 ! interface Ethernet0/3 switchport access vlan 2 shutdown ! interface Ethernet0/4 switchport access vlan 2 shutdown ! interface Ethernet0/5 switchport access vlan 2 shutdown ! interface Ethernet0/6 switchport access vlan 2 shutdown ! interface Ethernet0/7 switchport access vlan 2 shutdown ! boot system disk0:/asa805-k8.bin ftp mode passive access-list inside_out extended permit tcp host 192.168.2.5 any eq www pager lines 24 logging enable logging buffered debugging mtu dmz 1500 mtu inside 1500 mtu outside 1500 no failover icmp unreachable rate-limit 1 burst-size 1 no asdm history enable arp timeout 14400 global (outside) 10 interface nat (inside) 10 192.168.2.0 255.255.255.0 access-group inside_out in interface inside route outside 0.0.0.0 0.0.0.0 10.0.0.1 1 timeout xlate 3:00:00 timeout conn 1:00:00 half-closed 0:10:00 udp 0:02:00 icmp 0:00:02 timeout sunrpc 0:10:00 h323 0:05:00 h225 1:00:00 mgcp 0:05:00 mgcp-pat 0:05:00 timeout sip 0:30:00 sip_media 0:02:00 sip-invite 0:03:00 sip-disconnect 0:02:00 timeout sip-provisional-media 0:02:00 uauth 0:05:00 absolute timeout tcp-proxy-reassembly 0:01:00 dynamic-access-policy-record DfltAccessPolicy no snmp-server location no snmp-server contact snmp-server enable traps snmp authentication linkup linkdown coldstart crypto ipsec security-association lifetime seconds 28800 crypto ipsec security-association lifetime kilobytes 4608000 telnet timeout 5 ssh timeout 5 console timeout 0 threat-detection basic-threat threat-detection statistics access-list no threat-detection statistics tcp-intercept ! class-map inspection_default match default-inspection-traffic ! ! policy-map type inspect dns preset_dns_map parameters message-length maximum 512 policy-map global_policy class inspection_default inspect dns preset_dns_map inspect ftp inspect h323 h225 inspect h323 ras inspect netbios inspect rsh inspect rtsp inspect skinny inspect esmtp inspect sqlnet inspect sunrpc inspect tftp inspect sip inspect xdmcp ! service-policy global_policy global prompt hostname context Cryptochecksum:1234567890 : end