joe,
a couple of questions, then we can get started...
a) my assumption is that you want to use the solaris box to
provide (possibly among other things) http proxy services
to clients on the 10.0.0.0/24 net -- is this correct?
b) you currently do not have any ipnat mappings. maybe
this is because you didn't know you needed them, or
maybe this is because you took them out for testing.
which of those sounds about right?
ok, let's start with a little primer so that you have some
things to think about while we work on your configs.
i'll make some general statements below, and then we
can work on the specifics for your situation...
ipfilter (aka "the package") consists of two parts:
ipf = a packet *filter* [most often used for firewalling]
ipnat = a packet *rewriter* [most often used for NAT]
it is very important that you differentiate the purpose
and application of the ipf and ipnat portions of ipfilter.
they are indeed two disparate applications -- but they
work togther nicely (perhaps that was the intention of
the programmer? :*)
the first step in getting things going is to turn off squid.
yep, that's right, kill it. get it out of the way. you need
to get to the point where the clients on 10.0.0.0/24 can
surf all by themselves. that will tell you routing and dns,
among other things, are working. meanwhile, configure
your clients to use the solaris box as the gateway, and
there should be no http proxy configured on the client
browsers as well. i'm assuming that you know how to
config the dns on the clients as well. so where to start?
first we need to put some rules in your ipnat.conf which
will rewrite the packets coming from the clients (i.e. hosts
on the 10.0.0.0/24 net), and change the source address
(and perhaps the ports) to mimic your external interface.
this is the essence of NATing, and therefore we need to
play a bit with ipnat's config file called "ipnat.conf"...
$ cat /etc/opt/ipf/ipnat.conf
#
# a mapping for NATing the 10.0.0.0/24 network via a single
# IP address, and enable proxy for the ftp protocol...
map eri0 10.0.0.0/24 -> 212.X.Y.Z/32 proxy port ftp ftp/tcp
map eri0 10.0.0.0/24 -> 212.X.Y.Z/32 portmap tcp/udp 10000:24000
map eri0 10.0.0.0/24 -> 212.X.Y.Z/32
# enable the ftp proxy for the firewall host as well...
map eri0 212.X.Y.Z/32 -> 212.X.Y.Z/32 proxy port ftp ftp/tcp
now then, assuming that your ipf.conf (the firewall part) is nulled
out, your clients should be able to surf the net. this is step 1.
the firewall now needs to be set up to allow outgoing packets
to set up states so that return packets associated with those
sessions can once again traverse the firewall on the return trip.
so lets configure a minimal set of ipf rules to get you started...
$ cat /etc/opt/ipf/ipf.conf
#
# filter rules for ipfilter (pkginfo ipf)
# file: /etc/opt/ipf/ipf.conf
#
# after making changes:
# /etc/init.d/ipfboot reload
#
# or via brute force:
# /etc/init.d/ipfboot stop; sleep 1; /etc/init.d/ipfboot start
# ip packet filtering rulesets:
# generic to all interfaces
block in log quick all with opt lsrr
block in log quick all with opt ssrr
block in log quick all with ipopts
block in log quick proto tcp all with short
block in log quick proto icmp all with frag
#
# inbound rules on iprb0 (default deny)
block in on eri0 all
# pass out all on eri0, and keep state
pass out quick on eri0 proto tcp all flags S keep state keep frags
pass out quick on eri0 proto udp all keep state keep frags
pass out quick on eri0 proto icmp all keep state keep frags
pass out quick on eri0 all
hence, nothing is coming in on eri0 *except* the replies for
sessions that were initiated on the "clean" side of the box.
welcome to stateful packet filtering! you'll note that there
are no rules for the internal hme1 interface; for now let it
run free -- fewer problems to deal with.
to load everything you just changed in the conf files, run (as root)
$ /etc/init.d/ipfboot reload
there should be no error messages -- if so, check you syntax
and/or my cut-n-pasting for errors.
ok, now you need to go off and get all of the above understood
and working. once all of the above is working we can then
help you with getting squid going in either non-transparent or
transparent mode. the former means you have to configure
your browser to point to the proxy, the latter means that the
browser doesn't need special configuration. in that case the
combination of ipfilter+squid on the firewall is "hidden" from
the clients (for the most part).
let us know where you are at.
jim
Joseph Spenner wrote:
>I'm running squid 2.4 as a proxy on a Blade 100,
>Solaris 8. 2 ethernets:
>
>hme1: 10.0.0.1 (internal private net)
>eri0: 212.X.Y.Z (external Internet connection)
>
>I simply want the machine to proxy, and ipfilter
>(v3.4.25) to allow 2 way communication on established
>connections. I want to block everything else hitting
>eri0. From what I've read, the 'keep state' should do
>this, but I can't get it to work correctly. Here's
>what I've got so far (from various FAQs, like
>http://www.obfuscation.org/ipf/ipf-howto.html#TOC_20):
>
>block in log quick on eri0 all
>pass out quick on eri0 proto tcp from any to any keep
>state
>pass out quick on eri0 proto udp from any to any keep
>state
>pass out quick on eri0 proto icmp from any to any keep
>state
>
>From this FAQ I found:
>
>block in proto tcp all
>block out proto tcp all
>pass in quick proto tcp from any to any port = smtp
>flags S keep state
>
>Which appears to be more specific for sendmail, but
>removing "port=smtp" should make it more generic.
>
>I tried variations on the above 2 examples, but
>continue to get blocked on return traffic as in the
>following sample log entry:
>
>May 13 21:50:56 proxyboxy ipmon[160]: [ID 702911
>local0.warning] 21:50:55.289461 eri0 @0:9 b
>207.217.98.16,80 -> 212.X.Y.Z,10331 PR tcp len 20 40
>-A IN
>
>Any help would be great.
>
>Thanks!
>
>Info:
>
># uname -a
>SunOS proxyboxy 5.8 Generic_108528-14 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
>eri0:
>flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu
>1500 index 2
> inet 212.X.Y.Z netmask ffffff00 broadcast
>212.X.Y.255
> ether 0:3:ba:c:e3:2
>hme1:
>flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu
>1500 index 3
> inet 10.0.0.1 netmask ffffff00 broadcast
>10.0.0.255
> ether 0:3:ba:c:e3:2
># netstat -rn
>
>Routing Table: IPv4
> Destination Gateway Flags Ref
>Use Interface
>-------------------- -------------------- ----- -----
>------ ---------
>212.X.Y.0 212.X.Y.Z U 1 373
>eri0
>10.0.0.0 10.0.0.1 U 1 241
> hme1
>default 212.X.Y.W UG 1
>858
>127.0.0.1 127.0.0.1 UH 21
>10679 lo0
>
># netstat -i
>Name Mtu Net/Dest Address Ipkts Ierrs
>Opkts Oerrs Collis Queue
>lo0 8232 loopback localhost 16318 0
>16318 0 0 0
>eri0 1500 proxyboxy proxyboxy 745964 43831 32391 1
> 149 0
>hme1 1500 proxy-int proxy-int 575292 0 79439 0
> 13163 0
>
># netstat -s -P ip
>
>
>IPv4 ipForwarding = 2 ipDefaultTTL
> = 255
> ipInReceives =486196 ipInHdrErrors
> = 0
> ipInAddrErrors = 0 ipInCksumErrs
> = 0
> ipForwDatagrams = 0
>ipForwProhibits = 55268
> ipInUnknownProtos = 0 ipInDiscards
> = 87393
> ipInDelivers =138291 ipOutRequests
> =111232
> 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 = 0 udpNoPorts
> =207177
> udpInCksumErrs = 0 udpInOverflows
> = 0
> rawipInOverflows = 0
>ipsecInSucceeded = 0
> ipsecInFailed = 0 ipInIPv6
> = 0
> ipOutIPv6 = 0
>ipOutSwitchIPv6 = 1
># ipf -V
>ipf: IP Filter: v3.4.25 (496)
>Kernel: IP Filter: v3.4.25
>Running: yes
>Log Flags: 0 = none set
>Default: pass all, Logging: available
>Active list: 1
># ipfstat
>dropped packets: in 0 out 0
>non-data packets: in 10 out 10
>no-data packets: in 0 out 0
>non-ip packets: in 0 out 0
> bad packets: in 0 out 0
>copied messages: in 1063 out 72921
> IPv6 packets: in 0 out 0
> input packets: blocked 85142 passed 486238
>nomatch 247943 counted 0 short 0
>output packets: blocked 5 passed 111249
>nomatch 46017 counted 0 short 0
> input packets logged: blocked 1520 passed 41
>output packets logged: blocked 5 passed 24
> 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 1463 lost 114
>packet state(out): kept 227 lost 0
>ICMP replies: 0 TCP RSTs sent: 0
>Invalid source(in): 0
>Result cache hits(in): 53514 (out): 43388
>IN Pullups succeeded: 0 failed: 0
>OUT Pullups succeeded: 8 failed: 0
>Fastroute successes: 0 failures: 0
>TCP cksum fails(in): 0 (out): 0
>Packet log flags set: (0)
> none
># ipfstat -io
>
>
># ipfstat -io
>
>pass out quick on eri0 proto tcp from any to any keep
>state
>pass out quick on eri0 proto udp from any to any keep
>state
>pass out quick on eri0 proto icmp from any to any keep
>state
>block in log quick on eri0 from any to any
>
>
>
>
>
># ipnat -slv
>mapped in 0 out 0
>added 0 expired 0
>no memory 0 bad nat 0
>inuse 0
>rules 0
>wilds 0
>table ffffffff7ffffc90 list 0
>List of active MAP/Redirect filters:
>
>List of active sessions:
>
>List of active host mappings:
>#
>
>
>__________________________________________________
>Do You Yahoo!?
>LAUNCH - Your Yahoo! Music Experience
>http://launch.yahoo.com
>