Solved

Blockng certain protocols only out

Posted on 2008-10-13
18
338 Views
Last Modified: 2012-05-05
Hi

Following on from the question below:-

http://www.experts-exchange.com/Hardware/Networking_Hardware/Firewalls/Q_23799210.html

My query is now the reverse, in that how can I specify only www and ftp for example for all as allowed traffic outbound?

Below is my running config:-

PIX Version 6.3(5)
interface ethernet0 auto
interface ethernet1 100full
nameif ethernet0 outside security0
nameif ethernet1 inside security100
enable password SX/Y7cXtfgcNOcz9 encrypted
passwd 2KFQnbNIdI.2KYOU encrypted
hostname pixfw
domain-name workgroup
fixup protocol dns maximum-length 512
fixup protocol ftp 21
fixup protocol h323 h225 1720
fixup protocol h323 ras 1718-1719
fixup protocol http 80
fixup protocol pptp 1723
fixup protocol rsh 514
fixup protocol rtsp 554
fixup protocol sip 5060
fixup protocol sip udp 5060
fixup protocol skinny 2000
fixup protocol smtp 25
fixup protocol sqlnet 1521
fixup protocol tftp 69
names
name 192.168.0.13 Exchange
access-list outside permit tcp any interface outside eq smtp
access-list outside permit tcp any interface outside eq https
access-list inside deny tcp any any eq ftp
access-list inside permit ip any any
pager lines 24
icmp deny any outside
mtu outside 1500
mtu inside 1500
ip address outside dhcp setroute retry 4
ip address inside 192.168.0.1 255.255.255.0
ip audit info action alarm
ip audit attack action alarm
pdm location 192.168.16.58 255.255.255.255 outside
pdm location Exchange 255.255.255.255 inside
pdm location 192.168.0.1 255.255.255.255 outside
pdm history enable
arp timeout 14400
global (outside) 1 interface
nat (inside) 1 0.0.0.0 0.0.0.0 0 0
static (inside,outside) tcp interface https Exchange https netmask 255.255.255.2
55 0 0
static (inside,outside) tcp interface smtp Exchange smtp netmask 255.255.255.255
 0 0
access-group outside in interface outside
access-group inside in interface inside
timeout xlate 3:00:00
timeout conn 1:00:00 half-closed 0:10:00 udp 0:02:00 rpc 0:10:00 h225 1:00:00
timeout h323 0:05:00 mgcp 0:05:00 sip 0:30:00 sip_media 0:02:00
timeout sip-disconnect 0:02:00 sip-invite 0:03:00
timeout uauth 0:05:00 absolute
aaa-server TACACS+ protocol tacacs+
aaa-server TACACS+ max-failed-attempts 3
aaa-server TACACS+ deadtime 10
aaa-server RADIUS protocol radius
aaa-server RADIUS max-failed-attempts 3
aaa-server RADIUS deadtime 10
aaa-server LOCAL protocol local
http server enable
http 192.168.0.0 255.255.255.0 inside
no snmp-server location
no snmp-server contact
snmp-server community public
no snmp-server enable traps
floodguard enable
telnet 192.168.0.0 255.255.255.0 inside
telnet timeout 15
ssh 192.168.0.1 255.255.255.255 outside
ssh timeout 15
console timeout 0
dhcpd address 192.168.0.2-192.168.0.10 inside
dhcpd dns 81.26.107.2
dhcpd lease 3600
dhcpd ping_timeout 750
dhcpd enable inside
terminal width 80
banner login Disconnect immediately if not authorised
banner motd Home cable firewall
Cryptochecksum:3962af86b5023ab0f1546176d4aa3422
: end
pixfw(config)#
0
Comment
Question by:dt3itsteam
  • 9
  • 8
18 Comments
 
LVL 4

Expert Comment

by:yurisk
ID: 22707144
config t
no access-list inside deny tcp any any eq ftp
access-list inside line 1 permit tcp any any eq 80
  access-list inside line 1 permit tcp any any eq ftp

no access-list inside permit ip any any
0
 
LVL 12

Expert Comment

by:Pugglewuggle
ID: 22707947
The above commands won't do the job.
These will:
access-list inside permit tcp any any eq ftp
access-list inside permit tcp any any eq www
access-list inside permit udp any any eq dns
access-list inside permit tcp any any eq dns
access-list inside deny ip any any
no access-list inside deny tcp any any eq ftp

