Networking-Blog

My WordPress Blog

Transit Access Control Lists: Filtering at Your Edge

Transit Filtering at Your Edge

tacl.gif
The edge routers should be configured to provide a first level of security through the use of
inbound ACLs. The ACLs allow only specifically permitted traffic to the DMZ and allow
return traffic for internal users accessing the Internet. All non authorized traffic should be
dropped on the ingress interfaces
.

 

This document presents guidelines and recommended deployment techniques for filtering transit
and edge traffic at your network ingress points. Transit access control lists (ACLs) are used to
increase network security by explicitly permitting only required traffic into your network or networks.

In most edge network environments, such as a typical enterprise network Internet point of presence,
ingress filtering should be used to drop unauthorised traffic at the edge of the network. In certain service
provider deployments, this form of edge or transit traffic filtering can also be used effectively to limit the
flow of transit traffic to and from customers to specific permitted protocols only.

This example depicts a typical enterprise Internet connectivity design. Two edge routers, IR1 and IR2,
provide direct connectivity to the Internet. Behind these two routers, a pair of firewalls
(Cisco PIXes in this example) provides stateful inspection capabilities and access to both the internal
network and the demilitarised zone (DMZ). The DMZ contains public-facing services such as
DNS and web; this is the only network accessible directly from the public Internet.
The internal network should never be accessed directly by the Internet, but traffic sourced from the
internal network must be able to reach Internet sites.

ACL Example

This access list provides a simple yet realistic example of typical entries required in a transit ACL.
This basic ACL needs to be customized with local site-specific configuration details.

!— Add anti-spoofing entries.
!— Deny special-use address sources.
!— Refer to RFC 3330 for additional special use addresses.

access-list 110 deny ip 127.0.0.0 0.255.255.255 any
access-list 110 deny ip 192.0.2.0 0.0.0.255 any
access-list 110 deny ip 224.0.0.0 31.255.255.255 any
access-list 110 deny ip host 255.255.255.255 any

!— The deny statement should not be configured
!— on Dynamic Host Configuration Protocol (DHCP) relays.

access-list 110 deny ip host 0.0.0.0 any

!— Filter RFC 1918 space.

access-list 110 deny ip 10.0.0.0 0.255.255.255 any
access-list 110 deny ip 172.16.0.0 0.15.255.255 any
access-list 110 deny ip 192.168.0.0 0.0.255.255 a
ny

!— Permit Border Gateway Protocol (BGP) to the edge router.

access-list 110 permit tcp host bgp_peer gt 1023 host router_ip eq bgp
access-list 110 permit tcp host
bgp_peer eq bgp host router_ip gt 1023

!— Deny your space as source (as noted in RFC 2827).

access-list 110 deny ip your Internet-routable subnet any

!— Explicitly permit return traffic.
!— Allow specific ICMP types.

access-list 110 permit icmp any any echo-reply
access-list 110 permit icmp any any unreachable
access-list 110 permit icmp any any time-exceeded
access-list 110 deny   icmp any a
ny

!— These are outgoing DNS queries.

access-list 110 permit udp any eq 53  host primary DNS server gt 1023

!— Permit older DNS queries and replies to primary DNS server.

access-list 110 permit udp any eq 53  host primary DNS server eq 53

!— Permit legitimate business traffic.

access-list 110 permit tcp any Internet-routable subnet established
access-list 110 permit udp any range 1 1023
Internet-routable subnet gt 1023

!— Allow ftp data connections.

access-list 110 permit tcp any eq 20 Internet-routable subnet gt 1023

!— Allow tftp data and multimedia connections.

access-list 110 permit udp any gt 1023 Internet-routable subnet gt 1023

!— Explicitly permit externally sourced traffic.
!— These are incoming DNS queries.

access-list 110 permit udp any gt 1023 host <primary DNS server> eq 53

!– These are zone transfer DNS queries to primary DNS server.

access-list 110 permit tcp host secondary DNS server gt 1023 host primary DNS server eq 53

!— Permit older DNS zone transfers.

access-list 110 permit tcp host secondary DNS server eq 53  host primary DNS server eq 53

!— Deny all other DNS traffic.

access-list 110 deny udp any any eq 53
access-list 110 deny tcp any any eq 53

!— Allow IPSec VPN traffic.

