pf sanity check

So I think I got my OpenBSD firewall woes worked out, but I could use a sanity check... What I have seems to be working, but I'd like some confirmation that my assumptions are true.

<LJ-CUT text=" Read on if you understand this crap. --More--( 6%) ">

Background:

  • OpenBSD 3.5 firewall PC with multiple interfaces;
  • Multiple 100baseT internal networks;
  • One uplink network to the T1.

Goal:

  • Don't let any attempted bandwidth-hogging activity between any internal network and the T1 affect the stability of the webcast uplinks;
  • Beyond that, pretty much first-come first-serve.

How I did this (which may or may not be the only way):

  • From reading the documentation, I had been under the impression that if we did "pass in" with "keep state" to allow some packet to enter the firewall, then that packet could also automatically exit the firewall (pass through it on its way to the destination.)

    Everything I've read made it sound like once you did "keep state" to establish a state table entry, the state table took precedence over any rules: when there's a state table match, the rules aren't consulted at all.

    This doesn't seem to be the case. It seems that two rules must fire for each session: one to allow the first packet to enter the firewall on one interface (and establish a state table entry); and then a second rule to allow that same packet to exit the firewall on a different interface (and establish a second state table entry.) After that, subsequent packets are processed by the state table, and rules are never consulted for the rest of the session. But that first packet needs two rules.

    So, to ever make anything work, there needs to be a default "pass out" rule (either that, or two rules for every "session", which would be just ridiculously verbose.)

  • Secondly, it would seem that it is the "pass out" rules that must assign packets to queues. This is because my queues are intended to throttle packets that are going from the internal networks up the T1; this means they must be defined on the T1's network interface.

    So the way to accomplish this is, the "pass in" rules (wherein the knowledge of what connections we allow and what they are for is encoded) tag the packets with the name of the queue they are destined for. Then, the following "pass out" rules assign the packets to queues based on how they were tagged on the way in.

    This seems needlessly complicated to me: I don't understand why I can't assign the packets to the queues on the inbound packets (and have that be automatically carried over when the packets are outbound) but that seems to be how it works. (Right?)

Specficially:

    • mp3_queue -- Icecast uplink. Needs 128Kbps+.
    • real_queue -- RealProducer/RealVideo uplink. Needs 650Kbps+.
    • std_queue -- The default queue. Mostly this will be packets originating on office and DMZ hosts.
    • guest_queue -- All packets originating on kiosk and wireless networks. These are lowest priority.

    All queues have a minimum bandwidth guarenteed to them, and all are allowed to use more bandwidth if it is available/unused. Aside from that, they all have the same "priority", meaning that within their bandwidth limits, all packets are handled first-come-first-serve.

      altq on $ext_if cbq bandwidth 1.4Mb \
      queue { mp3_queue, real_queue, guest_queue, std_queue }
      queue mp3_queue bandwidth 160Kb cbq (borrow)
      queue real_queue bandwidth 700Kb cbq (borrow)
      queue std_queue bandwidth 200Kb cbq (borrow default)
      queue guest_queue bandwidth 200Kb cbq (borrow)

      ...

      block in log all # default deny

      pass out all keep state # goes to std_queue by default
      pass out on $ext_if tagged mp3_queue queue mp3_queue keep state
      pass out on $ext_if tagged real_queue queue real_queue keep state
      pass out on $ext_if tagged std_queue queue std_queue keep state
      pass out on $ext_if tagged guest_queue queue guest_queue keep state

      ...

      # icecast/mp3 uplink (tcp incoming)
      pass in proto tcp \
      from $external_icecast \
      to $internal_icecast port = 8000 \
      flags S/SA keep state \
      tag mp3_queue

      # realvideo uplink (tcp outgoing; udp both ways)
      pass in proto tcp \
      from $internal_real \
      to $external_real port { 554, 4040 } \
      flags S/SA keep state \
      tag real_queue

      pass in proto udp \
      from { $internal_real, $external_real } \
      to { $internal_real, $external_real } \
      keep state \
      tag real_queue

      ...etc.

    Does that all make sense? Or could it be simplified?

Tags: , , , , ,
Current Music: Screamin

John Stewart on Crossfire

This is hilarious -- a transcript of John Stewart on Crossfire, and not once did he refer to Robert Novak as a Douchebag of Liberty!
    STEWART:     In many ways, it's funny. And I made a special effort to come on the show today, because I have privately, amongst my friends and also in occasional newspapers and television shows, mentioned this show as being bad.
    BEGALA:     We have noticed.
    STEWART:     And I wanted to -- I felt that that wasn't fair and I should come here and tell you that I don't -- it's not so much that it's bad, as it's hurting America.
    CARLSON:     But in its defense...
    STEWART:     So I wanted to come here today and say... Here's just what I wanted to tell you guys.
    CARLSON:     Yes.
    STEWART:     Stop.
    Stop, stop, stop, stop hurting America.
    ...
    STEWART:     No, no, no, you're not too rough on them. You're part of their strategies. You are partisan, what do you call it, hacks.
Tags:

Schoolhouse Rock!

This is pretty great: Pirates and Emperors

Tags: , ,

that's a really good look for you

"Models walk down the catwalk displaying the creations of fashion designer Lidija Kolovrat Thursday, Oct. 14 2004, during the Lisboa Fashion Week in Lisbon, Portugal. (AP Photo/Armando Franca)"
Tags: ,

it rubs the lotion into its skin or else it gets the hose again




Face Corsets!

Mr Hartley explained: "I wanted to make a series of garments in response to facial ideals of today. I was interesting in how the soft tissues of the face can be manipulated, moved around and changed. It's the same way that body corsets were used to change the figure."

He designed some of the facial corsets to mimic results of surgery to augment cheeks with the use of implants and lip enhancement in response to botox injection treatments. Others redirect the lips and cheeks contrary to the accepted ideals of the 'western face'.

Rearranging faces is one of a series of free events being held at the Science Museum's Dana Centre, London, which are dedicated to exploring the future of face research and are running from 5 October until 2 December 2004.

Tags: , ,

I, for one, welcome our new psychic cyborg overlords

Paralysed man sends e-mail by thought: Brain chip reads mind by tapping straight into neurons.

A pill-sized brain chip has allowed a quadriplegic man to check e-mail and play computer games using his thoughts. The device can tap into a hundred neurons at a time, and is the most sophisticated such implant tested in humans so far.

In June 2004, surgeons implanted a device containing 100 electrodes into the motor cortex of a 24-year-old quadriplegic. Each electrode taps into a neuron in the patient's brain. The BrainGate allowed the patient to control a computer or television using his mind, even when doing other things at the same time. Researchers report for example that he could control his television while talking and moving his head.

Tags: , , ,

ten years?

Apparently today it is exactly ten years after the first public beta of Mosaic Netscape was released to the world. How did it get to be ten years already? I only realized that it had been this long when a reporter mailed me asking for a comment the day before yesterday...
Tags: ,

a stroll in the pork

Again, how can there be no photos?

Pig guts cause smelly traffic jam

LITTLE ROCK, Arkansas -- Emergency service workers had their stomachs turned when they cleaned up a smelly mess of spilled pig innards that blocked a busy Arkansas intersection for several hours Tuesday. Police said a truck spilled about 1,000 pounds of hog intestines fresh from a packing plant. The mess in the state capital, Little Rock, left several cleanup workers queasy.

"It was horrible. Oh, it was bad," said Sgt. Terry Hastings of the Little Rock police department.

The truck was carrying the entrails from a rendering plant to a facility where dog food is manufactured when the driver made an abrupt stop. The container was covered only by a tarp, which did not prevent the viscera from sloshing into the crossroads, police said.

Firefighters used bleach and fire hoses to flush away the mess. When asked to describe the scene, Hastings was almost at a loss for words. "Nasty, nasty. Phew," Hastings said.

Tags:

dnalounge update

DNA Lounge updatelet, wherein big men in costumes hit each other.
Comments Off
Tags: ,

Oklahoma, where the lesbians come sweepin' down the plain

GOP Senate Candidate Warns of Lesbianism

OKLAHOMA CITY - The Republican Senate candidate in Oklahoma warns of "rampant" lesbianism in some schools in the state in a tape released Monday by his Democratic opponent.

In the tape released by the campaign of Brad Carson, the Democratic candidate, Coburn says a campaign worker from Coalgate told him that "lesbianism is so rampant in some of the schools in southeast Oklahoma that they'll only let one girl go to the bathroom. Now think about it. Think about that issue. How is it that that's happened to us?"

The comment came at a town hall meeting in Hugo on Aug. 31 and was taped by a Democratic campaign worker.

Tags: ,