What this will do is
  1. Allow FTP & WWW
  2. Allow DNS so you can resolve addresses
  3. deny everything else
  4. delete old ACL denying FTP
Cheers! Let me know if you have any questions!
0
 
LVL 12

Accepted Solution

by:
Pugglewuggle earned 250 total points
ID: 22707955
Actually, change above to this (they must be executed in order):
access-list inside permit tcp any any eq ftp
access-list inside permit tcp any any eq www
access-list inside permit udp any any eq dns
access-list inside permit tcp any any eq dns
access-list inside deny ip any any
no access-list inside deny tcp any any eq ftp
no access-list inside permit ip any any
Cheers!
0
 
LVL 1

Author Comment

by:dt3itsteam
ID: 22709274
Thanks will try tonight, incidentally do any of you know of a good (free) SSH client I can download, allowing me to test the configuration remotely?
0
 
LVL 12

Expert Comment

by:Pugglewuggle
ID: 22709277
Yes I do as a matter of fact!
PuTTY is considered the best SSH client out there. It's free, easy, and you can get it here:

http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
Cheers!
0
 
LVL 1

Author Comment

by:dt3itsteam
ID: 22709294
Thanks!!
0
 
LVL 12

Expert Comment

by:Pugglewuggle
ID: 22709327
No prob!
0
 
LVL 1

Author Comment

by:dt3itsteam
ID: 22709371
Just a quickie, is the statement:-

access-list inside deny ip any any

An explicit deny after all ACL's have been executed?

If I was to leave "access-list inside permit ip any any" I guess ths would still permit all I.P traffic out despite of the ACL's?
0
 
LVL 12

Expert Comment

by:Pugglewuggle
ID: 22709390
You don't really need this, I just put it there to demonstrate that all were being blocked - it is indeed implicit. :)
Yes, leaving that would permit all traffic. To only allow FTP and WWW, just run the commands I sent.
Cheers!
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 1

Author Comment

by:dt3itsteam
ID: 22709398
Great thanks, just wishing to ask and learn as I go...  Will try tonight and award points once tested
0
 
LVL 12

Expert Comment

by:Pugglewuggle
ID: 22709467
kk!
0
 
LVL 1

Author Comment

by:dt3itsteam
ID: 22709489
I'm assuming the "access-list inside deny ip any any" won't impact my PAT ACL rules?  or are my PAT rules allowed through by the following statement:-

"access-group outside in interface outside"
0
 
LVL 12

Expert Comment

by:Pugglewuggle
ID: 22709498
The rules are allowed through that access-group command indeed. Not the "access-list inside deny ip any any" one. You have a better idea of what's going on than you think you do. :)
0
 
LVL 1

Author Comment

by:dt3itsteam
ID: 22709503
Thanks now on my second week on my Cisco PIX 501, so I also think I'm making good progress!
0
 
LVL 12

Expert Comment

by:Pugglewuggle
ID: 22709521
You are! It took me lots of time messing up my internet connection when I was getting started on the ASA (new PIX) a few years ago. :)
0
 
LVL 1

Author Comment

by:dt3itsteam
ID: 22709602
I'm very keen to only use the CLI, I know I can use PDM but this kinda circumvents using a PIX if I use a GUI.  May as well use a bog standard Linksys router.  Cisco's something I'm really keen to get my head round!
0
 
LVL 12

Expert Comment

by:Pugglewuggle
ID: 22709668
Well, you'll find that the PDM and ASDM (higher versions of PIX and ASA) are really nice for some things and CLI is better for some.
For example modifying ACLs and some NAT rules (and viewing syslogs too) is much much better than doing it with CLI. Just the same, using CLI to view dhcp bindings and manually define VLANs is easier.
In fact, there are several commands only available in CLI that the GUI doesn't support, although the ASDM does a GREAT job of doing what it does - the graphs for analyzing traffic protocols, bandwidth, sources, etc. are nice too.
I just use which tool does the job best. Sometimes it's CLI, sometimes it's ASDM.
Everybody's different on what they like to use for what, but you'll see what I mean as you progress.
Cheers!
0
 