access-list 110 permit udp any host IPSec headend device eq 500
access-list 110 permit udp any host
IPSec headend device eq 4500
access-list 110 permit 50 any host
IPSec headend device
access-list 110 permit 51 any host
IPSec headend device
access-list 110 deny   ip any host
IPSec headend device

!— These are Internet-sourced connections to
!— publicly accessible servers.

access-list 110 permit tcp any host public web server eq 80
access-list 110 permit tcp any host
public web server eq 443
access-list 110 permit tcp any host
public FTP server eq 21

!— Data connections to the FTP server are allowed
!— by the permit established ACE.
!— Allow PASV data connections to the FTP server.

access-list 110 permit tcp any gt 1023 host public FTP server gt 1023
access-list 110 permit tcp any host
public SMTP server eq 25

!— Explicitly deny all other traffic.

access-list 101 deny ip any any

Note: Please keep these suggestions in mind when you apply the transit ACL.

Cisco Lock-and-Key Security (Dynamic Access Lists)

Lock-and-Key Security
To enable the router to create a temporary access list entry in a dynamic access list,
use the access-enable privileged EXEC command.
This command enables the lock-and-key access feature.

Always define either an idle timeout (with the timeout keyword in this command),
or an absolute timeout (with the timeout keyword in the access-list command).
Otherwise, the temporary access list entry will remain, even after the user terminates the session.

Use the autocommand command with the access-enable command to cause the access-enable
command to execute when a user opens a Telnet session into the router.

Example:

The following example causes the software to create a temporary access list entry and tells
the software to enable access only for the host from which the Telnet session originated.
If the access list entry is not accessed within 5 minutes, it is deleted:

Router#access-enable host timeout 5

Dynamic ACLs

Some of the many security benefits of Dynamic ACLs over standard and static extended ACLs are:

  • The use of an authentication mechanism for individual users.
  • Reduction of the opportunity for network break-ins by network hackers.
  • In many cases, reduction of the amount of router processing that is required for ACLs.
  • Simplified management in large internetworks.
  • Creation of dynamic user access through a firewall, without compromising other configured security restrictions.

First configure the access-list on R2 for the Dynamic ACL

  • access-list 101 permit tcp any any eq 23 (we need to allow telnet through so we can authenticate. Now we can get away without this line here since we have permit ip any any at the bottom of the ACL. This will all depend on how you have to build out the ACL if you need this or not.)
  • access-list 101 dynamic HTTP permit tcp any any eq 80 (we could specify a specific host that is allowed access here or a subnet but we want to allow anyone that can authenticate for this example.)
  • access-list 101 deny tcp any any eq 80 (Here we are blocking access to anyone that doesn’t authenticate for web traffic.)
  • access-list 101 permit ip any any (Here we are allowing the rest of the incoming traffic in.)

We need to configure login access now. Usually I would authenticate everyone against my active directory, but we will just use local login for this.

  • username r1 password cisco

Need to apply the access-list on the incoming interface.

  • int s0/0
  • ip access-group 101 in

Now we just need to configure the telnet lines

  • line vty 0 4
  • login local
  • autocommand access-enable

Just need to telnet to r2 and authenticate and then we will have access to the
web server on the remote end.

This is what our access-list should look like once we have authenticated:

10 permit tcp any any eq telnet (183 matches)
20 Dynamic HTTP permit tcp any any eq www
permit tcp any any eq www (72 matches)
30 deny tcp any any eq www (9 matches)
40 permit ip any any

Notice the line statement under line 20. This is showing that the dynamic acl is active.

If you want to clear the access-list you need to use this command:

clear access-template [access-list-number | name] [dynamic-name] [source] [destination]

Host :
Tells the software to enable access only for the host from which the Telnet session originated.
If not specified, the software allows all hosts on the defined network to gain access.
The dynamic access list contains the network mask to use for enabling the new network.

Timeout :
Specifies an idle timeout for the temporary access list entry. If the access list entry is not accessed
within this period, it is automatically deleted and requires the user to authenticate again.
The default is for the entries to remain permanently.

The autocommand will look like this for the line vty :
autocommand access-enable host timeout 30

You can also add the timeout value within the dynamic Acl :

access-list 101 dynamic testlist timeout 120 permit ip any any

My Configuration in Place :

Create Local Authentication Group :

aaa authentication login local_auth local

!

Local Account Login of Privilege 0
(no ssh access for management, if able to login using credentials,
will be prompted for the enable secret password).
(This provides extra security measures).

username pass privilege 0 password 7 00141215170A5955

!

Create a Named Access-List with Dynamic ACL :

ip access-list extended LOCKnKEY
remark TELNET
permit tcp 192.168.3.0 0.0.0.7 host 192.168.3.1 eq telnet
remark DNS
permit udp 192.168.3.0 0.0.0.7 host 192.168.3.1 eq domain
remark DYNAMIC_ACL-HTTP
dynamic LOCKnKEY timeout 300 permit tcp 192.168.3.0 0.0.0.7 any eq www
remark HTTP
deny   tcp 192.168.3.0 0.0.0.7 any eq www (Denies NON-Authenicate Users)
remark DENY_TRAFFIC
deny   ip any any log

!

Bind To Internal LAN Interface :

interface Vlan 1
ip access-group LOCKnKEY in

!

Allow Telnet Only on Line VTY 0
(All Telnet Sessions Will Invoke the access-enable command)

line vty 0
exec-timeout 15 0
privilege level 15
(Need to be on Level 15 in order to invoke command access-enable host timeout 30)
login authentication local_auth
autocommand  access-enable host timeout 30
transport preferred telnet
transport input telnet

!

Allow SSH on Line VTY 1-4 for Management Purposes :

line vty 1 4
exec-timeout 15 0
privilege level 0
login authentication local_auth
rotary 1
transport preferred ssh
transport input ssh



Cisco Time-Range

An extended access control list can be either a numbered or a named ACL. In each case,
the Time-Range option is added to provide an additional qualifier for the permit|deny statement.

Time-Range command

The following time range example with a periodic statement denies web traffic to employees on the
Ethernet LAN for Monday through Friday during business hours (8:00 A.M. to 6:00 P.M.).

time-range no-web
periodic weekdays 8:00 to 18:00
!
ip access-list extended block-web
deny tcp any any eq www time-range no-web
permit ip any any
!
interface ethernet 0
ip access-group block-web in
!

The following example uses a time-based access list to allow a LAN to begin accessing the network
beginning at 8:00 A.M. on January 1, 2003. The access will continue until stopped.
The access list and time range together permit traffic on Ethernet interface 0 starting.

time-range new-lan
absolute start 8:00 1 January 2003
!
ip access-list extended start-service
permit ip 192.168.15.0 0.0.0.255 any time-range new-lan
!
interface ethernet 0
ip access-group start-service in

The following example uses a time-based access list to block a LAN from accessing the
network beginning at midnight on December 31, 2003
.

time-range stop-lan
absolute end 23:59 31 December 2003
!
ip access-list extended stop-service
permit ip 192.168.15.0 0.0.0.255 any time-range stop-lan
!
interface ethernet 0
ip access-group stop-service in

The following example uses a time-based access list to permit weekend employees to browse
the Internet for a two month test period from 8:00 A.M. on June 1, 2003, to 6:00 P.M.on July 31, 2003.

time-range web-test
absolute start 8:00 1 June 2003 end 18:00 31 July 2003
periodic weekends 00:00 to 23:59
!
ip access-list extended lan-web
permit tcp 192.168.15.0 0.0.0.255 any eq www time-range web-test
!
interface ethernet 0
ip access-group lan-web in

The following time range example with a periodic statement allows access to web traffic access
to employees on the Ethernet LAN for Monday through Friday during business hours
(8:00 A.M. to 4:00 P.M.).

time-range Workhours
periodic weekdays 8:00 to 16:00
!
ip access-list extended permit Permission-To-Internal-Server-In-Work-Hours
permit tcp any host 10.0.0.5 eq www time-range Workhours
deny tcp any host 10.0.0.5 eq www
permit ip any any
!
interface ethernet 0
ip access-group Permission-To-Internal-Server-In-Work-Hours in

The following time range example with a periodic statement allows web traffic
to www.facebook.com to employees on the Ethernet LAN for Monday through Friday
during non business hours (17:00 P.M. to 22:00 P.M.)

