SunQuest
           BSD Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsBSD Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
1200+ fellow developers rate and compare features of the top IDEs, like Visual Studio, Eclipse, RAD, Delphi and others, across 13 categories. Enjoy this FREE Download of the IDE User Satisfaction Study by Evans Data Corporation. Download Now!
  #1  
Old July 6th, 2002, 01:08 AM
jondoor jondoor is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2001
Location: ny
Posts: 15 jondoor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Help! ipfw causing SLOW sshd?

I am running FreeBSD 4.5-release-p5, and openssh 3.4_2 installed via ports tree

I just setup apache, and then DNS, I then firewall the box with ipfw; under my current rules everything “works” the only problem is that since the firewall went on login time over sshd has become incredibly slow:

Initial login prompt is very slow.
Denial of a wrong passwd is fast.
Access from a correct passwd is slow again.
Once I do get a command prompt speed is normal.

netstat is also very slow in returning any output.
w returning its output is slower than normal.


the machine has two ip address on the same interface(rl0), the idea in the rules is to have sshd,httpd,email,dns on the primary ip while only dns on the secondary ip. sshd and httpd are bound to primary ip from their config files, and email is not running yet.

Here are my current ipfw rules as they appear /etc/rc.firewall:

### Allow any ssh traffic to primary ip ###
${fwcmd} add pass tcp from any to ${pip} 22 setup

### Allow TCP through if setup succeeded ###
${fwcmd} add pass tcp from any to any established

### Allow IP fragments to pass through ###
${fwcmd} add pass all from any to any frag

### Allow http traffic to primary ip ###
${fwcmd} add pass tcp from any to ${pip} 80 setup

### Allow setup of incoming email to primary ip ###
${fwcmd} add pass tcp from any to ${pip} 25 setup

### Allow incoming DNS quesies to all addresses ###
${fwcmd} add pass udp from any to any 53

### Allow setup of outgoing connections only ###
${fwcmd} add pass tcp from me to any setup
${fwcmd} add pass udp from me to any keep-state
${fwcmd} add pass icmp from me to any keep-state


here they are again as the display from ipfw show:

00100 0 0 allow ip from any to any via lo0
00200 0 0 deny ip from any to 127.0.0.0/8
00300 0 0 deny ip from 127.0.0.0/8 to any
00400 2 108 allow tcp from any to 12.158.191.94 22 setup
00500 855 66249 allow tcp from any to any established
00600 0 0 allow ip from any to any frag
00700 1 48 allow tcp from any to 12.158.191.94 80 setup
00800 0 0 allow tcp from any to 12.158.191.94 25 setup
00900 25 1850 allow udp from any to any 53
01000 0 0 allow tcp from me to any setup
01100 0 0 allow udp from me to any keep-state
01200 0 0 allow icmp from me to any keep-state
65535 216 26717 deny ip from any to any


sysctl.conf entries:

net.inet.tcp.blackhole=2
net.inet.udp.blackhole=1
net.inet.ip.ttl=68

thanks
-jon door

Last edited by jondoor : July 6th, 2002 at 01:12 AM.

Reply With Quote
  #2  
Old July 6th, 2002, 07:59 AM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
1) How do you know it must be the firewall problem?
2) How about FTP? Apache?
3) Zip and attach your /etc/ssh/ssh_config, /etc/ssh/sshd_config, /etc/hosts.allow, /etc/resolv.conf and /etc/hosts here.

Reply With Quote
  #3  
Old July 6th, 2002, 10:45 AM
jondoor jondoor is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2001
Location: ny
Posts: 15 jondoor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Smile I fixed the problem.

It turned out to be a problem with name resolution.

i tweaked my rules to make port 53 statefull:
${fwcmd} add pass udp from any to any 53 keep-state

it seems to be all smoothed out now.

thanks
-Jon Door

Last edited by jondoor : July 6th, 2002 at 10:47 AM.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsBSD Help > Help! ipfw causing SLOW sshd?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway