I have spent a little time on google and the IPFilter resources that can
be gleaned from the FAQ and have had no luck finding a similar situation.
I have a Sparc system that I am running IPF on and it seems to be losing
the ACK packet while establishing most TCP connection on the initial
attempt causing failed connections for most of my services. The one
exception to this is SSH, which seems to be working fine. It is the only
service that is not RDR to a machine inside the network, which may have a
little to do with the issue at hand. Attached below is my configuration
information as listed in the FAQ. The rule for handling port 25 was
intentionally opened up to minimize the effects of this issue, but it
doesn't seems to work reliably. If I use keep state and monitor the
connection attempts using state top, I see that the connection state stays
at 2/3 for the services that are redirected. If a second attempt is made
before the first one times out, the connection will work fine.
I have made several modifications to the system from a baseline Solaris
installation, primarily, I am running nddconfig which comes with Sun's
JASS toolkit for hardening the machine. Not sure if this impacts IPF.
# uname -a
SunOS unknown 5.9 Generic_112233-08 sun4u sparc SUNW,Sun-Blade-100
# isainfo -vk
64-bit sparcv9 kernel modules
# ifconfig -a
lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
afe0: flags=1004843<UP,BROADCAST,RUNNING,MULTICAST,DHCP,IPv4> mtu 1500
index 2
inet 24.16.43.123 netmask fffff000 broadcast 24.207.191.255
ether 0:4:5a:61:6a:68
eri0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 3
inet 192.168.0.1 netmask ffffff00 broadcast 192.168.123.14255
ether 0:3:ba:15:5:e0
# netstat -rn
Routing Table: IPv4
Destination Gateway Flags Ref Use Interface
-------------------- -------------------- ----- ----- ------ ---------
192.168.0.0 192.168.0.1 U 1 18 eri0
24.16.43.0 24.16.43.123 U 1 34 afe0
default 24.16.43.1 UG 1 79
127.0.0.1 127.0.0.1 UH 1 0 lo0
# netstat -i
Name Mtu Net/Dest Address Ipkts Ierrs Opkts Oerrs Collis
Queue
lo0 8232 loopback localhost 37 0 37 0 0 0
afe0 1500 BV1-24.16.43.123.charter-stl.com
BV1-24.16.43.123.charter-stl.com 71883 14 12319 0 114 0
eri0 1500 unknown unknown 848 0 733 3 0 0
# netstat -s -P ip
IPv4 ipForwarding = 1 ipDefaultTTL = 255
ipInReceives = 10286 ipInHdrErrors = 0
ipInAddrErrors = 0 ipInCksumErrs = 0
ipForwDatagrams = 1396 ipForwProhibits = 0
ipInUnknownProtos = 0 ipInDiscards = 0
ipInDelivers = 8912 ipOutRequests = 11682
ipOutDiscards = 0 ipOutNoRoutes = 0
ipReasmTimeout = 60 ipReasmReqds = 0
ipReasmOKs = 0 ipReasmFails = 0
ipReasmDuplicates = 0 ipReasmPartDups = 0
ipFragOKs = 0 ipFragFails = 0
ipFragCreates = 0 ipRoutingDiscards = 0
tcpInErrs = 1 udpNoPorts = 14
udpInCksumErrs = 0 udpInOverflows = 0
rawipInOverflows = 0 ipsecInSucceeded = 0
ipsecInFailed = 0 ipInIPv6 = 0
ipOutIPv6 = 0 ipOutSwitchIPv6 = 1
# ipf -V
ipf: IP Filter: v3.4.31 (496)
Kernel: IP Filter: v3.4.31
Running: yes
Log Flags: 0 = none set
Default: pass all, Logging: available
Active list: 0
# ipfstat
dropped packets: in 0 out 0
non-data packets: in 2 out 2
no-data packets: in 0 out 0
non-ip packets: in 0 out 0
bad packets: in 0 out 0
copied messages: in 10340 out 6516
IPv6 packets: in 0 out 0
input packets: blocked 8107 passed 10368 nomatch 2 counted 0 short 0
output packets: blocked 0 passed 13149 nomatch 0 counted 0 short 0
input packets logged: blocked 14 passed 0
output packets logged: blocked 0 passed 0
packets logged: input 0 output 0
log failures: input 0 output 0
fragment state(in): kept 0 lost 0
fragment state(out): kept 0 lost 0
packet state(in): kept 20 lost 0
packet state(out): kept 15 lost 0
ICMP replies: 0 TCP RSTs sent: 0
Invalid source(in): 0
Result cache hits(in): 8162 (out): 238
IN Pullups succeeded: 0 failed: 0
OUT Pullups succeeded: 0 failed: 0
Fastroute successes: 0 failures: 0
TCP cksum fails(in): 0 (out): 0
Packet log flags set: (0)
none
# ipfstat -io
pass out quick proto tcp from any to any port = 25
pass out quick proto tcp from any port = 25 to any
pass out quick on lo0 from any to any head 2
pass out quick on eri0 from any to any head 4
block out log quick on afe0 from any to any head 6
block out log quick on afe0 from 172.16.0.0/12 to any group 6
block out quick on afe0 from 10.0.0.0/8 to any group 6
block out log quick on afe0 from 127.0.0.0/8 to any group 6
block out log quick on afe0 from 0.0.0.0/8 to any group 6
block out log quick on afe0 from 169.254.0.0/16 to any group 6
block out log quick on afe0 from 192.0.2.0/24 to any group 6
block out log quick on afe0 from 204.152.64.0/23 to any group 6
block out log quick on afe0 from 224.0.0.0/3 to any group 6
pass out quick on afe0 proto udp from any to any port = 67 keep state keep
frags group 6
pass out quick on afe0 proto tcp from any to any port = 443 flags S/FSRPAU
keep state keep frags group 6
pass out quick on afe0 proto tcp from any to any port = 25 group 6
pass out quick on afe0 proto tcp from any to any port = 53 flags S/FSRPAU
keep state keep frags group 6
pass out quick on afe0 proto udp from any to any port = 53 keep state keep
frags group 6
pass out quick on afe0 proto icmp from any to any icmp-type echorep group 6
pass out quick on afe0 proto icmp from any to any icmp-type timex group 6
block in log quick proto tcp from any to any with short
block in log quick on afe0 from any to any with opt lsrr
block in log quick on afe0 from any to any with opt ssrr
block in log quick on afe0 proto tcp from any to any flags FPU/FSRPAUC
block in quick from 12.129.205.0/24 to any
block in quick from 62.81.33.25/32 to any
block in quick from 24.217.194.36/32 to any
block in quick from 24.217.175.202/32 to any
block in quick from 66.50.145.173/32 to any
block in quick from 82.37.209.248/32 to any
pass in quick proto tcp from any to any port = 25
pass in quick proto tcp from any port = 25 to any
pass in quick on lo0 from any to any head 1
pass in quick on eri0 from any to any head 3
block in log quick on afe0 from any to any head 5
block in log quick on afe0 from 172.16.0.0/12 to any group 5
block in quick on afe0 from 10.0.0.0/8 to any group 5
block in log quick on afe0 from 127.0.0.0/8 to any group 5
block in log quick on afe0 from 0.0.0.0/8 to any group 5
block in log quick on afe0 from 169.254.0.0/16 to any group 5
block in log quick on afe0 from 192.0.2.0/24 to any group 5
block in log quick on afe0 from 204.152.64.0/23 to any group 5
block in log quick on afe0 from 224.0.0.0/3 to any group 5
pass in quick on afe0 proto tcp from any to any port = 443 flags S/FSRPAU
keep state keep frags group 5
pass in quick on afe0 proto tcp from any to any port = 80 flags S/FSRPAU
keep state keep frags group 5
pass in quick on afe0 proto tcp from any to any port = 22 flags S/FSRPAU
keep state keep frags group 5
pass in quick on afe0 proto tcp from any to any port = 995 flags S/FSRPAU
keep state keep frags group 5
pass in quick on afe0 proto tcp from any to any port = 993 flags S/FSRPAU
keep state keep frags group 5
pass in quick on afe0 proto tcp from any to any port = 25 flags S/FSRPAU
keep state keep frags group 5
pass in quick on afe0 proto udp from any to any port = 68 keep state keep
frags group 5
pass in quick on afe0 proto icmp from any to any icmp-type echorep group 5
pass in quick on afe0 proto icmp from any to any icmp-type timex group 5
block in log quick on afe0 from 192.168.0.0/16 to any
# ipnat -slv
mapped in 646 out 762
added 83 expired 81
no memory 0 bad nat 0
inuse 2
rules 7
wilds 0
table ffffffff7ffffc80 list 30000056f08
List of active MAP/Redirect filters:
map afe0 192.168.0.0/24 -> 0.0.0.0/32 portmap tcp/udp 40000:60000
map afe0 192.168.0.0/24 -> 0.0.0.0/32
rdr afe0 0.0.0.0/0 port 25 -> 192.168.123.231 port 25 tcp
rdr afe0 0.0.0.0/0 port 993 -> 192.168.123.231 port 993 tcp
rdr afe0 0.0.0.0/0 port 995 -> 192.168.123.231 port 995 tcp
rdr afe0 0.0.0.0/0 port 80 -> 192.168.123.142 port 80 tcp
rdr afe0 0.0.0.0/0 port 443 -> 192.168.123.142 port 443 tcp
List of active sessions:
RDR 192.168.123.142 443 <- -> 192.168.123.142 443
[64.175.34.72 4052]
age 51 use 0 sumd 0/0 pr 6 bkt 69/69 flags 1 drop 0/0
ifp afe0 bytes 432 pkts 9 0
RDR 192.168.123.142 443 <- -> 192.168.123.142 443
[64.175.34.72 3837]
age 35081 use 0 sumd 0/0 pr 6 bkt 108/108 flags 1 drop 0/0
ifp afe0 bytes 280 pkts 7 0
List of active host mappings: