ipfiltering rules problem

ipfiltering rules problem

Post by Q » Mon, 18 Sep 2000 16:01:46



I have recently changed the ipfiltering rules as follow, it doesn't
allow in-bound packet to my ssh port at all.

#I use the following IPFilter rules (tun0 is the public interface)
pass out quick on tun0 proto udp   from  any to  any keep state
pass out quick on tun0 proto icmp  from  any to  any keep state
pass out quick on tun0 proto tcp   from  any to  any keep state

#block ICMP on outside interface but allow type 0, ping,
#and type 11, traceroute, in
pass  in  log  quick  on  tun0  proto icmp from    any  to any icmp-type
0
pass  in  log  quick  on  tun0  proto icmp from    any  to any icmp-type
11
block in  log  quick  on  tun0  proto icmp from    any  to any

#block non-routed nets on the outside interface as those have to be
spoofed
block in  log  quick  on  tun0  from  10.0.0.0/8     to   any
block in  log  quick  on  tun0  from  172.16.0.0/12  to   any
block in  log  quick  on  tun0  from  192.168.0.0/16 to   any
block in  log  quick  on  tun0  from  127.0.0.0/8    to   any
block out log  quick  on  tun0  from  10.0.0.0/8     to   any
block out log  quick  on  tun0  from  172.16.0.0/12  to   any
block out log  quick  on  tun0  from  192.168.0.0/16 to   any
block out log  quick  on  tun0  from  127.0.0.0/8    to   any

#block FUP packets used by nmap to do fingerprinting
block in  log  quick  on  tun0  proto tcp   from    any to any  flags
FUP

block in  log  on    tun0 from    any to  any

#Allow Standard HTTP
pass  in  quick  on  tun0  from    any to  any port = 80

#Allow HTTPS
pass  in  quick on   tun0  from    any to  any port = 443

#allow ssh
pass  in  quick on   tun0  from    any to  any port = 22

What is wrong with this rules ?

Thanks
Sam

 
 
 

ipfiltering rules problem

Post by Victo » Mon, 18 Sep 2000 04:00:00


Try to use keep state on the SSH rule.

pass in quick on tun0           from any to any port = 22 keep state
or
pass in quick on tun0 proto tcp from any to any port = 22 flags S keep state

HTH
Victor


Quote:> I have recently changed the ipfiltering rules as follow, it doesn't
> allow in-bound packet to my ssh port at all.

> #I use the following IPFilter rules (tun0 is the public interface)
> pass out quick on tun0 proto udp   from  any to  any keep state
> pass out quick on tun0 proto icmp  from  any to  any keep state
> pass out quick on tun0 proto tcp   from  any to  any keep state

> #block ICMP on outside interface but allow type 0, ping,
> #and type 11, traceroute, in
> pass  in  log  quick  on  tun0  proto icmp from    any  to any icmp-type
> 0
> pass  in  log  quick  on  tun0  proto icmp from    any  to any icmp-type
> 11
> block in  log  quick  on  tun0  proto icmp from    any  to any

> #block non-routed nets on the outside interface as those have to be
> spoofed
> block in  log  quick  on  tun0  from  10.0.0.0/8     to   any
> block in  log  quick  on  tun0  from  172.16.0.0/12  to   any
> block in  log  quick  on  tun0  from  192.168.0.0/16 to   any
> block in  log  quick  on  tun0  from  127.0.0.0/8    to   any
> block out log  quick  on  tun0  from  10.0.0.0/8     to   any
> block out log  quick  on  tun0  from  172.16.0.0/12  to   any
> block out log  quick  on  tun0  from  192.168.0.0/16 to   any
> block out log  quick  on  tun0  from  127.0.0.0/8    to   any

> #block FUP packets used by nmap to do fingerprinting
> block in  log  quick  on  tun0  proto tcp   from    any to any  flags
> FUP

> block in  log  on    tun0 from    any to  any

> #Allow Standard HTTP
> pass  in  quick  on  tun0  from    any to  any port = 80

> #Allow HTTPS
> pass  in  quick on   tun0  from    any to  any port = 443

> #allow ssh
> pass  in  quick on   tun0  from    any to  any port = 22

> What is wrong with this rules ?

> Thanks
> Sam


 
 
 

ipfiltering rules problem

Post by Q » Tue, 19 Sep 2000 06:07:01


I've tried both, it still doesn't allow inbound ssh.

Thanks
Sam.


> Try to use keep state on the SSH rule.

> pass in quick on tun0           from any to any port = 22 keep state
> or
> pass in quick on tun0 proto tcp from any to any port = 22 flags S keep state

> HTH
> Victor



> > I have recently changed the ipfiltering rules as follow, it doesn't
> > allow in-bound packet to my ssh port at all.

> > #I use the following IPFilter rules (tun0 is the public interface)
> > pass out quick on tun0 proto udp   from  any to  any keep state
> > pass out quick on tun0 proto icmp  from  any to  any keep state
> > pass out quick on tun0 proto tcp   from  any to  any keep state

> > #block ICMP on outside interface but allow type 0, ping,
> > #and type 11, traceroute, in
> > pass  in  log  quick  on  tun0  proto icmp from    any  to any icmp-type
> > 0
> > pass  in  log  quick  on  tun0  proto icmp from    any  to any icmp-type
> > 11
> > block in  log  quick  on  tun0  proto icmp from    any  to any

> > #block non-routed nets on the outside interface as those have to be
> > spoofed
> > block in  log  quick  on  tun0  from  10.0.0.0/8     to   any
> > block in  log  quick  on  tun0  from  172.16.0.0/12  to   any
> > block in  log  quick  on  tun0  from  192.168.0.0/16 to   any
> > block in  log  quick  on  tun0  from  127.0.0.0/8    to   any
> > block out log  quick  on  tun0  from  10.0.0.0/8     to   any
> > block out log  quick  on  tun0  from  172.16.0.0/12  to   any
> > block out log  quick  on  tun0  from  192.168.0.0/16 to   any
> > block out log  quick  on  tun0  from  127.0.0.0/8    to   any

> > #block FUP packets used by nmap to do fingerprinting
> > block in  log  quick  on  tun0  proto tcp   from    any to any  flags
> > FUP

> > block in  log  on    tun0 from    any to  any

> > #Allow Standard HTTP
> > pass  in  quick  on  tun0  from    any to  any port = 80

> > #Allow HTTPS
> > pass  in  quick on   tun0  from    any to  any port = 443

> > #allow ssh
> > pass  in  quick on   tun0  from    any to  any port = 22

> > What is wrong with this rules ?

> > Thanks
> > Sam

 
 
 

ipfiltering rules problem

Post by Victo » Tue, 19 Sep 2000 14:07:58


1. Add this

pass out quick on lo0 all
pass in  quick on lo0 all

2. Also, check weather default works

## Beg of File: /etc/ipf.rules
pass in all
pass out all
## End of File: /etc/ipf.rules

check that SSH is running and that it isn't a problem with something like
host.deny or tcpwrappers or stuff like that. Make sure the sshd_config isn't
set to deny some IP as well.

3. Then try this:

######################################################################
# Allow WEB and SSH to connect to the server. Allow pings too.
######################################################################
pass in quick on xl0 proto tcp  from any to any port = 22 flags S keep state
pass in quick on xl0 proto icmp from any to any icmp-type 0
pass in quick on xl0 proto icmp from any to any icmp-type 11

######################################################################
# Allow Statefull connection to outside
######################################################################
pass out quick on xl0 proto tcp/udp from any to any keep state
pass out quick on xl0 proto icmp    from any to any keep state

######################################################################
# Default DENY policy
######################################################################
block out all
block in  all


> I've tried both, it still doesn't allow inbound ssh.

> Thanks
> Sam.


> > Try to use keep state on the SSH rule.

> > pass in quick on tun0           from any to any port = 22 keep state
> > or
> > pass in quick on tun0 proto tcp from any to any port = 22 flags S keep
state

> > HTH
> > Victor



> > > I have recently changed the ipfiltering rules as follow, it doesn't
> > > allow in-bound packet to my ssh port at all.

> > > #I use the following IPFilter rules (tun0 is the public interface)
> > > pass out quick on tun0 proto udp   from  any to  any keep state
> > > pass out quick on tun0 proto icmp  from  any to  any keep state
> > > pass out quick on tun0 proto tcp   from  any to  any keep state

> > > #block ICMP on outside interface but allow type 0, ping,
> > > #and type 11, traceroute, in
> > > pass  in  log  quick  on  tun0  proto icmp from    any  to any
icmp-type
> > > 0
> > > pass  in  log  quick  on  tun0  proto icmp from    any  to any
icmp-type
> > > 11
> > > block in  log  quick  on  tun0  proto icmp from    any  to any

> > > #block non-routed nets on the outside interface as those have to be
> > > spoofed
> > > block in  log  quick  on  tun0  from  10.0.0.0/8     to   any
> > > block in  log  quick  on  tun0  from  172.16.0.0/12  to   any
> > > block in  log  quick  on  tun0  from  192.168.0.0/16 to   any
> > > block in  log  quick  on  tun0  from  127.0.0.0/8    to   any
> > > block out log  quick  on  tun0  from  10.0.0.0/8     to   any
> > > block out log  quick  on  tun0  from  172.16.0.0/12  to   any
> > > block out log  quick  on  tun0  from  192.168.0.0/16 to   any
> > > block out log  quick  on  tun0  from  127.0.0.0/8    to   any

> > > #block FUP packets used by nmap to do fingerprinting
> > > block in  log  quick  on  tun0  proto tcp   from    any to any  flags
> > > FUP

> > > block in  log  on    tun0 from    any to  any

> > > #Allow Standard HTTP
> > > pass  in  quick  on  tun0  from    any to  any port = 80

> > > #Allow HTTPS
> > > pass  in  quick on   tun0  from    any to  any port = 443

> > > #allow ssh
> > > pass  in  quick on   tun0  from    any to  any port = 22

> > > What is wrong with this rules ?

> > > Thanks
> > > Sam

 
 
 

1. ipfilter problem - "pass in" rules not active after boot

  After rebooting my OpenBSD 2.7 box, the "pass in" rules in ipf.rules
are silently dropped.
  When doing a "ipfstat -i" after a reboot they are not listed, but all
the other 30 or so rules are.  When I do a "ipf -Fa -f /etc/ipf.rules"
manually, everything works.

  The rules (broken lines - should be four):

pass  in      quick on rl0 proto tcp from any to rl0/32 port = http flags S keep
state
pass  in  log quick on rl0 proto tcp from any to rl0/32 port = ssh flags S keep
state
pass  in  log quick on rl0 proto tcp from any to rl0/32 port = mail flags S keep
state
pass  in      quick on rl0 proto udp from any to rl0/32 port = domain keep state

  What could be wrong?

--
  Roger Andersson                         Q       "My eyes on the wheel

  http://www.lysator.liu.se/~roger/ { _`---'_ }            -Cat Rapes Dog
                                     'o`   'o`    

2. CDE + Solaris 2.6 Problem

3. ipfilter rule set..?

4. File sizes in Solaris 2.5.1

5. ipfilter why does moving a rule break it?

6. NATD having permission problems while running

7. ipfilter rule set

8. Apache behind a Port Adress Translation router

9. Converting ipchains rules to ipfilter, please!

10. ipfilter rule

11. IPFILTER NAT Rules

12. How to set FTP rule in IPFilter firewall on Solaris 8(x86)??

13. easy one...IPFilter rule to allow email through