LVL 1

Author Comment

by:dt3itsteam
ID: 22714042
Hi Pugglewuggle,

Everything worked fine, except I had to hange the following lines:-

access-list inside permit udp any any eq dns
access-list inside permit tcp any any eq dns

to:-

access-list inside permit udp any any eq 53
access-list inside permit tcp any any eq 53

which was changed to:-

access-list inside permit udp any any eq domain
access-list inside permit tcp any any eq domain

Thiis is my running config :-

PIX Version 6.3(5)
interface ethernet0 auto
interface ethernet1 100full
nameif ethernet0 outside security0
nameif ethernet1 inside security100
enable password SX/Y7cXtfgcNOcz9 encrypted
passwd 2KFQnbNIdI.2KYOU encrypted
hostname pixfw
domain-name workgroup
fixup protocol dns maximum-length 512
fixup protocol ftp 21
fixup protocol h323 h225 1720
fixup protocol h323 ras 1718-1719
fixup protocol http 80
fixup protocol pptp 1723
fixup protocol rsh 514
fixup protocol rtsp 554
fixup protocol sip 5060
fixup protocol sip udp 5060
fixup protocol skinny 2000
fixup protocol smtp 25
fixup protocol sqlnet 1521
fixup protocol tftp 69
names
name 192.168.0.13 Exchange
access-list outside permit tcp any interface outside eq smtp
access-list outside permit tcp any interface outside eq https
access-list inside deny tcp any any eq ftp
access-list inside permit tcp any any eq ftp
access-list inside permit tcp any any eq www
access-list inside permit udp any any eq domain
access-list inside permit tcp any any eq domain
access-list inside deny ip any any
pager lines 24
icmp deny any outside
mtu outside 1500
mtu inside 1500
ip address outside dhcp setroute retry 4
ip address inside 192.168.0.1 255.255.255.0
ip audit info action alarm
ip audit attack action alarm
pdm location 192.168.16.58 255.255.255.255 outside
pdm location Exchange 255.255.255.255 inside
pdm location 192.168.0.1 255.255.255.255 outside
pdm history enable
arp timeout 14400
global (outside) 1 interface
nat (inside) 1 0.0.0.0 0.0.0.0 0 0
static (inside,outside) tcp interface https Exchange https netmask 255.255.255.255 0 0
static (inside,outside) tcp interface smtp Exchange smtp netmask 255.255.255.255 0 0
access-group outside in interface outside
access-group inside in interface inside
timeout xlate 3:00:00
timeout conn 1:00:00 half-closed 0:10:00 udp 0:02:00 rpc 0:10:00 h225 1:00:00
timeout h323 0:05:00 mgcp 0:05:00 sip 0:30:00 sip_media 0:02:00
timeout sip-disconnect 0:02:00 sip-invite 0:03:00
timeout uauth 0:05:00 absolute
aaa-server TACACS+ protocol tacacs+
aaa-server TACACS+ max-failed-attempts 3
aaa-server TACACS+ deadtime 10
aaa-server RADIUS protocol radius
aaa-server RADIUS max-failed-attempts 3
aaa-server RADIUS deadtime 10
aaa-server LOCAL protocol local
http server enable
http 192.168.0.0 255.255.255.0 inside
no snmp-server location
no snmp-server contact
snmp-server community public
no snmp-server enable traps
floodguard enable
telnet 192.168.0.0 255.255.255.0 inside
telnet timeout 15
ssh 192.168.0.1 255.255.255.255 outside
ssh timeout 15
console timeout 0
dhcpd address 192.168.0.2-192.168.0.10 inside
dhcpd dns 81.26.107.2
dhcpd lease 3600
dhcpd ping_timeout 750
dhcpd enable inside
terminal width 80
banner login Disconnect immediately if not authorised
banner motd Home cable firewall
Cryptochecksum:eb2f60263be6afc8c48ae99bdb852e4d
: end
pixfw(config)#
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

The DROP (Spamhaus Don't Route Or Peer List) is a small list of IP address ranges that have been stolen or hijacked from their rightful owners. The DROP list is not a DNS based list.  It is designed to be downloaded as a file, with primary intention…
Exchange server is not supported in any cloud-hosted platform (other than Azure with Azure Premium Storage).
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now