time-range FACEBOOK_TIME
periodic weekdays 17:00 to 22:00
!
ip access-list extended FACEBOOK_TIME
remark WWW.FACEBOOK.COM
permit tcp 192.168.3.0 0.0.0.7 66.220.144.0 0.0.15.255 eq www time-range FACEBOOK_TIME
permit tcp 192.168.3.0 0.0.0.7 66.220.144.0 0.0.15.255 eq 443 time-range FACEBOOK_TIME
deny tcp 192.168.3.0 0.0.0.7 66.220.144.0 0.0.15.255 eq www
deny tcp 192.168.3.0 0.0.0.7 66.220.144.0 0.0.15.255 eq 443
remark FACEBOOK.COM
permit tcp 192.168.3.0 0.0.0.7 69.63.176.0 0.0.15.255 eq www time-range FACEBOOK_TIME
permit tcp 192.168.3.0 0.0.0.7 69.63.176.0 0.0.15.255 eq 443 time-range FACEBOOK_TIME
deny tcp 192.168.3.0 0.0.0.7 69.63.176.0 0.0.15.255 eq www
deny tcp 192.168.3.0 0.0.0.7 69.63.176.0 0.0.15.255 eq 443
remark HTTP
permit tcp 192.168.3.0 0.0.0.7 any eq www
remark HTTPS
permit tcp 192.168.3.0 0.0.0.7 any eq 443
remark DENY_TRAFFIC
deny   ip any any log
!
interface ethernet 0
ip access-group FACEBOOK_TIME in
!
!
Keep in mind there is an explicit deny at the end of the ACL. If you are going to permit ip any any
at the bottom of ACL, keep in mind that there has to be a deny entry for tcp HTTP traffic. This is because
when
time-range FACEBOOK_TIME ACL is in inactive state, it looks for a matching rule that will either permit or deny FACEBOOK_TIME HTTP traffic.

Unable to Browse Internet when Using a GRE Tunnel?

56a.gif


Internet Control Message Protocol (ICMP) type 3 code 4 packet

(Destination Unreachable; Fragmentation Needed and DF set).
!
This ICMP message contains the correct MTU to be used by the Web Server,
which should receive this message and adjust the packet size accordingly
.

You can view the ICMP messages sent by R2 by enabling the debug ip icmp command:

Blocked ICMP Messages

A common problem occurs when ICMP messages are blocked along the path to the Web server.
When this happens, the ICMP packet never reaches the Web server, thereby preventing data from
passing between client and server
.

Further Solutions

Use policy routing to clear and set the DF bit in the data IP packet

route-map clear-df permit 10
match ip address 101
set ip df 0

!
interface ethernet 0
ip policy route-map clear-df
!
access-list 101 permit tcp 10.1.3.0 0.0.0.255 any

This will allow the data IP packet to be fragmented before it is GRE encapsulated.
!
The receiving end host must then reassemble the data IP packets.
The end hosts now send TCP/IP packets no larger than this value
.

interface tunnel0
ip tcp adjust-mss 1436

The router on the other end of the GRE tunnel must reassemble the GRE tunnel packet
before it can remove the GRE header and forward the inner packet.
IP packet reassembly is done in process-switch mode and uses memory.
Therefore, this option can significantly reduce the packet throughput through the GRE tunnel
.

interface tunnel0
ip mtu 1500

NAT Public Ip address Over VPN

On Cisco Configuration :

NAT statements added for external addresses
:

ip nat inside source list NAT interface FastEthernet4 overload
!
ip access-list extended NAT
permit udp host 194.62.42.150 host 213.123.196.140 eq 50561
permit udp host 194.62.42.150 host 213.123.197.21 eq 50561

!
VPN match statement to include Public_Ip UDP flow NAT traffic :
!
VPN access-list for VPN Traffic :

ip access-list extended VPN
remark LAN_TO_LAN
permit ip local_lan_subnet/mask remote_lan_subnet/mask
remark Access_To_PUBLIC_IP_OVER_VPN
permit udp host local_lan_ip host 194.72.93.118

VPN Peer terminating devices is a Linux BOX :

Route updated on Linux Box to forward NAT Public Ip traffic over VPN to remote site HQ.

sudo ip route add 194.72.93.118 via 10.200.0.1 dev eth1 proto zebra equalize

Linux Box Iptables Firewall site_to_site chain updated to allow traffic source
from Public_Ip over VPN
:

sudo iptables -I  site_to_site -s 194.72.93.118 -j ACCEPT
sudo iptables -I  site_to_site -s 194.72.93.119 -j ACCEPT

ASA – Group Object

Create a Object-Group icmp-type ICMP traffic :

object-group icmp-type INBOUND
description Permit necessary inbound ICMP traffic
icmp-object echo
icmp-object echo-reply
icmp-object unreachable
icmp-object time-exceeded

Create a Object-Group service for TCP traffic :

object-group service INBOUND tcp
description Inbound Access
port-object eq 3389
port-object range 9998 9999

ADSL2 v ADSL2+

There’s a common misconception that ADSL2+ is faster than ADSL2 on any line.
That’s not really the case. In simple terms,

ADSL2+ utilises twice the frequency range available on your phone line that ADSL2 does.
This again, in simple terms means twice as fast BUT that is only seen on short low attenuation lines.

If your line is only capable of supporting 7meg on ADSL2 then it’s only capable of supporting 7meg on ADSL2+
as it can only usually allow the use of the same frequencies for both (see below).

However, if you’re lucky enough to have a line that can support higher frequencies then you get up to :
 
12meg
on ADSL2 (the maximum possible)
but up to
24meg on ADSL2+.

The cross over between ADSL2 and ADSL2+ is therefore in the 10-12 meg range (typically 35-40db if the line is relatively noise free).

It can give faster speeds but usually only on short lines as explained above.
The only time that wouldn’t be true is for a moderately short line
(that offered some higher frequencies above those usable by ADSL2)
that had induced noise at the lower frequencies and was clean at higher frequencies,
in which case ADSL2+ would possibly be better as it could use those higher frequencies.

There is also the possibility that a network uses equipment whose firmware works better in
certain conditions with specific ADSL modes hence why it is mentioned G.DMT sometimes being
better for problem lines.

Cisco: 1841 – 3G Configuration

This configuration example is for use with a 3G WIC card within a Cisco based
Router.

This was configured with a Vodafone Network.

Initialization

Place the SIM card into it, then insert the card in the router and power it on.

Create a Profile specific to your mobile ISP

  • Insert the APN told by your ISP (Vodafone UK: ‘Internet’ username: ‘web’ password: ‘web’)
  • Insert the authentication method (chap or pap) and the credentials, also supplied from your ISP

Below is an example of a Vodafone UK Cellar Profilule.
Router# cellular 0/0/0 gsm profile create 1 Internet chap web web

From the profile you’ve just created, you can review it using command

router# sh cellular 0 profile

Profile Information
====================
Profile 1 = ACTIVE
--------
PDP Type = IPv4
PDP address = 192.168.1.1
Access Point Name (APN) = Internet
Authentication = PAP
Username: web, Password: web 

* - Default profile

Configuration

You need to define a chat script first, which is used for modem setup and call
initialization. If you are familiar with IOS dial configurations, you feel at home.
Please note that the last number in the dial string (1 in the example below) refers
to the modem profile number you hopefully have defined earlier.

! your chat script
chat-script vodafone “” “ATDT*98*1#” TIMEOUT 60 CONNECT

! the bare interface config
! subcommands at the Cellular interface

interface Cellular0/0/0
ip address negotiated
ip virtual-reassembly
encapsulation ppp
dialer in-band
dialer idle-timeout 0
dialer string vodafone
dialer-group 1
async mode interactive
ppp chap hostname web
ppp chap password 0 web
ppp ipcp dns request

!

ip route 0.0.0.0 0.0.0.0 Cellular0
dialer-list 1 protocol ip permit

! this is the async line assigned to the 3G modem
you need to specify your chat script here

line 0/0/0
script dialer vodaphone
no exec
rxspeed 3600000
txspeed 384000

If cellular int does not get an ip address, might need to go into
config t and add this line
even thou we see it above :

line 0/0/0
script dialer vodaphone

!
!

show command:

Just in case you need it for troubleshooting, here are the show commands to use.

  • show cellular 0 network
  • show cellular 0 hardware
  • show cellular 0 connection
  • show cellular 0 radio
  • show cellular 0 profile
  • show cellular 0 security
  • show cellular 0 all Debug commands :
  • debug chat Rather than reloading the router to restart the module, you can
    actually using CLI to reset or reboot the module
    :

    debug chat

    router(config)# service internal
    router(config)# exit
    router# test cellular 0 modem-power-cycle ! for rebooting
    router# test cellular 0 modem-reset ! for resetting

    debug commands :

    debug chat
    debug modem
    debug dialer events
    debug ppp authentication

  • Remember to create the Cellular Profile, after tftp config to router :
    cellular 0/0/0 gsm profile create 1 Internet chap web web
  • This is the bare configuration, you will need to add NAT, firewalls etc etc.

Linux Video Driver Version Command

Video Driver Version Command

dmesg | grep NVIDIA
sudo lspci -vvnn | grep 10de

 

What I did from the command line is to find the packages for nvidia

(dpkg -l | grep nvidia)
and then
apt-get remove nvidia-173 

(or whatever package you get from the previous command).

The problem is that you will still have the nvidia modues listed in xorg.conf.
So, I also  mv /etc/X11/xorg.conf /etc/X11/xorg.conf_backup
and rebooted.

I landed in a graphical mode as usual, without the nvidia GL stuff,
but then there are graphical tools to set it up.

At this state, it’s safe to delete the xorg.conf backup you just created.

####################
Whenever I try to start my computer from kernel version 3 (it boots fine with 2.6) Kubuntu stops booting

altogether.

11.10 stops booting at “Checking battery state … [OK]”

I had to reinstall my graphics drivers.

sudo apt-get install --reinstall nvidia-173

Home Linux Ubuntu Iptables Firewall Rule

# Generated by iptables-save v1.4.4 on Wed Dec 29 15:11:27 2010
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -i lo -j ACCEPT
-A INPUT -d 127.0.0.0/8 ! -i lo -j REJECT –reject-with icmp-port-unreachable
-A INPUT -m state –state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -d 192.168.2.4/32 -i eth0 -p tcp -m tcp –dport 222 -j ACCEPT
-A INPUT -d 192.168.2.4/32 -i eth0 -p tcp -m tcp –dport 222 -m state –state NEW -m recent –update –seconds 60 –hitcount 8 –rttl –name SSH –rsource -j DROP
-A INPUT -d 172.16.254.3/32 -i eth0 -p tcp -m tcp –dport 8080 -j ACCEPT
-A INPUT -d 10.20.254.254/32 -i eth0 -p tcp -m tcp –dport 1723 -j ACCEPT
-A INPUT -d 172.16.254.3/32 -i eth0 -p udp -m udp –dport 7777 -j ACCEPT
-A INPUT -d 172.16.254.3/32 -i eth0 -p udp -m udp –dport 7778 -j ACCEPT
-A INPUT -d 172.16.254.3/32 -i eth0 -p udp -m udp –dport 7787 -j ACCEPT
-A INPUT -d 192.168.2.4/32 -i eth0 -p tcp -m tcp –dport 5800 -j ACCEPT
-A INPUT -d 192.168.2.4/32 -i eth0 -p tcp -m tcp –dport 5900 -j ACCEPT
-A INPUT -d 192.168.2.4/32 -i eth0 -p tcp -m tcp –dport 5901 -j ACCEPT
-A INPUT -d 192.168.2.4/32 -i eth0 -p tcp -m tcp –dport 5902 -j ACCEPT
-A INPUT -d 192.168.2.4/32 -i eth0 -p tcp -m tcp –dport 5938 -j ACCEPT
-A INPUT -s 10.20.254.249/32 -d 192.168.2.4/32 -i ppp0 -p tcp -m tcp –dport 139 -j ACCEPT
-A INPUT -s 192.168.6.0/29 -d 192.168.2.4/32 -i eth0 -p tcp -m tcp –dport 139 -j ACCEPT
-A INPUT -s 172.16.254.3/32 -d 192.168.2.4/32 -i eth0 -p tcp -m tcp –dport 139 -j ACCEPT
-A INPUT -s 172.16.254.3/32 -d 192.168.2.4/32 -i eth0 -p tcp -m tcp –dport 445 -j ACCEPT
-A INPUT -s 10.0.0.0/24 -d 192.168.2.4/32 -i eth0 -p tcp -m tcp –dport 445 -j ACCEPT
-A INPUT -s 10.0.1.0/24 -d 192.168.2.4/32 -i eth0 -p tcp -m tcp –dport 445 -j ACCEPT
-A INPUT -s 192.168.6.0/29 -d 192.168.2.4/32 -i eth0 -p tcp -m tcp –dport 445 -j ACCEPT
-A INPUT -s 10.20.254.249/32 -d 192.168.2.4/32 -i ppp0 -p tcp -m tcp –dport 445 -j ACCEPT
-A INPUT -s 192.168.3.0/29 -d 192.168.2.4/32 -i eth0 -p tcp -m tcp –dport 445 -j ACCEPT
-A INPUT -s 192.168.4.0/28 -d 192.168.2.4/32 -i eth0 -p tcp -m tcp –dport 445 -j ACCEPT
-A INPUT -s 172.16.0.2/32 -d 192.168.2.4/32 -i eth0 -p tcp -m tcp –dport 445 -j ACCEPT
-A INPUT -d 192.168.2.4/32 -i eth0 -p tcp -m tcp –dport 21 -j ACCEPT
-A INPUT -s 192.168.2.1/32 -d 192.168.2.4/32 -i eth0 -p udp -m udp –dport 514 -j ACCEPT
-A INPUT -s 192.168.2.1/32 -d 192.168.2.4/32 -i eth0 -p udp -m udp –dport 9996 -j ACCEPT
-A INPUT -d 192.168.2.4/32 -i eth0 -p udp -m udp –dport 50518 -j ACCEPT
-A INPUT -d 192.168.2.4/32 -i eth0 -p tcp -m tcp –dport 50518 -j ACCEPT
-A INPUT -d 192.168.2.4/32 -i eth0 -p udp -m udp –dport 6881 -j ACCEPT
-A INPUT -s 192.168.2.1/32 -d 10.20.254.248/29 -i eth0 -p icmp -j ACCEPT
-A INPUT -s 192.168.2.1/32 -d 172.16.254.2/32 -i eth0 -p icmp -j ACCEPT
-A INPUT -s 192.168.2.1/32 -d 172.16.254.3/32 -i eth0 -p icmp -j ACCEPT
-A INPUT -s 192.168.2.1/32 -d 172.16.254.3/32 -i eth0 -p icmp -j ACCEPT
-A INPUT -s 192.168.4.0/28 -d 192.168.2.4/32 -i eth0 -p icmp -j ACCEPT
-A INPUT -s 192.168.4.0/28 -d 172.16.254.3/32 -i eth0 -p icmp -j ACCEPT
-A INPUT -s 192.168.6.0/29 -d 192.168.2.4/32 -i eth0 -p icmp -j ACCEPT
-A INPUT -s 172.16.0.2/32 -d 192.168.2.4/32 -i eth0 -p icmp -j ACCEPT
-A INPUT -s 10.20.254.248/29 -d 10.20.254.248/29 -i ppp0 -p icmp -j ACCEPT
-A INPUT -s 10.20.254.249/32 -d 192.168.2.4/32 -i ppp0 -p icmp -j ACCEPT
-A INPUT -m limit –limit 5/min -j LOG –log-prefix “iptables denied: ” –log-level 7
-A INPUT -j DROP
-A OUTPUT -s 192.168.2.4/32 -p tcp -m tcp –dport 80 -j ACCEPT
-A OUTPUT -s 172.16.254.3/32 -p tcp -m tcp –sport 8080 -j ACCEPT
-A OUTPUT -s 192.168.2.4/32 -p tcp -m tcp –dport 443 -j ACCEPT
-A OUTPUT -s 10.20.254.254/32 -p tcp -m tcp –sport 1723 -j ACCEPT
-A OUTPUT -s 172.16.254.3/32 -p udp -m udp –sport 7777 -j ACCEPT
-A OUTPUT -s 172.16.254.3/32 -p udp -m udp –sport 7778 -j ACCEPT
-A OUTPUT -s 172.16.254.3/32 -p udp -m udp –sport 7787 -j ACCEPT
-A OUTPUT -s 10.20.254.254/32 -p gre -j ACCEPT
-A OUTPUT -s 192.168.2.4/32 -p tcp -m tcp –dport 5938 -j ACCEPT
-A OUTPUT -s 192.168.2.4/32 -p tcp -m tcp –dport 5900 -j ACCEPT
-A OUTPUT -s 192.168.2.4/32 -p tcp -m tcp –dport 21 -j ACCEPT
-A OUTPUT -s 192.168.2.4/32 -d 192.168.2.1/32 -p tcp -m tcp –dport 2222 -j ACCEPT
-A OUTPUT -s 192.168.2.4/32 -d 192.168.3.2/32 -p tcp -m tcp –dport 2223 -j ACCEPT
-A OUTPUT -s 192.168.2.4/32 -d 192.168.4.2/32 -p tcp -m tcp –dport 2223 -j ACCEPT
-A OUTPUT -s 192.168.2.4/32 -d 192.168.2.1/32 -p udp -m udp –dport 53 -j ACCEPT
-A OUTPUT -s 192.168.2.4/32 -p tcp -m tcp –dport 30000 -j ACCEPT
-A OUTPUT -s 192.168.2.4/32 -p icmp -j ACCEPT
-A OUTPUT -s 172.16.254.2/32 -d 192.168.2.1/32 -p icmp -j ACCEPT
-A OUTPUT -s 172.16.254.2/32 -d 172.16.254.1/32 -p icmp -j ACCEPT
-A OUTPUT -s 172.16.254.2/32 -d 172.16.254.3/32 -p icmp -j ACCEPT
-A OUTPUT -s 172.16.254.3/32 -d 172.16.254.1/32 -p icmp -j ACCEPT
-A OUTPUT -s 172.16.254.3/32 -d 172.16.254.2/32 -p icmp -j ACCEPT
-A OUTPUT -s 172.16.254.3/32 -d 192.168.2.4/32 -p icmp -j ACCEPT
-A OUTPUT -s 172.16.254.3/32 -d 192.168.4.0/28 -p icmp -j ACCEPT
-A OUTPUT -s 10.20.254.254/32 -d 192.168.2.1/32 -p icmp -j ACCEPT
-A OUTPUT -s 10.20.254.254/32 -d 192.168.2.4/32 -p icmp -j ACCEPT
-A OUTPUT -s 10.20.254.249/32 -d 192.168.2.4/32 -p icmp -j ACCEPT
-A OUTPUT -s 10.20.254.254/32 -d 10.20.254.249/32 -p icmp -j ACCEPT
-A OUTPUT -s 192.168.2.4/32 -p udp -m udp –dport 69 -j ACCEPT
-A OUTPUT -s 192.168.2.4/32 -p tcp -m tcp –dport 23 -j ACCEPT
-A OUTPUT -s 192.168.2.4/32 -p udp -m udp –dport 123 -j ACCEPT
-A OUTPUT -s 192.168.2.4/32 -d 81.103.221.11/32 -p tcp -m tcp –dport 25 -j ACCEPT
-A OUTPUT -s 192.168.2.4/32 -d 192.168.2.1/32 -p udp -m udp –dport 514 -j ACCEPT
-A OUTPUT -s 192.168.2.4/32 -d 192.168.2.1/32 -p udp -m udp –dport 161 -j ACCEPT
-A OUTPUT -s 192.168.2.4/32 -d 192.168.2.1/32 -p udp -m udp –dport 162 -j ACCEPT
-A OUTPUT -s 192.168.2.4/32 -p tcp -m tcp –dport 4070 -j ACCEPT
-A OUTPUT -s 192.168.2.4/32 -d 192.168.5.2/32 -p tcp -m tcp –dport 9100 -j ACCEPT
-A OUTPUT -s 192.168.2.4/32 -d 94.136.40.61/32 -p tcp -m tcp –dport 110 -j ACCEPT
-A OUTPUT -s 192.168.2.4/32 -p tcp -m tcp –dport 1024:65535 -j ACCEPT
-A OUTPUT -m limit –limit 5/min -j LOG –log-prefix “iptables denied: ” –log-level 7
-A OUTPUT -j DROP
COMMIT
# Completed on Wed Dec 29 15:11:27 2010
# Generated by iptables-save v1.4.4 on Wed Dec 29 15:11:27 2010
*nat
:PREROUTING ACCEPT [430:32842]
:POSTROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [2773:170524]
COMMIT
# Completed on Wed Dec 29 15:11:27 2010
# Generated by iptables-save v1.4.4 on Wed Dec 29 15:11:27 2010
*mangle
:PREROUTING ACCEPT [1735576:104189954]
:INPUT ACCEPT [1735512:104181797]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [2877496:3782379744]
:POSTROUTING ACCEPT [2874912:3782220690]
COMMIT
# Completed on Wed Dec 29 15:11:27 2010